Guest User

Untitled

a guest
Feb 21st, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.21 KB | None | 0 0
  1. def self.make_zip_io
  2. cmd = "sh -c 'cd /somewhere && zip -r - stuff'"
  3. IO.popen(cmd)
  4. end
  5.  
  6. def zip
  7. io = self.class.make_zip_io
  8. send_data(io.read, :filename => 'filename.zip', :type => 'application/zip')
  9. end
Add Comment
Please, Sign In to add comment