Skip to content

Instantly share code, notes, and snippets.

@dburger
Created November 23, 2008 21:25
Show Gist options
  • Save dburger/28213 to your computer and use it in GitHub Desktop.
Save dburger/28213 to your computer and use it in GitHub Desktop.
def self.make_zip_io
cmd = "sh -c 'cd /somewhere && zip -r - stuff'"
IO.popen(cmd)
end
def zip
io = self.class.make_zip_io
send_data(io.read, :filename => 'filename.zip', :type => 'application/zip')
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment