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

IO class is not properly supported for streaming. #192

Closed
weshatheleopard opened this issue Nov 20, 2014 · 2 comments
Closed

IO class is not properly supported for streaming. #192

weshatheleopard opened this issue Nov 20, 2014 · 2 comments

Comments

@weshatheleopard
Copy link
Contributor

Change the code at the following location (

Zip::File.open_buffer(File.binread(zname)) do |zipfile|
) to be as follows:

File.open(zname, 'rb') { |f|
  Zip::File.open_buffer(f) do |zipfile|
  end
}

According to the documentation, IO object is valid in this situation. However, the modified test fails:

ZipFileTest#test_streaming:
ArgumentError: wrong number of arguments (0 for 1..2)
    /mnt/var/git/rubyzip/lib/zip/output_stream.rb:32:in `reopen'
    /mnt/var/git/rubyzip/lib/zip/output_stream.rb:32:in `initialize'
    /mnt/var/git/rubyzip/lib/zip/output_stream.rb:59:in `new'
    /mnt/var/git/rubyzip/lib/zip/output_stream.rb:59:in `write_buffer'
    /mnt/var/git/rubyzip/lib/zip/file.rb:317:in `write_buffer'
    /mnt/var/git/rubyzip/lib/zip/file.rb:128:in `open_buffer'
    /mnt/var/git/rubyzip/test/file_test.rb:542:in `block in test_streaming'
    /mnt/var/git/rubyzip/test/file_test.rb:541:in `open'
    /mnt/var/git/rubyzip/test/file_test.rb:541:in `test_streaming'

Also see related #177.

@weshatheleopard weshatheleopard changed the title IO is not fully supported for streaming. IO is not fully supported for streaming. Nov 20, 2014
@weshatheleopard weshatheleopard changed the title IO is not fully supported for streaming. IO class is not properly supported for streaming. Nov 20, 2014
@mikemccrary
Copy link

Also see related PR: #182

@jdleesmiller
Copy link
Member

I think this is the same as #146 and now fixed.

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

No branches or pull requests

3 participants