zip_kit 6.4.2 → 6.4.3
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/.github/workflows/ci.yml +3 -3
- data/.standard.yml +1 -1
- data/CHANGELOG.md +9 -0
- data/CONTRIBUTING.md +6 -2
- data/Rakefile +7 -3
- data/lib/zip_kit/file_reader/inflating_reader.rb +14 -2
- data/lib/zip_kit/file_reader.rb +31 -20
- data/lib/zip_kit/version.rb +1 -1
- data/rbi/zip_kit.rbi +7 -4
- data/rbi/zip_kit.rbs +5 -2
- data/zip_kit.gemspec +1 -3
- metadata +5 -39
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 7ee4b21d33ee9022a884ab164100e19f0a9f6aadf336b5315d6e070e5faf70b9
|
|
4
|
+
data.tar.gz: 13fc19cf3e5d6b75bd47df85a0160574fe006224600c12f99788d674d869182d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: f4600f658370652d8be41b138917698486342d2229b3404b33e7209aab889b6d0fb07cc20169365662ddf226db456e067db835764a771c411c4be6c4419f900a
|
|
7
|
+
data.tar.gz: 22ef76a613ceef41d4be99e780a7a03c477b386c43f9dc380f16b5d031b57ec3e20d9bae881585683b645834826f0b2c367c90bc1cdb26a12fff722b199f1299
|
data/.github/workflows/ci.yml
CHANGED
|
@@ -19,7 +19,7 @@ jobs:
|
|
|
19
19
|
ruby-version: '2.6'
|
|
20
20
|
bundler-cache: true
|
|
21
21
|
- name: "Tests"
|
|
22
|
-
run: bundle exec
|
|
22
|
+
run: bundle exec rake test
|
|
23
23
|
|
|
24
24
|
test_newest_ruby:
|
|
25
25
|
name: "Tests (Ruby 3.4 with frozen string literals)"
|
|
@@ -35,7 +35,7 @@ jobs:
|
|
|
35
35
|
- name: "Tests" # Make the test suite hard-crash on frozen string literal violations
|
|
36
36
|
env:
|
|
37
37
|
RUBYOPT: "--enable=frozen-string-literal --debug=frozen-string-literal"
|
|
38
|
-
run: "bundle exec
|
|
38
|
+
run: "bundle exec rake test"
|
|
39
39
|
|
|
40
40
|
test_ractors:
|
|
41
41
|
name: "Ractor tests (Ruby 4.0)"
|
|
@@ -49,7 +49,7 @@ jobs:
|
|
|
49
49
|
ruby-version: '4.0'
|
|
50
50
|
bundler-cache: true
|
|
51
51
|
- name: "Tests"
|
|
52
|
-
run: "bundle exec
|
|
52
|
+
run: "bundle exec ruby -Itest test/zip_kit/ractor_test.rb"
|
|
53
53
|
|
|
54
54
|
lint_baseline_ruby: # We need to use syntax appropriate for the minimum supported Ruby version
|
|
55
55
|
name: Lint (Ruby 2.6 syntax)
|
data/.standard.yml
CHANGED
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
## Unreleased
|
|
2
2
|
|
|
3
|
+
## 6.4.3
|
|
4
|
+
|
|
5
|
+
* Move the test suite from RSpec to minitest and run it in parallel, in one forked process per CPU core. Run it with `bundle exec rake test` (it was `rake spec`), and see CONTRIBUTING.md for `TEST_WORKERS` and `SEED`. The `rspec`, `rspec-mocks` and `complexity_assert` development dependencies are gone. Nothing changes for users of the library.
|
|
6
|
+
* Make `FileReader.read_zip_structure` check the offset and size of the Zip64 end of central directory record against the position of the Zip64 EOCD locator, and raise `FileReader::InvalidStructure` if the record does not fit in front of it. The 8-byte record size went straight into `IO#read`, and `File#read` allocates the requested length upfront - so a crafted archive made reading it raise `NoMemoryError`, which `rescue => e` does not catch. Over `RemoteIO` it fetched the rest of the object instead. (#41)
|
|
7
|
+
* Raise `FileReader::ReadError` instead of `RangeError` when an offset in the archive is too large to seek to, like a Zip64 local header offset of `2**64 - 1`. (#42)
|
|
8
|
+
* Raise `FileReader::MissingEOCD` when `FileReader.read_zip_structure` is given an empty IO. It raised a `NoMethodError` (`undefined method 'bytesize' for nil`) before, which callers could not rescue as a ZIP error. (#38)
|
|
9
|
+
* Make `FileReader.read_zip_structure` read at most the declared central directory size (plus 64KB of allowance for archives which misreport it), instead of everything from the start of the central directory to the end of the IO. An archive with data stuffed in front of the EOCD made the reader load all of it into one String - over `RemoteIO`, download all of it. A central directory offset past the EOCD now raises `FileReader::InvalidStructure`. (#39)
|
|
10
|
+
* Make the reader returned by `ZipEntry#extractor_from` raise `FileReader::InvalidStructure` once a deflated entry inflates to more than its declared uncompressed size, instead of returning whatever the deflate stream produces. Inflation now happens in 16KB pieces, so a single `extract` call no longer inflates a small chunk of input into many megabytes before returning. (#40)
|
|
11
|
+
|
|
3
12
|
## 6.4.2
|
|
4
13
|
|
|
5
14
|
* Write every ZIP record with a single `Array#pack` and a single `<<` to the destination, instead of one per field. Archives with lots of entries get written about 1.5x faster.
|
data/CONTRIBUTING.md
CHANGED
|
@@ -16,7 +16,7 @@ If you would like to learn more about the technologies zip_kit builds on, check
|
|
|
16
16
|
- [ruby](https://ruby-doc.org)
|
|
17
17
|
- [ZIP files](https://en.wikipedia.org/wiki/Zip_(file_format)) and the [APPNOTE.TXT](https://pkware.cachefly.net/webdocs/casestudies/APPNOTE.TXT) specification
|
|
18
18
|
- [rubyzip](https://github.com/rubyzip/rubyzip), as we like to test "our implementation against theirs"
|
|
19
|
-
- [
|
|
19
|
+
- [minitest](https://github.com/minitest/minitest) for testing
|
|
20
20
|
|
|
21
21
|
## Issues and pull requests
|
|
22
22
|
|
|
@@ -32,10 +32,14 @@ If you would like to learn more about the technologies zip_kit builds on, check
|
|
|
32
32
|
Please adhere to the coding conventions used throughout the project (indentation,
|
|
33
33
|
accurate and terse comments, etc.) and any other requirements (such as test coverage).
|
|
34
34
|
|
|
35
|
-
Run the `rake` default task before submitting. It runs the test suite (`bundle exec
|
|
35
|
+
Run the `rake` default task before submitting. It runs the test suite (`bundle exec rake test`),
|
|
36
36
|
checks formatting with [standard](https://github.com/standardrb/standard) (`bundle exec rake format`
|
|
37
37
|
fixes most of it), and regenerates the type signatures in `rbi/`. Commit the regenerated signatures.
|
|
38
38
|
|
|
39
|
+
The tests run in parallel, in one forked process per CPU core. Set `TEST_WORKERS=1` to run them in a single
|
|
40
|
+
process, and `SEED=1234` to repeat the order of a particular run. A test which measures timings should be
|
|
41
|
+
declared with `parallel: false`, so that it runs after the others are done.
|
|
42
|
+
|
|
39
43
|
zip_kit supports Ruby 2.6 and up, and CI runs the tests and the linter on 2.6. Don't use syntax or
|
|
40
44
|
stdlib features newer than that. CI also runs the suite with frozen string literals enforced, so don't
|
|
41
45
|
mutate string literals.
|
data/Rakefile
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
3
|
require "bundler/gem_tasks"
|
|
4
|
-
require "
|
|
4
|
+
require "rake/testtask"
|
|
5
5
|
require "yard"
|
|
6
6
|
require "standard/rake"
|
|
7
7
|
|
|
@@ -11,7 +11,11 @@ task :format do
|
|
|
11
11
|
end
|
|
12
12
|
|
|
13
13
|
YARD::Rake::YardocTask.new(:doc)
|
|
14
|
-
|
|
14
|
+
Rake::TestTask.new(:test) do |t|
|
|
15
|
+
t.libs << "test"
|
|
16
|
+
t.pattern = "test/**/*_test.rb"
|
|
17
|
+
t.warning = false
|
|
18
|
+
end
|
|
15
19
|
|
|
16
20
|
task :generate_typedefs do
|
|
17
21
|
`bundle exec sord rbi/zip_kit.rbi`
|
|
@@ -26,7 +30,7 @@ task :generate_typedefs do
|
|
|
26
30
|
File.write(rbs_path, rbs)
|
|
27
31
|
end
|
|
28
32
|
|
|
29
|
-
task default: [:
|
|
33
|
+
task default: [:test, :standard, :generate_typedefs]
|
|
30
34
|
|
|
31
35
|
# When building the gem, generate typedefs beforehand,
|
|
32
36
|
# so that they get included
|
|
@@ -2,10 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
# Rubocop: convention: Missing top-level class documentation comment.
|
|
4
4
|
class ZipKit::FileReader::InflatingReader
|
|
5
|
-
def initialize(from_io, compressed_data_size)
|
|
5
|
+
def initialize(from_io, compressed_data_size, uncompressed_data_size)
|
|
6
6
|
@io = from_io
|
|
7
7
|
@compressed_data_size = compressed_data_size
|
|
8
|
+
@uncompressed_data_size = uncompressed_data_size
|
|
8
9
|
@already_read = 0
|
|
10
|
+
@already_inflated = 0
|
|
9
11
|
@zlib_inflater = ::Zlib::Inflate.new(-Zlib::MAX_WBITS)
|
|
10
12
|
end
|
|
11
13
|
|
|
@@ -27,7 +29,17 @@ class ZipKit::FileReader::InflatingReader
|
|
|
27
29
|
return if compressed_chunk.nil?
|
|
28
30
|
|
|
29
31
|
@already_read += compressed_chunk.bytesize
|
|
30
|
-
|
|
32
|
+
|
|
33
|
+
# Inflate in chunks, so that we can stop before inflating much past the declared size
|
|
34
|
+
inflated = "".b
|
|
35
|
+
@zlib_inflater.inflate(compressed_chunk) do |chunk|
|
|
36
|
+
@already_inflated += chunk.bytesize
|
|
37
|
+
if @already_inflated > @uncompressed_data_size
|
|
38
|
+
raise ZipKit::FileReader::InvalidStructure, "The entry inflates to more than its declared uncompressed size of #{@uncompressed_data_size} bytes"
|
|
39
|
+
end
|
|
40
|
+
inflated << chunk
|
|
41
|
+
end
|
|
42
|
+
inflated
|
|
31
43
|
end
|
|
32
44
|
|
|
33
45
|
def eof?
|
data/lib/zip_kit/file_reader.rb
CHANGED
|
@@ -142,7 +142,7 @@ class ZipKit::FileReader
|
|
|
142
142
|
from_io.seek(compressed_data_offset, IO::SEEK_SET)
|
|
143
143
|
case storage_mode
|
|
144
144
|
when 8
|
|
145
|
-
InflatingReader.new(from_io, compressed_size)
|
|
145
|
+
InflatingReader.new(from_io, compressed_size, uncompressed_size)
|
|
146
146
|
when 0
|
|
147
147
|
StoredReader.new(from_io, compressed_size)
|
|
148
148
|
else
|
|
@@ -201,36 +201,33 @@ class ZipKit::FileReader
|
|
|
201
201
|
eocd_offset = get_eocd_offset(io, zip_file_size)
|
|
202
202
|
|
|
203
203
|
zip64_end_of_cdir_location = get_zip64_eocd_location(io, eocd_offset)
|
|
204
|
-
num_files, cdir_location,
|
|
204
|
+
num_files, cdir_location, cdir_size =
|
|
205
205
|
if zip64_end_of_cdir_location
|
|
206
|
-
num_files_and_central_directory_offset_zip64(io, zip64_end_of_cdir_location)
|
|
206
|
+
num_files_and_central_directory_offset_zip64(io, zip64_end_of_cdir_location, eocd_offset)
|
|
207
207
|
else
|
|
208
208
|
num_files_and_central_directory_offset(io, eocd_offset)
|
|
209
209
|
end
|
|
210
210
|
|
|
211
|
+
# The central directory has to end before the Zip64 EOCD record, or before the EOCD if there is none
|
|
212
|
+
cdir_end = zip64_end_of_cdir_location || eocd_offset
|
|
213
|
+
if cdir_location > cdir_end
|
|
214
|
+
raise InvalidStructure, "The central directory offset #{cdir_location} is past the end of the central directory at #{cdir_end}"
|
|
215
|
+
end
|
|
216
|
+
|
|
211
217
|
log do
|
|
212
218
|
"Located the central directory start at %<location>d" %
|
|
213
219
|
{location: cdir_location}
|
|
214
220
|
end
|
|
215
221
|
seek(io, cdir_location)
|
|
216
222
|
|
|
217
|
-
#
|
|
218
|
-
#
|
|
219
|
-
#
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
# warning [ktsglobal-2b03bc.zip]: 1 extra byte at beginning or within zipfile
|
|
223
|
-
# (attempting to process anyway)
|
|
224
|
-
# error [ktsglobal-2b03bc.zip]: reported length of central directory is
|
|
225
|
-
# -1 bytes too long (Atari STZip zipfile? J.H.Holm ZIPSPLIT 1.1
|
|
226
|
-
# zipfile?). Compensating...
|
|
227
|
-
#
|
|
228
|
-
# Since the EOCD is not that big anyway, we just read the entire "tail" of the ZIP ignoring
|
|
229
|
-
# the central directory size alltogether.
|
|
230
|
-
central_directory_str = io.read # and not read_n(io, cdir_size), see above
|
|
223
|
+
# Some archives misreport the central directory size (`zipinfo` says "reported length of central
|
|
224
|
+
# directory is -1 bytes too long"), so allow for an error. But do not read all the way up to the
|
|
225
|
+
# EOCD: an archive can have any amount of data stuffed between the central directory and the EOCD.
|
|
226
|
+
read_size = [cdir_size + MAX_CENTRAL_DIRECTORY_SIZE_ERROR, cdir_end - cdir_location].min
|
|
227
|
+
central_directory_str = read_n(io, read_size)
|
|
231
228
|
central_directory_io = StringIO.new(central_directory_str)
|
|
232
229
|
log do
|
|
233
|
-
"Read %<byte_size>d bytes with central directory
|
|
230
|
+
"Read %<byte_size>d bytes with the central directory" %
|
|
234
231
|
{byte_size: central_directory_str.bytesize}
|
|
235
232
|
end
|
|
236
233
|
|
|
@@ -440,6 +437,8 @@ class ZipKit::FileReader
|
|
|
440
437
|
got to #{io.tell}"
|
|
441
438
|
end
|
|
442
439
|
nil
|
|
440
|
+
rescue RangeError # The offset does not fit into an int64
|
|
441
|
+
raise ReadError, "Cannot seek to #{absolute_pos}"
|
|
443
442
|
end
|
|
444
443
|
|
|
445
444
|
def assert_signature(io, signature_magic_number)
|
|
@@ -570,6 +569,7 @@ class ZipKit::FileReader
|
|
|
570
569
|
# and a soft read (we might not be able to read as many bytes as we want)
|
|
571
570
|
file_io.seek(implied_position_of_eocd_record, IO::SEEK_SET)
|
|
572
571
|
str_containing_eocd_record = file_io.read(MAX_END_OF_CENTRAL_DIRECTORY_RECORD_SIZE)
|
|
572
|
+
raise MissingEOCD if str_containing_eocd_record.nil? # Empty IO
|
|
573
573
|
eocd_idx_in_buf = locate_eocd_signature(str_containing_eocd_record)
|
|
574
574
|
|
|
575
575
|
raise MissingEOCD unless eocd_idx_in_buf
|
|
@@ -655,12 +655,20 @@ class ZipKit::FileReader
|
|
|
655
655
|
end
|
|
656
656
|
|
|
657
657
|
# num_files_and_central_directory_offset_zip64 is too high. [21.12/15]
|
|
658
|
-
def num_files_and_central_directory_offset_zip64(io, zip64_end_of_cdir_location)
|
|
658
|
+
def num_files_and_central_directory_offset_zip64(io, zip64_end_of_cdir_location, eocd_offset)
|
|
659
|
+
# The record has to end before the Zip64 EOCD locator, which is 20 bytes long and sits right before the EOCD
|
|
660
|
+
zip64_eocd_locator_offset = eocd_offset - 20
|
|
661
|
+
if zip64_end_of_cdir_location > zip64_eocd_locator_offset
|
|
662
|
+
raise InvalidStructure, "The Zip64 EOCD record offset #{zip64_end_of_cdir_location} is past the Zip64 EOCD locator"
|
|
663
|
+
end
|
|
659
664
|
seek(io, zip64_end_of_cdir_location)
|
|
660
665
|
|
|
661
666
|
assert_signature(io, 0x06064b50)
|
|
662
667
|
|
|
663
668
|
zip64_eocdr_size = read_8b(io)
|
|
669
|
+
if zip64_eocdr_size > zip64_eocd_locator_offset - io.tell
|
|
670
|
+
raise InvalidStructure, "The Zip64 EOCD record size #{zip64_eocdr_size} does not fit in front of the Zip64 EOCD locator"
|
|
671
|
+
end
|
|
664
672
|
zip64_eocdr = read_n(io, zip64_eocdr_size) # Reading in bulk is cheaper
|
|
665
673
|
zip64_eocdr = StringIO.new(zip64_eocdr)
|
|
666
674
|
skip_ahead_2(zip64_eocdr) # version made by
|
|
@@ -713,6 +721,9 @@ class ZipKit::FileReader
|
|
|
713
721
|
2 + # The comment size
|
|
714
722
|
0xFFFF # Maximum comment size
|
|
715
723
|
|
|
724
|
+
# How many bytes more than the declared central directory size we are willing to read
|
|
725
|
+
MAX_CENTRAL_DIRECTORY_SIZE_ERROR = 0xFFFF
|
|
726
|
+
|
|
716
727
|
# How much to read upfront for a local file header. Filenames and extra fields rarely
|
|
717
728
|
# take more than a few hundred bytes, the rest gets read separately if needed
|
|
718
729
|
LOCAL_HEADER_READ_SIZE = 4 * 1024
|
|
@@ -745,7 +756,7 @@ class ZipKit::FileReader
|
|
|
745
756
|
private_constant :C_UINT4, :C_UINT2, :C_UINT8, :MAX_END_OF_CENTRAL_DIRECTORY_RECORD_SIZE,
|
|
746
757
|
:LOCAL_HEADER_FIXED_FIELDS_UNPACKSPEC, :SIZE_OF_LOCAL_HEADER_FIXED_FIELDS,
|
|
747
758
|
:CDIR_ENTRY_FIXED_FIELDS_UNPACKSPEC, :SIZE_OF_CDIR_ENTRY_FIXED_FIELDS,
|
|
748
|
-
:LOCAL_HEADER_READ_SIZE, :SIZE_OF_USABLE_EOCD_RECORD
|
|
759
|
+
:LOCAL_HEADER_READ_SIZE, :SIZE_OF_USABLE_EOCD_RECORD, :MAX_CENTRAL_DIRECTORY_SIZE_ERROR
|
|
749
760
|
|
|
750
761
|
# Is provided as a stub to be overridden in a subclass if you need it. Will report
|
|
751
762
|
# during various stages of reading. The log message is contained in the return value
|
data/lib/zip_kit/version.rb
CHANGED
data/rbi/zip_kit.rbi
CHANGED
|
@@ -1389,6 +1389,7 @@ end, T.untyped)
|
|
|
1389
1389
|
2 + # Number of files in the cdir of this disk
|
|
1390
1390
|
2 + # The comment size
|
|
1391
1391
|
0xFFFF, T.untyped)
|
|
1392
|
+
MAX_CENTRAL_DIRECTORY_SIZE_ERROR = T.let(0xFFFF, T.untyped)
|
|
1392
1393
|
LOCAL_HEADER_READ_SIZE = T.let(4 * 1024, T.untyped)
|
|
1393
1394
|
SIZE_OF_USABLE_EOCD_RECORD = T.let(4 + # Signature
|
|
1394
1395
|
2 + # Number of this disk
|
|
@@ -1596,10 +1597,11 @@ end, T.untyped)
|
|
|
1596
1597
|
|
|
1597
1598
|
# sord omit - no YARD type given for "io", using untyped
|
|
1598
1599
|
# sord omit - no YARD type given for "zip64_end_of_cdir_location", using untyped
|
|
1600
|
+
# sord omit - no YARD type given for "eocd_offset", using untyped
|
|
1599
1601
|
# sord omit - no YARD return type given, using untyped
|
|
1600
1602
|
# num_files_and_central_directory_offset_zip64 is too high. [21.12/15]
|
|
1601
|
-
sig { params(io: T.untyped, zip64_end_of_cdir_location: T.untyped).returns(T.untyped) }
|
|
1602
|
-
def num_files_and_central_directory_offset_zip64(io, zip64_end_of_cdir_location); end
|
|
1603
|
+
sig { params(io: T.untyped, zip64_end_of_cdir_location: T.untyped, eocd_offset: T.untyped).returns(T.untyped) }
|
|
1604
|
+
def num_files_and_central_directory_offset_zip64(io, zip64_end_of_cdir_location, eocd_offset); end
|
|
1603
1605
|
|
|
1604
1606
|
# sord omit - no YARD type given for "file_io", using untyped
|
|
1605
1607
|
# sord omit - no YARD type given for "eocd_offset", using untyped
|
|
@@ -1640,8 +1642,9 @@ end, T.untyped)
|
|
|
1640
1642
|
class InflatingReader
|
|
1641
1643
|
# sord omit - no YARD type given for "from_io", using untyped
|
|
1642
1644
|
# sord omit - no YARD type given for "compressed_data_size", using untyped
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
+
# sord omit - no YARD type given for "uncompressed_data_size", using untyped
|
|
1646
|
+
sig { params(from_io: T.untyped, compressed_data_size: T.untyped, uncompressed_data_size: T.untyped).void }
|
|
1647
|
+
def initialize(from_io, compressed_data_size, uncompressed_data_size); end
|
|
1645
1648
|
|
|
1646
1649
|
# sord omit - no YARD type given for "n_bytes", using untyped
|
|
1647
1650
|
# sord omit - no YARD return type given, using untyped
|
data/rbi/zip_kit.rbs
CHANGED
|
@@ -1216,6 +1216,7 @@ module ZipKit
|
|
|
1216
1216
|
CDIR_ENTRY_FIXED_FIELDS_UNPACKSPEC: untyped
|
|
1217
1217
|
SIZE_OF_CDIR_ENTRY_FIXED_FIELDS: untyped
|
|
1218
1218
|
MAX_END_OF_CENTRAL_DIRECTORY_RECORD_SIZE: untyped
|
|
1219
|
+
MAX_CENTRAL_DIRECTORY_SIZE_ERROR: untyped
|
|
1219
1220
|
LOCAL_HEADER_READ_SIZE: untyped
|
|
1220
1221
|
SIZE_OF_USABLE_EOCD_RECORD: untyped
|
|
1221
1222
|
|
|
@@ -1394,9 +1395,10 @@ module ZipKit
|
|
|
1394
1395
|
|
|
1395
1396
|
# sord omit - no YARD type given for "io", using untyped
|
|
1396
1397
|
# sord omit - no YARD type given for "zip64_end_of_cdir_location", using untyped
|
|
1398
|
+
# sord omit - no YARD type given for "eocd_offset", using untyped
|
|
1397
1399
|
# sord omit - no YARD return type given, using untyped
|
|
1398
1400
|
# num_files_and_central_directory_offset_zip64 is too high. [21.12/15]
|
|
1399
|
-
def num_files_and_central_directory_offset_zip64: (untyped io, untyped zip64_end_of_cdir_location) -> untyped
|
|
1401
|
+
def num_files_and_central_directory_offset_zip64: (untyped io, untyped zip64_end_of_cdir_location, untyped eocd_offset) -> untyped
|
|
1400
1402
|
|
|
1401
1403
|
# sord omit - no YARD type given for "file_io", using untyped
|
|
1402
1404
|
# sord omit - no YARD type given for "eocd_offset", using untyped
|
|
@@ -1431,7 +1433,8 @@ module ZipKit
|
|
|
1431
1433
|
class InflatingReader
|
|
1432
1434
|
# sord omit - no YARD type given for "from_io", using untyped
|
|
1433
1435
|
# sord omit - no YARD type given for "compressed_data_size", using untyped
|
|
1434
|
-
|
|
1436
|
+
# sord omit - no YARD type given for "uncompressed_data_size", using untyped
|
|
1437
|
+
def initialize: (untyped from_io, untyped compressed_data_size, untyped uncompressed_data_size) -> void
|
|
1435
1438
|
|
|
1436
1439
|
# sord omit - no YARD type given for "n_bytes", using untyped
|
|
1437
1440
|
# sord omit - no YARD return type given, using untyped
|
data/zip_kit.gemspec
CHANGED
|
@@ -36,9 +36,7 @@ Gem::Specification.new do |spec|
|
|
|
36
36
|
spec.add_development_dependency "rubyzip", "~> 2" # We test our output with _another_ ZIP library, which is the way to go here
|
|
37
37
|
spec.add_development_dependency "rack" # For tests where we spin up a server. Both for streaming out and for testing reads over HTTP
|
|
38
38
|
spec.add_development_dependency "rake", "~> 12.2"
|
|
39
|
-
spec.add_development_dependency "
|
|
40
|
-
spec.add_development_dependency "rspec-mocks", "~> 3.10", ">= 3.10.2" # ruby 3 compatibility
|
|
41
|
-
spec.add_development_dependency "complexity_assert"
|
|
39
|
+
spec.add_development_dependency "minitest", "~> 5" # 5.x still bundles minitest/mock and runs on Ruby 2.6
|
|
42
40
|
spec.add_development_dependency "benchmark-ips"
|
|
43
41
|
spec.add_development_dependency "allocation_stats", "~> 0.1.5"
|
|
44
42
|
spec.add_development_dependency "yard", "~> 0.9"
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: zip_kit
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 6.4.
|
|
4
|
+
version: 6.4.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Julik Tarkhanov
|
|
@@ -11,7 +11,7 @@ authors:
|
|
|
11
11
|
- Felix Bünemann
|
|
12
12
|
bindir: exe
|
|
13
13
|
cert_chain: []
|
|
14
|
-
date: 2026-11-
|
|
14
|
+
date: 2026-11-16 00:00:00.000000000 Z
|
|
15
15
|
dependencies:
|
|
16
16
|
- !ruby/object:Gem::Dependency
|
|
17
17
|
name: bundler
|
|
@@ -70,53 +70,19 @@ dependencies:
|
|
|
70
70
|
- !ruby/object:Gem::Version
|
|
71
71
|
version: '12.2'
|
|
72
72
|
- !ruby/object:Gem::Dependency
|
|
73
|
-
name:
|
|
73
|
+
name: minitest
|
|
74
74
|
requirement: !ruby/object:Gem::Requirement
|
|
75
75
|
requirements:
|
|
76
76
|
- - "~>"
|
|
77
77
|
- !ruby/object:Gem::Version
|
|
78
|
-
version: '
|
|
79
|
-
type: :development
|
|
80
|
-
prerelease: false
|
|
81
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
82
|
-
requirements:
|
|
83
|
-
- - "~>"
|
|
84
|
-
- !ruby/object:Gem::Version
|
|
85
|
-
version: '3'
|
|
86
|
-
- !ruby/object:Gem::Dependency
|
|
87
|
-
name: rspec-mocks
|
|
88
|
-
requirement: !ruby/object:Gem::Requirement
|
|
89
|
-
requirements:
|
|
90
|
-
- - "~>"
|
|
91
|
-
- !ruby/object:Gem::Version
|
|
92
|
-
version: '3.10'
|
|
93
|
-
- - ">="
|
|
94
|
-
- !ruby/object:Gem::Version
|
|
95
|
-
version: 3.10.2
|
|
78
|
+
version: '5'
|
|
96
79
|
type: :development
|
|
97
80
|
prerelease: false
|
|
98
81
|
version_requirements: !ruby/object:Gem::Requirement
|
|
99
82
|
requirements:
|
|
100
83
|
- - "~>"
|
|
101
84
|
- !ruby/object:Gem::Version
|
|
102
|
-
version: '
|
|
103
|
-
- - ">="
|
|
104
|
-
- !ruby/object:Gem::Version
|
|
105
|
-
version: 3.10.2
|
|
106
|
-
- !ruby/object:Gem::Dependency
|
|
107
|
-
name: complexity_assert
|
|
108
|
-
requirement: !ruby/object:Gem::Requirement
|
|
109
|
-
requirements:
|
|
110
|
-
- - ">="
|
|
111
|
-
- !ruby/object:Gem::Version
|
|
112
|
-
version: '0'
|
|
113
|
-
type: :development
|
|
114
|
-
prerelease: false
|
|
115
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
116
|
-
requirements:
|
|
117
|
-
- - ">="
|
|
118
|
-
- !ruby/object:Gem::Version
|
|
119
|
-
version: '0'
|
|
85
|
+
version: '5'
|
|
120
86
|
- !ruby/object:Gem::Dependency
|
|
121
87
|
name: benchmark-ips
|
|
122
88
|
requirement: !ruby/object:Gem::Requirement
|