I want to unzip a lot of zip files. Is there a module or script that checks which format the zip file is and decompresses it? This should work on Linux, I don\'t care about
The easiest way is to probably use Zlib
Zlib is a Ruby library. What follows is a simple program to grab a Zipped file from a particular URL, unzip it, and paste its contents to the screen.
require 'zlib'
require 'open-uri'
uri = "www.somedomain.com/filename.gz"
source = open(uri)
gz = Zlib::GzipReader.new(source)
result = gz.read
puts result
I hope this helps.