Skip to content

Instantly share code, notes, and snippets.

@ebot
Created October 22, 2015 15:21
Show Gist options
  • Save ebot/49e10fbd719ee4b3966f to your computer and use it in GitHub Desktop.
Save ebot/49e10fbd719ee4b3966f to your computer and use it in GitHub Desktop.
def decompress_text(file)
input_file = File.new file, 'rb'
input = input_file.read
output = Zlib::GzipReader.new( StringIO.new( input ) ).read
input_file.close
File.open( file.gsub( '.zip', '.pdf' ), 'w' ) do |f|
f << output
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment