Skip to content

Commit

Permalink
close entries streams after read on parse
Browse files Browse the repository at this point in the history
  • Loading branch information
artygus committed May 12, 2024
1 parent c29a1be commit 8282c04
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/gepub/book.rb
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ def self.parse_container(zip_file, files)
package = nil
zip_file.each do |entry|
if !entry.directory?
files[entry.name] = zip_file.read(entry)
files[entry.name] = entry.get_input_stream(&:read)
case entry.name
when MIMETYPE then
if files[MIMETYPE] != MIMETYPE_CONTENTS
Expand Down
3 changes: 1 addition & 2 deletions spec/gepub_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,7 @@
end

after do
# workaround; rubyzip opened files could not be deleted with remove_entry_secure on windows.
FileUtils.rm_rf @tempdir
FileUtils.remove_entry_secure @tempdir
end

it "should have title" do
Expand Down

0 comments on commit 8282c04

Please sign in to comment.