GitXplorerGitXplorer
s

zipstream

public
22 stars
3 forks
1 issues

Commits

List of commits on branch master.
Verified
a9bc44f23f51e481c6f22f43f815a3e5c0c1bf85

Merge pull request #6 from sj26/dependabot/bundler/rubyzip-2.0.0

ssj26 committed 5 years ago
Verified
dcddfc659d7a316d58ebd25177677f3aac29e097

Bump rubyzip from 0.9.9 to 2.0.0

ddependabot[bot] committed 5 years ago
Unverified
e46bb0f4b45bb3967a7cb689aa717a638d48834b

Merge pull request #5 from alisdair/master

ssj26 committed 12 years ago
Unverified
c7517232e068e4ddb42aad38b9dbed072ae4dcb5

Only register zip mime type if not registered.

aalisdair committed 12 years ago
Unverified
951c8b1e5b4508cfc782614b6f78b912834c00d3

Version 0.1.3

ssj26 committed 12 years ago
Unverified
587933298ee118b46dc712e07eb481d218ca99f0

We have a couple of specs now

ssj26 committed 12 years ago

README

The README file for this repository.

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-#{entry.id}.txt", entry.to_s
end

Which will happily implicitly render from:

class EntriesController
  def index
    @entries = Entry.all
  end
end

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

Caveats

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!

Thanks

Inspired by Rails Builder templates and http://pablotron.org/software/zipstream-php/

License

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