Skip to content

Commit

Permalink
Restore compatibility with rubyzip < 2.1.0
Browse files Browse the repository at this point in the history
Turns out, Zip::DOSTime.from_time only appeared in 2.1.0:
rubyzip/rubyzip@2bdd37d
  • Loading branch information
slonopotamus committed Feb 11, 2020
1 parent 5ea3eaf commit 5aae82d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/gepub/book.rb
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,8 @@ def cleanup
def write_to_epub_container(epub)
mod_time = Zip::DOSTime.now
unless (last_mod = lastmodified).nil?
mod_time = Zip::DOSTime.from_time(last_mod.content)
tm = last_mod.content
mod_time = Zip::DOSTime.local(tm.year, tm.month, tm.day, tm.hour, tm.min, tm.sec)
end

mimetype_entry = Zip::Entry.new(nil, 'mimetype', nil, nil, nil, nil, nil, nil, mod_time)
Expand Down

0 comments on commit 5aae82d

Please sign in to comment.