forked from rubyzip/rubyzip
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix
OutputStream#put_next_entry
to preserve StreamableStream
s.
When passing an `Entry` type to `File#get_output_stream` the entry is used to create a `StreamableStream`, which preserves all the info in the entry, such as timestamp, etc. But then in `put_next_entry` all that is lost due to the test for `kind_of?(Entry)` which a `StreamableStream` is not. See rubyzip#503 for details. This change tests for `StreamableStream`s in `put_next_entry` and uses them directly. Some set-up within `Entry` needed to be made more robust to cope with this, but otherwise it's a low impact change, which does fix the problem. The reason this case was being missed before is that the tests weren't testing `get_output_stream` with an `Entry` object, so I have also added that test too. Fixes rubyzip#503.
- Loading branch information
Showing
4 changed files
with
50 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters