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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: f250e5cc73d83a35515e972227758e4e88c59618
4
- data.tar.gz: fc4216bf1cf1545bd71bea448bb3f169249748c6
2
+ SHA256:
3
+ metadata.gz: 04b8ee2d64a54dd23bec18326e15a6c96e04464f8d698dfbd18a74cee90248de
4
+ data.tar.gz: 3bdd14a9a4a5b17a0695ff2fac52f7ed17e6bbc4096284a74f1830a0e3b13c53
5
5
  SHA512:
6
- metadata.gz: ba5876149cefd97d006862eeaab9d2da9bc5d5092758337e902cac4f30ac0ce533ea986c66ae2caf901aa4b41d9c2849747f6c7090cbfd95118a36b1a58a6374
7
- data.tar.gz: 325024a2a6ffb822dfad650a4bea36fb74b309593a63d184173607f9b980f13a5d113f9737ad6e4a3032b0ef638e1df4e291eaeaf3bd985551518921e0b1221a
6
+ metadata.gz: b9cc2017c9901f49174488a01b688372e0bd0ec54ec024a21a439f4cb73eaa18ce23c6014924c437a7f31e1b9097ac8e647a1cf2d39dbfdaf1bbc31ab301f9d9
7
+ data.tar.gz: 8372907e92fd884e207d33e2e60ea6bca97d5e2a54aff59c2c3b7a2a5716b8856e90220019929746f76113ecfad987bd646f20c947d6c73467360f4f78098595
@@ -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
@@ -1,3 +1,10 @@
1
+ 0.0.9
2
+ -----
3
+
4
+ * Remove [ruby-uuid][] gem from dependencies
5
+ * [BUG FIX]Convert Set to Array before writing into XML
6
+ * Follow change of EPUB Parser v0.3.6
7
+
1
8
  0.0.8
2
9
  -----
3
10
 
@@ -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
@@ -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.1.0'
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'
@@ -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 = UUID.create.to_s
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]
@@ -1,5 +1,5 @@
1
1
  module EPUB
2
2
  module Maker
3
- VERSION = "0.0.8"
3
+ VERSION = "0.0.9"
4
4
  end
5
5
  end
@@ -5,8 +5,6 @@ end
5
5
 
6
6
  require 'test/unit'
7
7
  require 'test/unit/notify'
8
- require 'open3'
9
- require 'shellwords'
10
8
  require 'pry'
11
9
  require 'epubcheck/ruby/cli'
12
10
  class Test::Unit::TestCase
@@ -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.8
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: 2017-10-09 00:00:00.000000000 Z
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.1.0
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.6.13
272
+ rubygems_version: 2.7.4
287
273
  signing_key:
288
274
  specification_version: 4
289
275
  summary: EPUB Maker