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 +4 -4
- data/CHANGELOG.adoc +7 -1
- data/lib/fb2rb.rb +8 -10
- data/lib/fb2rb/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d5f6fdeb1a2fe779953477c9eca2e0213dc057d2b4efc3728256085874a1f129
|
4
|
+
data.tar.gz: c298f3cbdb346f83519741dde2f6ac1b572d21cc5593a4a3a670279a79b2dbe1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b82bc9063e645d85b79bb123ab59e8f5639873ce6ac3edc65330c353a5ef076c25270584539da096c85043d77e1b0690cb774e700b2d91ab699fff3612cdad69
|
7
|
+
data.tar.gz: ed5787ea4d920ab9520b21a868d282e8dcbbde2ff9e35747d62a93521135d51f4169f2859977184899f689db65a2a06b00190f445b668ecf5739289f88b401b2
|
data/CHANGELOG.adoc
CHANGED
@@ -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
|
-
*
|
18
|
+
* Annotate field types
|
13
19
|
* Fix serialization of `<publisher>` in `<document-info>`
|
14
20
|
|
15
21
|
== 0.1.0 (2020-07-23) - @slonopotamus
|
data/lib/fb2rb.rb
CHANGED
@@ -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
|
-
|
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
|
|
data/lib/fb2rb/version.rb
CHANGED
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.
|
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-
|
11
|
+
date: 2020-07-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: nokogiri
|