gepub 1.0.8 → 1.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/gepub/book.rb +9 -2
- data/lib/gepub/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1f46dcee60ba11a4fad5a7d8fe9ee4ff4e984b955f64ddf0858fac2807cfad2c
|
4
|
+
data.tar.gz: 35fdaefe67e9a32e93d17021183056e57ab35a2cf8111d706bcd40c9f44bfde2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d944ec4dc75280a6acbe8690314277db183ac8ac620c54ed6a7a9f23aeeb3f9d1f537f8ff73e4ce8e2fa3f92476317043fa5a4d9f8b06d457838701fda5edda4
|
7
|
+
data.tar.gz: c76a604adae6eeba657e7a509edbc710ee5d0046955a16809ad09ab9b4c77b5b5845e895e461212b466c39b9743b583ea3dc20ba3cd152f24240cd39c35cf42f
|
data/lib/gepub/book.rb
CHANGED
@@ -183,7 +183,13 @@ module GEPUB
|
|
183
183
|
|
184
184
|
# write EPUB to stream specified by the argument.
|
185
185
|
def write_to_epub_container(epub)
|
186
|
-
|
186
|
+
mod_time = Zip::DOSTime.now
|
187
|
+
unless (last_mod = lastmodified).nil?
|
188
|
+
mod_time = Zip::DOSTime.from_time(last_mod.content)
|
189
|
+
end
|
190
|
+
|
191
|
+
mimetype_entry = Zip::Entry.new(nil, 'mimetype', nil, nil, nil, nil, nil, nil, mod_time)
|
192
|
+
epub.put_next_entry(mimetype_entry, nil, nil, Zip::Entry::STORED)
|
187
193
|
epub << "application/epub+zip"
|
188
194
|
|
189
195
|
entries = {}
|
@@ -203,7 +209,8 @@ module GEPUB
|
|
203
209
|
|
204
210
|
entries.sort_by { |k,_v| k }.each {
|
205
211
|
|k,v|
|
206
|
-
|
212
|
+
zip_entry = Zip::Entry.new(nil, k, nil, nil, nil, nil, nil, nil, mod_time)
|
213
|
+
epub.put_next_entry(zip_entry)
|
207
214
|
epub << v.force_encoding('us-ascii')
|
208
215
|
}
|
209
216
|
end
|
data/lib/gepub/version.rb
CHANGED