rubyzip for dummies
Ruby
Latest commit 5779702 Oct 2, 2013 @toretore Merge pull request #9 from deCasale/rubyzip-1.0.0
Upgrading rubyzip to 1.0.0
Permalink
Failed to load latest commit information.
lib Upgrading rubyzip to 1.0.0 Oct 2, 2013
spec Upgrading rubyzip to 1.0.0 Oct 2, 2013
.gitignore Ignore swp files Jul 23, 2008
LICENSE MIT license Jun 29, 2012
README Added README Jul 24, 2008
zippy.gemspec Upgrading rubyzip to 1.0.0 Oct 2, 2013

README

Zippy.create 'awsum.zip' do |zip|
  zip['README'] = 'In Soviet Russia, README READSYOU'
  zip['porn.mpeg'] = File.open('rick astley - never gonna give you up.mpg')
end

Zippy.list('awsum.zip') #=> ['README', 'porn.mpeg']

Zippy.open('awsum.zip') do |zip|
  zip['bin/hello_world'] = "#!/usr/bin/env ruby\n\nputs 'hello, zip world'"
end



#Your params as a zip
#It's SAAS!
require 'sinatra'
get '/' do
  Zippy.new{|z| params.each{|k,v| z[k] = v } }.data
end