Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Create zip files to a stream with rails integration.
branch: master

Merge pull request #5 from alisdair/master

Fix Mime::Type warning for Rails > 3.2
latest commit e46bb0f4b4
@sj26 authored
Failed to load latest commit information.
lib Only register zip mime type if not registered.
spec Fix 1.8.7 variable scoping issue in spec
.gitignore First, basic cut
.travis.yml Non-MRI rubies don't do callcc or yielding properly
Gemfile.lock Add rake as a development dependency
LICENSE First, basic cut We have a couple of specs now
Rakefile Add Rakefile to run specs
zipstream.gemspec Add rake as a development dependency

ZipStream Build Status

Create zip files to a stream.

Integration with Ruby on Rails means you can create a view, index.zipstream, which is a ruby file with a zip object:

@entries.each do |entry|
  zip.write "entry-#{}.txt", entry.to_s

Which will happily implicitly render from:

class EntriesController
  def index
    @entries = Entry.all

Giving you a zip file when rendered. More to come!


Keep in mind that this will use one of your workers/threads/processes until the file is completely downloaded. We are using an iterated rack body which streams so if rack/web servers handle this nicely then you might be in luck.

Tested with Rails 3.1 on REE 1.8.7 and MRI 1.9.3.

Large files are not yet handled efficiently. Coming soon!


Inspired by Rails Builder templates and


Copyright (c) 2011 Samuel Cochran ( Released under the MIT License, see LICENSE for details.

Something went wrong with that request. Please try again.