rubyzip 3.0.0.rc1 → 3.0.0.rc2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Changelog.md +2 -0
- data/lib/zip/entry.rb +23 -12
- data/lib/zip/version.rb +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7a2a18261870066289dfb751472f788cf6cc3cecb119b14ddfe33b982823215e
|
4
|
+
data.tar.gz: 96db40d3eb0b9bd9ad96ae51c3f9ec0ca1fa290352aefd969c03a558c4f9dbe7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e6dde3c07ee1a5949996cce233db30b51d96b5c3947ce590b1677bf6bb69f62a155253615b2c44d63af77264e0cbaf5c3be7e16996b6ad27674a5ac307fb1d0a
|
7
|
+
data.tar.gz: bf6b290da9be2332de71fe6ba13ba5491d3c4bdfdd92f67b7276790bce535195950631071ba96d02e0800b030bf8332020b96c93effe35a03287b63ad7f94400
|
data/Changelog.md
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
# 3.0.0 (Next)
|
2
2
|
|
3
|
+
- Fix de facto regression for input streams.
|
3
4
|
- Fix `File#write_buffer` to always return the given `io`.
|
4
5
|
- Add `Entry#absolute_time?` and `DOSTime#absolute_time?` methods.
|
5
6
|
- Use explicit named parameters for `File` methods.
|
@@ -39,6 +40,7 @@
|
|
39
40
|
|
40
41
|
Tooling/internal:
|
41
42
|
|
43
|
+
- Add a test to ensure correct version number format.
|
42
44
|
- Update the README with new Ruby version compatability information.
|
43
45
|
- Fix various issues with JRuby tests.
|
44
46
|
- Update gem dependency versions.
|
data/lib/zip/entry.rb
CHANGED
@@ -113,7 +113,7 @@ module Zip
|
|
113
113
|
end
|
114
114
|
|
115
115
|
def incomplete? # :nodoc:
|
116
|
-
gp_flags & 8 == 8
|
116
|
+
(gp_flags & 8 == 8) && (crc == 0 || size == 0 || compressed_size == 0)
|
117
117
|
end
|
118
118
|
|
119
119
|
# The uncompressed size of the entry.
|
@@ -343,24 +343,25 @@ module Zip
|
|
343
343
|
|
344
344
|
def read_local_entry(io) # :nodoc:
|
345
345
|
@dirty = false # No changes at this point.
|
346
|
-
|
346
|
+
current_offset = io.tell
|
347
347
|
|
348
|
-
|
348
|
+
read_local_header_fields(io)
|
349
349
|
|
350
|
-
|
351
|
-
raise
|
352
|
-
end
|
350
|
+
if @header_signature == SPLIT_FILE_SIGNATURE
|
351
|
+
raise SplitArchiveError if current_offset.zero?
|
353
352
|
|
354
|
-
|
353
|
+
# Rewind, skipping the data descriptor, then try to read the local header again.
|
354
|
+
current_offset += 16
|
355
|
+
io.seek(current_offset)
|
356
|
+
read_local_header_fields(io)
|
357
|
+
end
|
355
358
|
|
356
359
|
unless @header_signature == LOCAL_ENTRY_SIGNATURE
|
357
|
-
|
358
|
-
raise SplitArchiveError
|
359
|
-
end
|
360
|
-
|
361
|
-
raise Error, "Zip local header magic not found at location '#{local_header_offset}'"
|
360
|
+
raise Error, "Zip local header magic not found at location '#{current_offset}'"
|
362
361
|
end
|
363
362
|
|
363
|
+
@local_header_offset = current_offset
|
364
|
+
|
364
365
|
set_time(@last_mod_date, @last_mod_time)
|
365
366
|
|
366
367
|
@name = io.read(@name_length)
|
@@ -721,6 +722,16 @@ module Zip
|
|
721
722
|
|
722
723
|
private
|
723
724
|
|
725
|
+
def read_local_header_fields(io) # :nodoc:
|
726
|
+
static_sized_fields_buf = io.read(::Zip::LOCAL_ENTRY_STATIC_HEADER_LENGTH) || ''
|
727
|
+
|
728
|
+
unless static_sized_fields_buf.bytesize == ::Zip::LOCAL_ENTRY_STATIC_HEADER_LENGTH
|
729
|
+
raise Error, 'Premature end of file. Not enough data for zip entry local header'
|
730
|
+
end
|
731
|
+
|
732
|
+
unpack_local_entry(static_sized_fields_buf)
|
733
|
+
end
|
734
|
+
|
724
735
|
def set_time(binary_dos_date, binary_dos_time)
|
725
736
|
@time = ::Zip::DOSTime.parse_binary_dos_format(binary_dos_date, binary_dos_time)
|
726
737
|
rescue ArgumentError
|
data/lib/zip/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rubyzip
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0.0.
|
4
|
+
version: 3.0.0.rc2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Robert Haines
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2025-
|
13
|
+
date: 2025-02-08 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: minitest
|
@@ -195,9 +195,9 @@ licenses:
|
|
195
195
|
- BSD-2-Clause
|
196
196
|
metadata:
|
197
197
|
bug_tracker_uri: https://github.com/rubyzip/rubyzip/issues
|
198
|
-
changelog_uri: https://github.com/rubyzip/rubyzip/blob/v3.0.0.
|
199
|
-
documentation_uri: https://www.rubydoc.info/gems/rubyzip/3.0.0.
|
200
|
-
source_code_uri: https://github.com/rubyzip/rubyzip/tree/v3.0.0.
|
198
|
+
changelog_uri: https://github.com/rubyzip/rubyzip/blob/v3.0.0.rc2/Changelog.md
|
199
|
+
documentation_uri: https://www.rubydoc.info/gems/rubyzip/3.0.0.rc2
|
200
|
+
source_code_uri: https://github.com/rubyzip/rubyzip/tree/v3.0.0.rc2
|
201
201
|
wiki_uri: https://github.com/rubyzip/rubyzip/wiki
|
202
202
|
rubygems_mfa_required: 'true'
|
203
203
|
post_install_message:
|