fb2rb 0.1.1 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d1f9023970c90759eb32f56a5bbef46864bb5b6bbe74801b63d74b215bc20741
4
- data.tar.gz: a44854f8a96a67c36a3bc7e3f66a24209de49d211508f267ccf6fe7f1fcf1651
3
+ metadata.gz: d5f6fdeb1a2fe779953477c9eca2e0213dc057d2b4efc3728256085874a1f129
4
+ data.tar.gz: c298f3cbdb346f83519741dde2f6ac1b572d21cc5593a4a3a670279a79b2dbe1
5
5
  SHA512:
6
- metadata.gz: '062709548a3e5d5fd83ec9b85709f5beb5018d5d5b490dcc6f81af71c09d7e9a7d0c5bcd7b14fb1cff55491cda656987b55518f11c299f222918eba58d406ec4'
7
- data.tar.gz: 45c0b3159351d8636695df9ec95a55b62ba7810af3b8320ed1210ea0895fd53a6cf35433bb803878133597f4f839c242efa9731004521c953475d0d56c1a8b13
6
+ metadata.gz: b82bc9063e645d85b79bb123ab59e8f5639873ce6ac3edc65330c353a5ef076c25270584539da096c85043d77e1b0690cb774e700b2d91ab699fff3612cdad69
7
+ data.tar.gz: ed5787ea4d920ab9520b21a868d282e8dcbbde2ff9e35747d62a93521135d51f4169f2859977184899f689db65a2a06b00190f445b668ecf5739289f88b401b2
@@ -7,9 +7,15 @@
7
7
  This document provides a high-level view of the changes to the {project-name} by release.
8
8
  For a detailed view of what has changed, refer to the {uri-project}/commits/master[commit history] on GitHub.
9
9
 
10
+ == 0.2.0 (2020-07-24) - @slonopotamus
11
+
12
+ * Add support for reproducible builds
13
+ * Remove broken `FB2rb::Book.to_ios`.
14
+ Use `FB2rb::Book.write` instead.
15
+
10
16
  == 0.1.1 (2020-07-23) - @slonopotamus
11
17
 
12
- * Annonate field types
18
+ * Annotate field types
13
19
  * Fix serialization of `<publisher>` in `<document-info>`
14
20
 
15
21
  == 0.1.0 (2020-07-23) - @slonopotamus
@@ -91,16 +91,8 @@ module FB2rb
91
91
  end
92
92
  end
93
93
 
94
- # Serializes and returns FB2 as StringIO.
95
- # @return [StringIO]
96
- def to_ios
97
- Zip::OutputStream.write_buffer do |io|
98
- write_to_stream(io)
99
- end
100
- end
101
-
102
94
  # Writes FB2 to file or IO object. If file exists, it will be overwritten.
103
- def write(filename_or_io)
95
+ def write(filename_or_io = StringIO.new)
104
96
  if filename_or_io.respond_to?(:write)
105
97
  Zip::OutputStream.write_buffer(filename_or_io) do |zos|
106
98
  write_to_zip(zos)
@@ -115,8 +107,14 @@ module FB2rb
115
107
  private
116
108
 
117
109
  def write_to_zip(zos)
110
+ mod_time = Zip::DOSTime.now
111
+ unless (tm = description.document_info.date.value).nil?
112
+ mod_time = Zip::DOSTime.gm(tm.year, tm.month, tm.day)
113
+ end
114
+
118
115
  # TODO: entry name
119
- zos.put_next_entry('book.fb2')
116
+ mimetype_entry = Zip::Entry.new(nil, 'book.fb2', nil, nil, nil, nil, nil, nil, mod_time)
117
+ zos.put_next_entry(mimetype_entry, nil, nil, Zip::Entry::DEFLATED)
120
118
  write_to_stream(zos)
121
119
  end
122
120
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module FB2rb
4
- VERSION = '0.1.1'
4
+ VERSION = '0.2.0'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fb2rb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marat Radchenko
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-07-23 00:00:00.000000000 Z
11
+ date: 2020-07-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri