Skip to content

Commit

Permalink
use rm_rf on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
skoji committed Apr 27, 2024
1 parent 6dd633e commit 3422cff
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
4 changes: 2 additions & 2 deletions lib/gepub/book.rb
Original file line number Diff line number Diff line change
Expand Up @@ -102,14 +102,14 @@ 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 }
}
end
book
end

Expand Down
8 changes: 7 additions & 1 deletion spec/gepub_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
require File.dirname(__FILE__) + '/spec_helper.rb'
require 'rubygems'
require 'nokogiri'
require 'rbconfig'

describe GEPUB::Item do
it "should return atttributes" do
Expand Down Expand Up @@ -79,7 +80,12 @@
end

after do
FileUtils.remove_entry_secure @tempdir
if RbConfig::CONFIG['host_os'] =~ /mswin/
# workaround; rubyzip opened files could not be deleted with remove_entry_secure on windows.
FileUtils.rm_rf @tempdir
else
FileUtils.remove_entry_secure @tempdir
end
end

it "should have title" do
Expand Down

0 comments on commit 3422cff

Please sign in to comment.