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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6279f47052dbbe90014ca6653faf663043872dabd364f3cabadc9c2e82ae8262
4
- data.tar.gz: 79e0d32c97a46879c7b6597c48bbeb1253e96bd89c3d5f2c04d307d35c544118
3
+ metadata.gz: 1f46dcee60ba11a4fad5a7d8fe9ee4ff4e984b955f64ddf0858fac2807cfad2c
4
+ data.tar.gz: 35fdaefe67e9a32e93d17021183056e57ab35a2cf8111d706bcd40c9f44bfde2
5
5
  SHA512:
6
- metadata.gz: bdb6373fc9a484abfd0c041fc989313b6c3033d6c192fd0688b80597fefc1f64aa49cecd56539c67aed9669f1b623ad2c500d046d47bda02853ffb3f6d3dd525
7
- data.tar.gz: 2cf23f8b402e491e4dff1b3a6b69a6e9ca6130139716a991d447e0b670bd04249dc0d030b247936a070bbaf7cdd8aa58f6ebb64313cd549a2879d5f0c1ccafdd
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
- epub.put_next_entry('mimetype', '', '', Zip::Entry::STORED)
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
- epub.put_next_entry(k)
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
@@ -1,4 +1,4 @@
1
1
  module GEPUB
2
2
  # GEPUB gem version
3
- VERSION = "1.0.8"
3
+ VERSION = "1.0.9"
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gepub
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.8
4
+ version: 1.0.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - KOJIMA Satoshi