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

Fix #280 - open_buffer mangles the content of the buffer it is given. #360

Merged
merged 5 commits into from Sep 5, 2019

Commits on Apr 3, 2018

  1. Copy the full SHA
    7cd263e View commit details
    Browse the repository at this point in the history
  2. Handle passing an IO to Zip::File.new better.

    This now actually extracts the path from the IO if one is passed in.
    hainesr committed Apr 3, 2018
    Copy the full SHA
    cfa9441 View commit details
    Browse the repository at this point in the history

Commits on Apr 4, 2018

  1. No need to require stringio in Zip::File.open_buffer.

    It's already required in zip.rb.
    hainesr committed Apr 4, 2018
    Copy the full SHA
    0363393 View commit details
    Browse the repository at this point in the history
  2. Fix File.open_buffer when no changes are made.

    Things are now more carefully set up, and if a buffer is passed in which
    represents a file that already exists then this is taken into account. All
    initialization is now done in File.new, rather than being split between there
    and File.open_buffer.
    
    This has also needed a bit of a re-write of Zip::File.initialize. I've tried to
    bring some logic to it as a result, and have added comments to explain what is
    now happening.
    hainesr committed Apr 4, 2018
    Copy the full SHA
    15ccc25 View commit details
    Browse the repository at this point in the history
  3. Switch newly created StringIOs to binmode.

    StringIO objects created within File.open_buffer were not being switched into
    binmode, but those passed in were. Fix this inconsistency and add a test.
    hainesr committed Apr 4, 2018
    Copy the full SHA
    84c2089 View commit details
    Browse the repository at this point in the history