diff --git a/lib/gepub/book.rb b/lib/gepub/book.rb index 40ff37f..3ce5c02 100644 --- a/lib/gepub/book.rb +++ b/lib/gepub/book.rb @@ -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 diff --git a/spec/gepub_spec.rb b/spec/gepub_spec.rb index f290b5c..2714bc5 100644 --- a/spec/gepub_spec.rb +++ b/spec/gepub_spec.rb @@ -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