epub-maker 0.0.8 → 0.0.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.gitlab-ci.yml +23 -9
- data/CHANGELOG.markdown +7 -0
- data/README.markdown +9 -0
- data/epub-maker.gemspec +1 -2
- data/lib/epub/maker.rb +2 -3
- data/lib/epub/maker/publication.rb +3 -2
- data/lib/epub/maker/version.rb +1 -1
- data/test/helper.rb +0 -2
- data/test/test_maker.rb +17 -0
- metadata +4 -18
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 04b8ee2d64a54dd23bec18326e15a6c96e04464f8d698dfbd18a74cee90248de
|
4
|
+
data.tar.gz: 3bdd14a9a4a5b17a0695ff2fac52f7ed17e6bbc4096284a74f1830a0e3b13c53
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b9cc2017c9901f49174488a01b688372e0bd0ec54ec024a21a439f4cb73eaa18ce23c6014924c437a7f31e1b9097ac8e647a1cf2d39dbfdaf1bbc31ab301f9d9
|
7
|
+
data.tar.gz: 8372907e92fd884e207d33e2e60ea6bca97d5e2a54aff59c2c3b7a2a5716b8856e90220019929746f76113ecfad987bd646f20c947d6c73467360f4f78098595
|
data/.gitlab-ci.yml
CHANGED
@@ -5,20 +5,34 @@ before_script:
|
|
5
5
|
- apt -qq install -y default-jre
|
6
6
|
- gem install bundler --no-document
|
7
7
|
- bundle install --jobs=$(nproc) --path=deps --quiet
|
8
|
-
|
9
|
-
cache:
|
10
|
-
paths:
|
11
|
-
- deps/
|
12
|
-
|
13
|
-
test:2.2:
|
14
|
-
image: ruby:2.2
|
15
|
-
script:
|
16
|
-
- bundle exec rake test
|
8
|
+
- bundle clean
|
17
9
|
|
18
10
|
test:2.3:
|
19
11
|
image: ruby:2.3
|
20
12
|
script: bundle exec rake test
|
13
|
+
except:
|
14
|
+
- tags
|
15
|
+
cache:
|
16
|
+
key: ruby:2.3
|
17
|
+
paths:
|
18
|
+
- deps
|
21
19
|
|
22
20
|
test:2.4:
|
23
21
|
image: ruby:2.4
|
24
22
|
script: bundle exec rake test
|
23
|
+
except:
|
24
|
+
- tags
|
25
|
+
cache:
|
26
|
+
key: ruby:2.4
|
27
|
+
paths:
|
28
|
+
- deps
|
29
|
+
|
30
|
+
test:2.5:
|
31
|
+
image: ruby:2.5
|
32
|
+
script: bundle exec rake test
|
33
|
+
except:
|
34
|
+
- tags
|
35
|
+
cache:
|
36
|
+
key: ruby:2.5
|
37
|
+
paths:
|
38
|
+
- deps
|
data/CHANGELOG.markdown
CHANGED
data/README.markdown
CHANGED
@@ -178,7 +178,16 @@ Todo
|
|
178
178
|
|
179
179
|
Recent Changes
|
180
180
|
--------------
|
181
|
+
### 0.0.9
|
182
|
+
|
183
|
+
* Remove [ruby-uuid][] gem from dependencies
|
184
|
+
* [BUG FIX]Convert Set to Array before writing into XML
|
185
|
+
* Follow change of EPUB Parser v0.3.6
|
186
|
+
|
187
|
+
[ruby-uuid]: https://github.com/shyouhei/ruby-uuid
|
188
|
+
|
181
189
|
### 0.0.8
|
190
|
+
|
182
191
|
* Use default temporary directory for `EPUB::Maker.archive`
|
183
192
|
|
184
193
|
### 0.0.7
|
data/epub-maker.gemspec
CHANGED
@@ -18,11 +18,10 @@ Gem::Specification.new do |gem|
|
|
18
18
|
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
|
19
19
|
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
20
20
|
gem.require_paths = ["lib"]
|
21
|
-
gem.required_ruby_version = '>= 2.
|
21
|
+
gem.required_ruby_version = '>= 2.2.0'
|
22
22
|
|
23
23
|
gem.add_runtime_dependency 'epub-parser', '>= 0.2.6'
|
24
24
|
gem.add_runtime_dependency 'mimemagic'
|
25
|
-
gem.add_runtime_dependency 'ruby-uuid'
|
26
25
|
gem.add_runtime_dependency 'archive-zip'
|
27
26
|
gem.add_runtime_dependency 'rake'
|
28
27
|
gem.add_runtime_dependency 'addressable', '>= 2.3.5'
|
data/lib/epub/maker.rb
CHANGED
@@ -4,7 +4,6 @@ require 'fileutils'
|
|
4
4
|
require 'tempfile'
|
5
5
|
require 'tmpdir'
|
6
6
|
require 'time'
|
7
|
-
require 'uuid'
|
8
7
|
require 'archive/zip'
|
9
8
|
require 'epub'
|
10
9
|
require 'epub/constants'
|
@@ -114,11 +113,11 @@ module EPUB
|
|
114
113
|
def make_package
|
115
114
|
package = Publication::Package.new
|
116
115
|
package.book = self
|
116
|
+
no_package_rootfile = rootfiles.find {|rf| rf.package.nil?}
|
117
|
+
no_package_rootfile.package = package if no_package_rootfile
|
117
118
|
package.make do |package|
|
118
119
|
yield package if block_given?
|
119
120
|
end
|
120
|
-
no_package_rootfile = rootfiles.find {|rf| rf.package.nil?}
|
121
|
-
no_package_rootfile.package = package if no_package_rootfile
|
122
121
|
package
|
123
122
|
end
|
124
123
|
|
@@ -1,3 +1,4 @@
|
|
1
|
+
require 'securerandom'
|
1
2
|
require 'epub/publication/package'
|
2
3
|
|
3
4
|
module EPUB
|
@@ -102,7 +103,7 @@ module EPUB
|
|
102
103
|
if identifiers.empty?
|
103
104
|
identifier = DCMES.new
|
104
105
|
identifier.id = 'pub-id'
|
105
|
-
identifier.content =
|
106
|
+
identifier.content = SecureRandom.uuid
|
106
107
|
self.dc_identifiers << identifier
|
107
108
|
self.unique_identifier = identifier
|
108
109
|
else
|
@@ -315,7 +316,7 @@ module EPUB
|
|
315
316
|
itemref_node = xml.itemref
|
316
317
|
to_xml_attribute itemref_node, itemref, [:idref, :id]
|
317
318
|
itemref_node['linear'] = 'no' unless itemref.linear?
|
318
|
-
itemref_node['properties'] = itemref.properties.join(' ') unless itemref.properties.empty?
|
319
|
+
itemref_node['properties'] = itemref.properties.to_a.join(' ') unless itemref.properties.empty?
|
319
320
|
end
|
320
321
|
}
|
321
322
|
to_xml_attribute node, self, [:id, :toc, :page_progression_direction]
|
data/lib/epub/maker/version.rb
CHANGED
data/test/helper.rb
CHANGED
data/test/test_maker.rb
CHANGED
@@ -76,4 +76,21 @@ class TestMaker < Test::Unit::TestCase
|
|
76
76
|
|
77
77
|
assert_path_exist dirname
|
78
78
|
end
|
79
|
+
|
80
|
+
def test_archive_default
|
81
|
+
epub_path = EPUB::Maker.archive(@fixture_dir)
|
82
|
+
|
83
|
+
assert_nothing_raised do
|
84
|
+
EPUB::Parser.parse epub_path
|
85
|
+
end
|
86
|
+
end
|
87
|
+
|
88
|
+
def test_archive_explit_epub_path
|
89
|
+
epub_path = EPUB::Maker.archive(@fixture_dir, @dir/"specified-path.epub")
|
90
|
+
|
91
|
+
assert_nothing_raised do
|
92
|
+
EPUB::Parser.parse epub_path
|
93
|
+
end
|
94
|
+
assert_equal (@dir/"specified-path.epub"), epub_path
|
95
|
+
end
|
79
96
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: epub-maker
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- KITAITI Makoto
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-03-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: epub-parser
|
@@ -38,20 +38,6 @@ dependencies:
|
|
38
38
|
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0'
|
41
|
-
- !ruby/object:Gem::Dependency
|
42
|
-
name: ruby-uuid
|
43
|
-
requirement: !ruby/object:Gem::Requirement
|
44
|
-
requirements:
|
45
|
-
- - ">="
|
46
|
-
- !ruby/object:Gem::Version
|
47
|
-
version: '0'
|
48
|
-
type: :runtime
|
49
|
-
prerelease: false
|
50
|
-
version_requirements: !ruby/object:Gem::Requirement
|
51
|
-
requirements:
|
52
|
-
- - ">="
|
53
|
-
- !ruby/object:Gem::Version
|
54
|
-
version: '0'
|
55
41
|
- !ruby/object:Gem::Dependency
|
56
42
|
name: archive-zip
|
57
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -275,7 +261,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
275
261
|
requirements:
|
276
262
|
- - ">="
|
277
263
|
- !ruby/object:Gem::Version
|
278
|
-
version: 2.
|
264
|
+
version: 2.2.0
|
279
265
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
280
266
|
requirements:
|
281
267
|
- - ">="
|
@@ -283,7 +269,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
283
269
|
version: '0'
|
284
270
|
requirements: []
|
285
271
|
rubyforge_project:
|
286
|
-
rubygems_version: 2.
|
272
|
+
rubygems_version: 2.7.4
|
287
273
|
signing_key:
|
288
274
|
specification_version: 4
|
289
275
|
summary: EPUB Maker
|