Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Zip::ZipFile.open_buffer #49

Merged
merged 1 commit into from May 21, 2012
Merged

Added Zip::ZipFile.open_buffer #49

merged 1 commit into from May 21, 2012

Conversation

alexdowad
Copy link
Contributor

It's happened several times now that I have written Ruby scripts which automatically download ZIP files (perhaps from some kind of data feed, etc) and want to extract a file from the downloaded ZIP, without saving it to disk first. I just discovered that it is possible to do so using an optional argument to Zip::ZipInputStream, but I'd rather use the nice, high-level interface of ZipFile and ZipFileSystem. I figure there must be a lot of other people who want to do the same thing. Have a look at this added method, and see if you think it is worth adding to Zip::ZipFile... or perhaps you can come up with a better way to add the same functionality?

simonoff pushed a commit that referenced this pull request May 21, 2012
Added Zip::ZipFile.open_buffer
@simonoff simonoff merged commit 266e7f4 into rubyzip:master May 21, 2012
@mackuba
Copy link

mackuba commented Nov 23, 2012

This doesn't work for me (I'm passing the zip file as a string), I'm getting NoMethodError: undefined method 'path' for #<StringIO:...> when trying to call open_buffer, because ZipEntry#read_c_dir_entry is calling #path on the io object... am I doing something wrong?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants