diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 20d3d24..267d32e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,7 +14,7 @@ jobs: matrix: ruby: - '2.6' - - '3.2' + - '3.3' steps: - name: Checkout uses: actions/checkout@v4 diff --git a/lib/zip_kit/block_deflate.rb b/lib/zip_kit/block_deflate.rb index 1511212..a55b406 100644 --- a/lib/zip_kit/block_deflate.rb +++ b/lib/zip_kit/block_deflate.rb @@ -55,7 +55,7 @@ class ZipKit::BlockDeflate # `output_io` can also be a {ZipKit::Streamer} to expedite ops. # # @param output_io [IO] the stream to write to (should respond to `:<<`) - # @return [Fixnum] number of bytes written to `output_io` + # @return [Integer] number of bytes written to `output_io` def self.write_terminator(output_io) output_io << END_MARKER END_MARKER.bytesize @@ -65,7 +65,7 @@ def self.write_terminator(output_io) # The returned string can be spliced into another deflate stream. # # @param bytes [String] Bytes to compress - # @param level [Fixnum] Zlib compression level (defaults to `Zlib::DEFAULT_COMPRESSION`) + # @param level [Integer] Zlib compression level (defaults to `Zlib::DEFAULT_COMPRESSION`) # @return [String] compressed bytes def self.deflate_chunk(bytes, level: Zlib::DEFAULT_COMPRESSION) raise "Invalid Zlib compression level #{level}" unless VALID_COMPRESSIONS.include?(level) @@ -90,9 +90,9 @@ def self.deflate_chunk(bytes, level: Zlib::DEFAULT_COMPRESSION) # # @param input_io [IO] the stream to read from (should respond to `:read`) # @param output_io [IO] the stream to write to (should respond to `:<<`) - # @param level [Fixnum] Zlib compression level (defaults to `Zlib::DEFAULT_COMPRESSION`) - # @param block_size [Fixnum] The block size to use (defaults to `DEFAULT_BLOCKSIZE`) - # @return [Fixnum] number of bytes written to `output_io` + # @param level [Integer] Zlib compression level (defaults to `Zlib::DEFAULT_COMPRESSION`) + # @param block_size [Integer] The block size to use (defaults to `DEFAULT_BLOCKSIZE`) + # @return [Integer] number of bytes written to `output_io` def self.deflate_in_blocks_and_terminate(input_io, output_io, level: Zlib::DEFAULT_COMPRESSION, @@ -110,9 +110,9 @@ def self.deflate_in_blocks_and_terminate(input_io, # # @param input_io [IO] the stream to read from (should respond to `:read`) # @param output_io [IO] the stream to write to (should respond to `:<<`) - # @param level [Fixnum] Zlib compression level (defaults to `Zlib::DEFAULT_COMPRESSION`) - # @param block_size [Fixnum] The block size to use (defaults to `DEFAULT_BLOCKSIZE`) - # @return [Fixnum] number of bytes written to `output_io` + # @param level [Integer] Zlib compression level (defaults to `Zlib::DEFAULT_COMPRESSION`) + # @param block_size [Integer] The block size to use (defaults to `DEFAULT_BLOCKSIZE`) + # @return [Integer] number of bytes written to `output_io` def self.deflate_in_blocks(input_io, output_io, level: Zlib::DEFAULT_COMPRESSION, diff --git a/lib/zip_kit/file_reader.rb b/lib/zip_kit/file_reader.rb index 2e8952b..f89d23f 100644 --- a/lib/zip_kit/file_reader.rb +++ b/lib/zip_kit/file_reader.rb @@ -86,46 +86,46 @@ def message # the Entry object used in Streamer for ZIP writing, since during writing more # data can be kept in memory for immediate use. class ZipEntry - # @return [Fixnum] bit-packed version signature of the program that made the archive + # @return [Integer] bit-packed version signature of the program that made the archive attr_accessor :made_by - # @return [Fixnum] ZIP version support needed to extract this file + # @return [Integer] ZIP version support needed to extract this file attr_accessor :version_needed_to_extract - # @return [Fixnum] bit-packed general purpose flags + # @return [Integer] bit-packed general purpose flags attr_accessor :gp_flags - # @return [Fixnum] Storage mode (0 for stored, 8 for deflate) + # @return [Integer] Storage mode (0 for stored, 8 for deflate) attr_accessor :storage_mode - # @return [Fixnum] the bit-packed DOS time + # @return [Integer] the bit-packed DOS time attr_accessor :dos_time - # @return [Fixnum] the bit-packed DOS date + # @return [Integer] the bit-packed DOS date attr_accessor :dos_date - # @return [Fixnum] the CRC32 checksum of this file + # @return [Integer] the CRC32 checksum of this file attr_accessor :crc32 - # @return [Fixnum] size of compressed file data in the ZIP + # @return [Integer] size of compressed file data in the ZIP attr_accessor :compressed_size - # @return [Fixnum] size of the file once uncompressed + # @return [Integer] size of the file once uncompressed attr_accessor :uncompressed_size # @return [String] the filename attr_accessor :filename - # @return [Fixnum] disk number where this file starts + # @return [Integer] disk number where this file starts attr_accessor :disk_number_start - # @return [Fixnum] internal attributes of the file + # @return [Integer] internal attributes of the file attr_accessor :internal_attrs - # @return [Fixnum] external attributes of the file + # @return [Integer] external attributes of the file attr_accessor :external_attrs - # @return [Fixnum] at what offset the local file header starts + # @return [Integer] at what offset the local file header starts # in your original IO object attr_accessor :local_file_header_offset @@ -151,7 +151,7 @@ def extractor_from(from_io) end end - # @return [Fixnum] at what offset you should start reading + # @return [Integer] at what offset you should start reading # for the compressed data in your original IO object def compressed_data_offset @compressed_data_offset || raise(LocalHeaderPending) @@ -298,7 +298,7 @@ def read_zip_straight_ahead(io:) # this offset to get the data). # # @param io[#read] an IO-ish object the ZIP file can be read from - # @return [Array] the parsed local header entry and + # @return [Array] the parsed local header entry and # the compressed data offset def read_local_file_header(io:) local_file_header_offset = io.tell @@ -365,8 +365,8 @@ def read_local_file_header(io:) # (read starting at this offset to get the data). # # @param io[#seek, #read] an IO-ish object the ZIP file can be read from - # @param local_file_header_offset[Fixnum] absolute offset (0-based) where the - # local file header is supposed to begin @return [Fixnum] absolute offset + # @param local_file_header_offset[Integer] absolute offset (0-based) where the + # local file header is supposed to begin @return [Integer] absolute offset # (0-based) of where the compressed data begins for this file within the ZIP def get_compressed_data_offset(io:, local_file_header_offset:) seek(io, local_file_header_offset) diff --git a/lib/zip_kit/remote_io.rb b/lib/zip_kit/remote_io.rb index af71e3f..538c91a 100644 --- a/lib/zip_kit/remote_io.rb +++ b/lib/zip_kit/remote_io.rb @@ -40,7 +40,7 @@ def size # so if you are at offset 0 in the IO of size 10, doing a `read(20)` # will only return you 10 bytes of result, and not raise any exceptions. # - # @param n_bytes[Fixnum, nil] how many bytes to read, or `nil` to read all the way to the end + # @param n_bytes[Integer, nil] how many bytes to read, or `nil` to read all the way to the end # @return [String] the read bytes def read(n_bytes = nil) # If the resource is empty there is nothing to read @@ -62,7 +62,7 @@ def read(n_bytes = nil) # Returns the current pointer position within the IO # - # @return [Fixnum] + # @return [Integer] def tell @pos end diff --git a/lib/zip_kit/size_estimator.rb b/lib/zip_kit/size_estimator.rb index dc2cd6d..b687c6e 100644 --- a/lib/zip_kit/size_estimator.rb +++ b/lib/zip_kit/size_estimator.rb @@ -35,7 +35,7 @@ def self.estimate(**kwargs_for_streamer_new) # Add a fake entry to the archive, to see how big it is going to be in the end. # # @param filename [String] the name of the file (filenames are variable-width in the ZIP) - # @param size [Fixnum] size of the uncompressed entry + # @param size [Integer] size of the uncompressed entry # @param use_data_descriptor[Boolean] whether the entry uses a postfix # data descriptor to specify size # @return self @@ -54,8 +54,8 @@ def add_stored_entry(filename:, size:, use_data_descriptor: false) # Add a fake entry to the archive, to see how big it is going to be in the end. # # @param filename [String] the name of the file (filenames are variable-width in the ZIP) - # @param uncompressed_size [Fixnum] size of the uncompressed entry - # @param compressed_size [Fixnum] size of the compressed entry + # @param uncompressed_size [Integer] size of the uncompressed entry + # @param compressed_size [Integer] size of the compressed entry # @param use_data_descriptor[Boolean] whether the entry uses a postfix data # descriptor to specify size # @return self diff --git a/lib/zip_kit/stream_crc32.rb b/lib/zip_kit/stream_crc32.rb index 1dbda4a..8b3e863 100644 --- a/lib/zip_kit/stream_crc32.rb +++ b/lib/zip_kit/stream_crc32.rb @@ -16,7 +16,7 @@ class ZipKit::StreamCRC32 # Compute a CRC32 value from an IO object. The object should respond to `read` and `eof?` # # @param io[IO] the IO to read the data from - # @return [Fixnum] the computed CRC32 value + # @return [Integer] the computed CRC32 value def self.from_io(io) # If we can specify the string capacity upfront we will not have to resize # the string during operation. This saves time but is only available on @@ -43,7 +43,7 @@ def <<(blob) # Returns the CRC32 value computed so far # - # @return [Fixnum] the updated CRC32 value for all the blobs so far + # @return [Integer] the updated CRC32 value for all the blobs so far def to_i @crc end @@ -51,9 +51,9 @@ def to_i # Appends a known CRC32 value to the current one, and combines the # contained CRC32 value in-place. # - # @param crc32[Fixnum] the CRC32 value to append - # @param blob_size[Fixnum] the size of the daata the `crc32` is computed from - # @return [Fixnum] the updated CRC32 value for all the blobs so far + # @param crc32[Integer] the CRC32 value to append + # @param blob_size[Integer] the size of the daata the `crc32` is computed from + # @return [Integer] the updated CRC32 value for all the blobs so far def append(crc32, blob_size) @crc = Zlib.crc32_combine(@crc, crc32, blob_size) end diff --git a/lib/zip_kit/write_shovel.rb b/lib/zip_kit/write_shovel.rb index a5155b5..c59bd37 100644 --- a/lib/zip_kit/write_shovel.rb +++ b/lib/zip_kit/write_shovel.rb @@ -14,7 +14,7 @@ module ZipKit::WriteShovel # a target for `IO.copy_stream(from, to)` # # @param bytes[String] the binary string to write (part of the uncompressed file) - # @return [Fixnum] the number of bytes written (will always be the bytesize of `bytes`) + # @return [Integer] the number of bytes written (will always be the bytesize of `bytes`) def write(bytes) self << bytes bytes.bytesize diff --git a/lib/zip_kit/zip_writer.rb b/lib/zip_kit/zip_writer.rb index 99582ac..fa8cc84 100644 --- a/lib/zip_kit/zip_writer.rb +++ b/lib/zip_kit/zip_writer.rb @@ -64,12 +64,12 @@ class ZipKit::ZipWriter # # @param io[#<<] the buffer to write the local file header to # @param filename[String] the name of the file in the archive - # @param compressed_size[Fixnum] The size of the compressed (or stored) data - how much space it uses in the ZIP - # @param uncompressed_size[Fixnum] The size of the file once extracted - # @param crc32[Fixnum] The CRC32 checksum of the file + # @param compressed_size[Integer] The size of the compressed (or stored) data - how much space it uses in the ZIP + # @param uncompressed_size[Integer] The size of the file once extracted + # @param crc32[Integer] The CRC32 checksum of the file # @param mtime[Time] the modification time to be recorded in the ZIP - # @param gp_flags[Fixnum] bit-packed general purpose flags - # @param storage_mode[Fixnum] 8 for deflated, 0 for stored... + # @param gp_flags[Integer] bit-packed general purpose flags + # @param storage_mode[Integer] 8 for deflated, 0 for stored... # @return [void] def write_local_file_header(io:, filename:, compressed_size:, uncompressed_size:, crc32:, gp_flags:, mtime:, storage_mode:) requires_zip64 = compressed_size > FOUR_BYTE_MAX_UINT || uncompressed_size > FOUR_BYTE_MAX_UINT @@ -136,11 +136,11 @@ def write_local_file_header(io:, filename:, compressed_size:, uncompressed_size: # # @param io[#<<] the buffer to write the local file header to # @param filename[String] the name of the file in the archive - # @param compressed_size[Fixnum] The size of the compressed (or stored) data - how much space it uses in the ZIP - # @param uncompressed_size[Fixnum] The size of the file once extracted - # @param crc32[Fixnum] The CRC32 checksum of the file + # @param compressed_size[Integer] The size of the compressed (or stored) data - how much space it uses in the ZIP + # @param uncompressed_size[Integer] The size of the file once extracted + # @param crc32[Integer] The CRC32 checksum of the file # @param mtime[Time] the modification time to be recorded in the ZIP - # @param gp_flags[Fixnum] bit-packed general purpose flags + # @param gp_flags[Integer] bit-packed general purpose flags # @param unix_permissions[Integer] the permissions for the file, or nil for the default to be used # @return [void] def write_central_directory_file_header(io:, @@ -253,9 +253,9 @@ def write_central_directory_file_header(io:, # the data descriptor will have the sizes written out as 8-byte values instead of 4-byte values. # # @param io[#<<] the buffer to write the local file header to - # @param crc32[Fixnum] The CRC32 checksum of the file - # @param compressed_size[Fixnum] The size of the compressed (or stored) data - how much space it uses in the ZIP - # @param uncompressed_size[Fixnum] The size of the file once extracted + # @param crc32[Integer] The CRC32 checksum of the file + # @param compressed_size[Integer] The size of the compressed (or stored) data - how much space it uses in the ZIP + # @param uncompressed_size[Integer] The size of the file once extracted # @return [void] def write_data_descriptor(io:, compressed_size:, uncompressed_size:, crc32:) # Although not originally assigned a signature, the value @@ -282,9 +282,9 @@ def write_data_descriptor(io:, compressed_size:, uncompressed_size:, crc32:) # Writes the "end of central directory record" (including the Zip6 salient bits if necessary) # # @param io[#<<] the buffer to write the central directory to. - # @param start_of_central_directory_location[Fixnum] byte offset of the start of central directory form the beginning of ZIP file - # @param central_directory_size[Fixnum] the size of the central directory (only file headers) in bytes - # @param num_files_in_archive[Fixnum] How many files the archive contains + # @param start_of_central_directory_location[Integer] byte offset of the start of central directory form the beginning of ZIP file + # @param central_directory_size[Integer] the size of the central directory (only file headers) in bytes + # @param num_files_in_archive[Integer] How many files the archive contains # @param comment[String] the comment for the archive (defaults to ZIP_KIT_COMMENT) # @return [void] def write_end_of_central_directory(io:, start_of_central_directory_location:, central_directory_size:, num_files_in_archive:, comment: ZIP_KIT_COMMENT) @@ -386,8 +386,8 @@ def write_end_of_central_directory(io:, start_of_central_directory_location:, ce # Writes the Zip64 extra field for the local file header. Will be used by `write_local_file_header` when any sizes given to it warrant that. # - # @param compressed_size[Fixnum] The size of the compressed (or stored) data - how much space it uses in the ZIP - # @param uncompressed_size[Fixnum] The size of the file once extracted + # @param compressed_size[Integer] The size of the compressed (or stored) data - how much space it uses in the ZIP + # @param uncompressed_size[Integer] The size of the file once extracted # @return [String] def zip_64_extra_for_local_file_header(compressed_size:, uncompressed_size:) data_and_packspecs = [ @@ -460,9 +460,9 @@ def timestamp_extra_for_local_file_header(mtime) # Writes the Zip64 extra field for the central directory header.It differs from the extra used in the local file header because it # also contains the location of the local file header in the ZIP as an 8-byte int. # - # @param compressed_size[Fixnum] The size of the compressed (or stored) data - how much space it uses in the ZIP - # @param uncompressed_size[Fixnum] The size of the file once extracted - # @param local_file_header_location[Fixnum] Byte offset of the start of the local file header from the beginning of the ZIP archive + # @param compressed_size[Integer] The size of the compressed (or stored) data - how much space it uses in the ZIP + # @param uncompressed_size[Integer] The size of the file once extracted + # @param local_file_header_location[Integer] Byte offset of the start of the local file header from the beginning of the ZIP archive # @return [String] def zip_64_extra_for_central_directory_file_header(compressed_size:, uncompressed_size:, local_file_header_location:) data_and_packspecs = [ diff --git a/rbi/zip_kit.rbi b/rbi/zip_kit.rbi index a9ab119..5daa164 100644 --- a/rbi/zip_kit.rbi +++ b/rbi/zip_kit.rbi @@ -572,7 +572,7 @@ module ZipKit # _@param_ `bytes` — the binary string to write (part of the uncompressed file) # # _@return_ — the number of bytes written (will always be the bytesize of `bytes`) - sig { params(bytes: String).returns(Fixnum) } + sig { params(bytes: String).returns(Integer) } def write(bytes); end # Is used internally by Streamer to keep track of entries in the archive during writing. @@ -686,7 +686,7 @@ module ZipKit # _@param_ `bytes` — the binary string to write (part of the uncompressed file) # # _@return_ — the number of bytes written (will always be the bytesize of `bytes`) - sig { params(bytes: String).returns(Fixnum) } + sig { params(bytes: String).returns(Integer) } def write(bytes); end end @@ -755,7 +755,7 @@ module ZipKit # _@param_ `bytes` — the binary string to write (part of the uncompressed file) # # _@return_ — the number of bytes written (will always be the bytesize of `bytes`) - sig { params(bytes: String).returns(Fixnum) } + sig { params(bytes: String).returns(Integer) } def write(bytes); end end @@ -793,7 +793,7 @@ module ZipKit # _@param_ `bytes` — the binary string to write (part of the uncompressed file) # # _@return_ — the number of bytes written (will always be the bytesize of `bytes`) - sig { params(bytes: String).returns(Fixnum) } + sig { params(bytes: String).returns(Integer) } def write(bytes); end end end @@ -835,11 +835,11 @@ module ZipKit # _@param_ `n_bytes` — how many bytes to read, or `nil` to read all the way to the end # # _@return_ — the read bytes - sig { params(n_bytes: T.nilable(Fixnum)).returns(String) } + sig { params(n_bytes: T.nilable(Integer)).returns(String) } def read(n_bytes = nil); end # Returns the current pointer position within the IO - sig { returns(Fixnum) } + sig { returns(Integer) } def tell; end # Only used internally when reading the remote ZIP. @@ -933,12 +933,12 @@ end, T.untyped) params( io: T.untyped, filename: String, - compressed_size: Fixnum, - uncompressed_size: Fixnum, - crc32: Fixnum, - gp_flags: Fixnum, + compressed_size: Integer, + uncompressed_size: Integer, + crc32: Integer, + gp_flags: Integer, mtime: Time, - storage_mode: Fixnum + storage_mode: Integer ).void end def write_local_file_header(io:, filename:, compressed_size:, uncompressed_size:, crc32:, gp_flags:, mtime:, storage_mode:); end @@ -968,12 +968,12 @@ end, T.untyped) params( io: T.untyped, local_file_header_location: T.untyped, - gp_flags: Fixnum, + gp_flags: Integer, storage_mode: T.untyped, - compressed_size: Fixnum, - uncompressed_size: Fixnum, + compressed_size: Integer, + uncompressed_size: Integer, mtime: Time, - crc32: Fixnum, + crc32: Integer, filename: String, unix_permissions: T.nilable(Integer) ).void @@ -995,9 +995,9 @@ end, T.untyped) sig do params( io: T.untyped, - compressed_size: Fixnum, - uncompressed_size: Fixnum, - crc32: Fixnum + compressed_size: Integer, + uncompressed_size: Integer, + crc32: Integer ).void end def write_data_descriptor(io:, compressed_size:, uncompressed_size:, crc32:); end @@ -1017,9 +1017,9 @@ end, T.untyped) sig do params( io: T.untyped, - start_of_central_directory_location: Fixnum, - central_directory_size: Fixnum, - num_files_in_archive: Fixnum, + start_of_central_directory_location: Integer, + central_directory_size: Integer, + num_files_in_archive: Integer, comment: String ).void end @@ -1030,7 +1030,7 @@ end, T.untyped) # _@param_ `compressed_size` — The size of the compressed (or stored) data - how much space it uses in the ZIP # # _@param_ `uncompressed_size` — The size of the file once extracted - sig { params(compressed_size: Fixnum, uncompressed_size: Fixnum).returns(String) } + sig { params(compressed_size: Integer, uncompressed_size: Integer).returns(String) } def zip_64_extra_for_local_file_header(compressed_size:, uncompressed_size:); end # sord omit - no YARD type given for "mtime", using untyped @@ -1053,7 +1053,7 @@ end, T.untyped) # _@param_ `uncompressed_size` — The size of the file once extracted # # _@param_ `local_file_header_location` — Byte offset of the start of the local file header from the beginning of the ZIP archive - sig { params(compressed_size: Fixnum, uncompressed_size: Fixnum, local_file_header_location: Fixnum).returns(String) } + sig { params(compressed_size: Integer, uncompressed_size: Integer, local_file_header_location: Integer).returns(String) } def zip_64_extra_for_central_directory_file_header(compressed_size:, uncompressed_size:, local_file_header_location:); end # sord omit - no YARD type given for "t", using untyped @@ -1126,7 +1126,7 @@ end, T.untyped) # _@param_ `bytes` — the binary string to write (part of the uncompressed file) # # _@return_ — the number of bytes written (will always be the bytesize of `bytes`) - sig { params(bytes: String).returns(Fixnum) } + sig { params(bytes: String).returns(Integer) } def write(bytes); end end @@ -1286,7 +1286,7 @@ end, T.untyped) # _@param_ `io` — an IO-ish object the ZIP file can be read from # # _@return_ — the parsed local header entry and - sig { params(io: T.untyped).returns(T::Array[T.any(ZipEntry, Fixnum)]) } + sig { params(io: T.untyped).returns(T::Array[T.any(ZipEntry, Integer)]) } def read_local_file_header(io:); end # sord duck - #seek looks like a duck type, replacing with untyped @@ -1299,13 +1299,13 @@ end, T.untyped) # header offset given will be the compressed data offset of the entry # (read starting at this offset to get the data). # - # local file header is supposed to begin @return [Fixnum] absolute offset + # local file header is supposed to begin @return [Integer] absolute offset # (0-based) of where the compressed data begins for this file within the ZIP # # _@param_ `io` — an IO-ish object the ZIP file can be read from # # _@param_ `local_file_header_offset` — absolute offset (0-based) where the - sig { params(io: T.untyped, local_file_header_offset: Fixnum).returns(T.untyped) } + sig { params(io: T.untyped, local_file_header_offset: Integer).returns(T.untyped) } def get_compressed_data_offset(io:, local_file_header_offset:); end # Parse an IO handle to a ZIP archive into an array of Entry objects, reading from the end @@ -1502,7 +1502,7 @@ end, T.untyped) # _@return_ — at what offset you should start reading # for the compressed data in your original IO object - sig { returns(Fixnum) } + sig { returns(Integer) } def compressed_data_offset; end # Tells whether the compressed data offset is already known for this entry @@ -1514,7 +1514,7 @@ end, T.untyped) sig { returns(T::Boolean) } def uses_data_descriptor?; end - # sord infer - inferred type of parameter "offset" as Fixnum using getter's return type + # sord infer - inferred type of parameter "offset" as Integer using getter's return type # sord omit - no YARD return type given, using untyped # Sets the offset at which the compressed data for this file starts in the ZIP. # By default, the value will be set by the Reader for you. If you use delayed @@ -1522,43 +1522,43 @@ end, T.untyped) # # entry.compressed_data_offset = reader.get_compressed_data_offset(io: file, # local_file_header_offset: entry.local_header_offset) - sig { params(offset: Fixnum).returns(T.untyped) } + sig { params(offset: Integer).returns(T.untyped) } def compressed_data_offset=(offset); end # _@return_ — bit-packed version signature of the program that made the archive - sig { returns(Fixnum) } + sig { returns(Integer) } attr_accessor :made_by # _@return_ — ZIP version support needed to extract this file - sig { returns(Fixnum) } + sig { returns(Integer) } attr_accessor :version_needed_to_extract # _@return_ — bit-packed general purpose flags - sig { returns(Fixnum) } + sig { returns(Integer) } attr_accessor :gp_flags # _@return_ — Storage mode (0 for stored, 8 for deflate) - sig { returns(Fixnum) } + sig { returns(Integer) } attr_accessor :storage_mode # _@return_ — the bit-packed DOS time - sig { returns(Fixnum) } + sig { returns(Integer) } attr_accessor :dos_time # _@return_ — the bit-packed DOS date - sig { returns(Fixnum) } + sig { returns(Integer) } attr_accessor :dos_date # _@return_ — the CRC32 checksum of this file - sig { returns(Fixnum) } + sig { returns(Integer) } attr_accessor :crc32 # _@return_ — size of compressed file data in the ZIP - sig { returns(Fixnum) } + sig { returns(Integer) } attr_accessor :compressed_size # _@return_ — size of the file once uncompressed - sig { returns(Fixnum) } + sig { returns(Integer) } attr_accessor :uncompressed_size # _@return_ — the filename @@ -1566,20 +1566,20 @@ end, T.untyped) attr_accessor :filename # _@return_ — disk number where this file starts - sig { returns(Fixnum) } + sig { returns(Integer) } attr_accessor :disk_number_start # _@return_ — internal attributes of the file - sig { returns(Fixnum) } + sig { returns(Integer) } attr_accessor :internal_attrs # _@return_ — external attributes of the file - sig { returns(Fixnum) } + sig { returns(Integer) } attr_accessor :external_attrs # _@return_ — at what offset the local file header starts # in your original IO object - sig { returns(Fixnum) } + sig { returns(Integer) } attr_accessor :local_file_header_offset # _@return_ — the file comment @@ -1635,7 +1635,7 @@ end, T.untyped) # _@param_ `io` — the IO to read the data from # # _@return_ — the computed CRC32 value - sig { params(io: IO).returns(Fixnum) } + sig { params(io: IO).returns(Integer) } def self.from_io(io); end # Creates a new streaming CRC32 calculator @@ -1651,7 +1651,7 @@ end, T.untyped) # Returns the CRC32 value computed so far # # _@return_ — the updated CRC32 value for all the blobs so far - sig { returns(Fixnum) } + sig { returns(Integer) } def to_i; end # Appends a known CRC32 value to the current one, and combines the @@ -1662,7 +1662,7 @@ end, T.untyped) # _@param_ `blob_size` — the size of the daata the `crc32` is computed from # # _@return_ — the updated CRC32 value for all the blobs so far - sig { params(crc32: Fixnum, blob_size: Fixnum).returns(Fixnum) } + sig { params(crc32: Integer, blob_size: Integer).returns(Integer) } def append(crc32, blob_size); end # Writes the given data to the output stream. Allows the object to be used as @@ -1671,7 +1671,7 @@ end, T.untyped) # _@param_ `bytes` — the binary string to write (part of the uncompressed file) # # _@return_ — the number of bytes written (will always be the bytesize of `bytes`) - sig { params(bytes: String).returns(Fixnum) } + sig { params(bytes: String).returns(Integer) } def write(bytes); end end @@ -1741,7 +1741,7 @@ end, T.untyped) # _@param_ `bytes` — the binary string to write (part of the uncompressed file) # # _@return_ — the number of bytes written (will always be the bytesize of `bytes`) - sig { params(bytes: String).returns(Fixnum) } + sig { params(bytes: String).returns(Integer) } def write(bytes); end end @@ -1801,7 +1801,7 @@ end, T.untyped) # _@param_ `output_io` — the stream to write to (should respond to `:<<`) # # _@return_ — number of bytes written to `output_io` - sig { params(output_io: IO).returns(Fixnum) } + sig { params(output_io: IO).returns(Integer) } def self.write_terminator(output_io); end # Compress a given binary string and flush the deflate stream at byte boundary. @@ -1812,7 +1812,7 @@ end, T.untyped) # _@param_ `level` — Zlib compression level (defaults to `Zlib::DEFAULT_COMPRESSION`) # # _@return_ — compressed bytes - sig { params(bytes: String, level: Fixnum).returns(String) } + sig { params(bytes: String, level: Integer).returns(String) } def self.deflate_chunk(bytes, level: Zlib::DEFAULT_COMPRESSION); end # Compress the contents of input_io into output_io, in blocks @@ -1838,9 +1838,9 @@ end, T.untyped) params( input_io: IO, output_io: IO, - level: Fixnum, - block_size: Fixnum - ).returns(Fixnum) + level: Integer, + block_size: Integer + ).returns(Integer) end def self.deflate_in_blocks_and_terminate(input_io, output_io, level: Zlib::DEFAULT_COMPRESSION, block_size: DEFAULT_BLOCKSIZE); end @@ -1864,9 +1864,9 @@ end, T.untyped) params( input_io: IO, output_io: IO, - level: Fixnum, - block_size: Fixnum - ).returns(Fixnum) + level: Integer, + block_size: Integer + ).returns(Integer) end def self.deflate_in_blocks(input_io, output_io, level: Zlib::DEFAULT_COMPRESSION, block_size: DEFAULT_BLOCKSIZE); end end @@ -1906,7 +1906,7 @@ end, T.untyped) # _@param_ `use_data_descriptor` — whether the entry uses a postfix # # _@return_ — self - sig { params(filename: String, size: Fixnum, use_data_descriptor: T::Boolean).returns(T.untyped) } + sig { params(filename: String, size: Integer, use_data_descriptor: T::Boolean).returns(T.untyped) } def add_stored_entry(filename:, size:, use_data_descriptor: false); end # Add a fake entry to the archive, to see how big it is going to be in the end. @@ -1923,8 +1923,8 @@ end, T.untyped) sig do params( filename: String, - uncompressed_size: Fixnum, - compressed_size: Fixnum, + uncompressed_size: Integer, + compressed_size: Integer, use_data_descriptor: T::Boolean ).returns(T.untyped) end @@ -1972,7 +1972,7 @@ end, T.untyped) # _@param_ `bytes` — the binary string to write (part of the uncompressed file) # # _@return_ — the number of bytes written (will always be the bytesize of `bytes`) - sig { params(bytes: String).returns(Fixnum) } + sig { params(bytes: String).returns(Integer) } def write(bytes); end end