Sha256: 3d6c4db9b3e1ae3e5586873c0991caf214cb42424d21075f0ebb9929a23d2c3c

Contents?: true

Size: 582 Bytes

Versions: 14

Compression:

Stored size: 582 Bytes

Contents

require_relative '../lib/zip_tricks'

# Predict how large a ZIP file is going to be without having access to the actual
# file contents, but using just the filenames (influences the file size) and the size
# of the files
zip_archive_size_in_bytes = ZipTricks::SizeEstimator.estimate do |zip|
  # Pretend we are going to make a ZIP file which contains a few
  # MP4 files (those do not compress all too well)
  zip.add_stored_entry(filename: "MOV_1234.MP4", size: 898090)
  zip.add_stored_entry(filename: "MOV_1235.MP4", size: 7855126)
end

puts zip_archive_size_in_bytes #=> 8753467

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
zip_tricks-4.4.2 examples/archive_size_estimate.rb
zip_tricks-4.4.1 examples/archive_size_estimate.rb
zip_tricks-4.4.0 examples/archive_size_estimate.rb
zip_tricks-4.3.0 examples/archive_size_estimate.rb
zip_tricks-4.2.4 examples/archive_size_estimate.rb
zip_tricks-4.2.3 examples/archive_size_estimate.rb
zip_tricks-4.2.2 examples/archive_size_estimate.rb
zip_tricks-4.2.1 examples/archive_size_estimate.rb
zip_tricks-4.2.0 examples/archive_size_estimate.rb
zip_tricks-4.1.0 examples/archive_size_estimate.rb
zip_tricks-4.0.0 examples/archive_size_estimate.rb
zip_tricks-3.1.1 examples/archive_size_estimate.rb
zip_tricks-3.1.0 examples/archive_size_estimate.rb
zip_tricks-3.0.0 examples/archive_size_estimate.rb