I have to work with a zipped (regular Zip) string in Ruby. Apparently I can't save a temporary file with Ruby-Zip or Zip-Ruby.
Is there any practicable way to unzip this string?
rubyzip supports StringIO since version 1.1.0
require "zip" # zip is the string with the zipped contents Zip::InputStream.open(StringIO.new(zip)) do |io| while (entry = io.get_next_entry) puts "#{entry.name}: '#{io.read}'" end end
2.1m questions
2.1m answers
60 comments
57.0k users