Skip to content

Commit

Permalink
add zip_file.close to Book.parse; seems to needed on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
skoji committed Apr 26, 2024
1 parent 6dd633e commit 0505e56
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/gepub/book.rb
Original file line number Diff line number Diff line change
Expand Up @@ -102,14 +102,17 @@ def self.parse(io)
package = nil
package_path = nil
book = nil
Zip::File.open_buffer(io) {
Zip::File.open_buffer(io) do
|zip_file|
package, package_path = parse_container(zip_file, files)
check_consistency_of_package(package, package_path)
parse_files_into_package(files, package)
book = Book.new(package.path)
book.instance_eval { @package = package; @optional_files = files }
}
ensure
zip_file.close
end

book
end

Expand Down

0 comments on commit 0505e56

Please sign in to comment.