Compress::Zip::File
Provides random read access to zip file entries stores inside
a File or an IO::Memory.
Example
require "compress/zip"
Compress::Zip::File.open("./file.zip") do |file|
# Iterate through all entries printing their filename and contents
file.entries.each do |entry|
p entry.filename
entry.open do |io|
p io.gets_to_end
end
end
# Random access to entries by filename is also provided
entry = file["some_file.txt"]
entry.open do |io|
p io.gets_to_end
end
end
Constructors
Class methods
Instance methods
Returns the entry that has the given filename, or
raises KeyError if no such entry exists.
Returns the entry that has the given filename, or
nil if no such entry exists.