examples/zip-container-info in zip-container-3.0.2 vs examples/zip-container-info in zip-container-4.0.1

- old
+ new

@@ -48,23 +48,23 @@ rescue ZipContainer::MalformedContainerError, ZipContainer::ZipError => err puts err.to_s exit 1 end -puts "Archive: #{container.to_s}" +puts "Archive: #{container}" puts "Container file size: #{File.size(container_file)} bytes, "\ "number of entries: #{container.size}" total_size = 0 total_comp = 0 container.each do |entry| total_size += entry.size total_comp += entry.compressed_size - comp = entry.compression_method == 0 ? "stor" : "defN" + comp = entry.compression_method.zero? ? 'stor' : 'defN' size = entry.size.to_s.rjust(8) puts "#{size} #{comp} #{entry.time} #{entry.name}" end ratio = ((total_size - total_comp) / total_size.to_f) * 100 -puts "%d files, %d bytes uncompressed, %d bytes compressed: %.1f%%" % - [container.size, total_size, total_comp, ratio] +puts "#{container.size} files, #{total_size} bytes uncompressed, "\ + "#{total_comp} bytes compressed: #{ratio.round(1)}%"