Sha256: 86bd7541581fbe2e700337b77d864e13057ac0278c8b2a4b5e8520bc2cc652ca

Contents?: true

Size: 1.01 KB

Versions: 8

Compression:

Stored size: 1.01 KB

Contents

# frozen_string_literal: true

# Alows reading the central directory of a remote ZIP file without
# downloading the entire file. The central directory provides the
# offsets at which the actual file contents is located. You can then
# use the `Range:` HTTP headers to download those entries separately.
#
# Please read the security warning in `FileReader` _VERY CAREFULLY_
# before you use this module.
module ZipTricks::RemoteUncap
  # @param uri[String] the HTTP(S) URL to read the ZIP footer from
  # @param reader_class[Class] which class to use for reading
  # @param options_for_zip_reader[Hash] any additional options to give to
  # {ZipTricks::FileReader} when reading
  # @return [Array<ZipTricks::FileReader::ZipEntry>] metadata about the
  # files within the remote archive
  def self.files_within_zip_at(uri, reader_class: ZipTricks::FileReader, **options_for_zip_reader)
    fake_io = ZipTricks::RemoteIO.new(uri)
    reader = reader_class.new
    reader.read_zip_structure(io: fake_io, **options_for_zip_reader)
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
zip_tricks-5.6.0 lib/zip_tricks/remote_uncap.rb
zip_tricks-5.5.0 lib/zip_tricks/remote_uncap.rb
zip_tricks-5.4.0 lib/zip_tricks/remote_uncap.rb
zip_tricks-5.3.1 lib/zip_tricks/remote_uncap.rb
zip_tricks-5.3.0 lib/zip_tricks/remote_uncap.rb
zip_tricks-5.2.0 lib/zip_tricks/remote_uncap.rb
zip_tricks-5.1.1 lib/zip_tricks/remote_uncap.rb
zip_tricks-5.1.0 lib/zip_tricks/remote_uncap.rb