epub-maker 0.1.7 → 0.1.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: 0e50c70b73d483a46da5bb6110e0159c311a3ac2a9c1d30a02f9cb28bde5b512
4
- data.tar.gz: be7576c82dda592b0e0296b14b648594c510f122ad125a7b3302bce5d6448d25
3
+ metadata.gz: fcad7a4dc57d3cc9b39f9f591d602b9c4fa8e6f381d4e862b90ebe677f10b66e
4
+ data.tar.gz: da11245d3ced514dc3bb70db1a6735ecf7fcf061a94ff23bafdb095bc92baee6
5
5
  SHA512:
6
- metadata.gz: 0a37e50046f9fc4dd1054b0d21e4a422548d1847a43f89bd6b49133864fa40852909f1f2555a3519cf77807eb169856fa6fe1a2b8705009bd5748b38dfd0431b
7
- data.tar.gz: 6cbb1058962c23db192085603a4cf47865271a4d8ab3ef79cd543de90a67948b0b98c39512392bae3f4e492df05945cd823018795615c371c133e983fb88793d
6
+ metadata.gz: 714e40d064f8207b25f26bc822c856746890f61022622837052008d370cab5d60134af41f9eac8deea1365906994b8089df31e491f1502a3ac2c6eb72b657cf5
7
+ data.tar.gz: 9807fbf0009d259e909dd967651921626a888b8f04fa0df22db07efa85eee436e60a6a571443245c216df35ffe49631de09f9373c514e0090db2fa9a81ea754f
data/.gitlab-ci.yml CHANGED
@@ -3,66 +3,75 @@ before_script:
3
3
  - which ruby
4
4
  - apt -qq update -y
5
5
  - apt -qq install -y default-jre
6
- - gem install bundler --no-document
7
6
  - bundle install --jobs=$(nproc) --path=deps --quiet
8
7
  - bundle clean
9
8
 
10
- test:2.3:
11
- image: ruby:2.3
9
+ test:2.6:
10
+ image: ruby:2.6
12
11
  script: bundle exec rake test
13
12
  except:
14
13
  - tags
15
14
  cache:
16
- key: ruby:2.3
15
+ key: ruby:2.6
17
16
  paths:
18
17
  - deps
19
18
 
20
- test:2.4:
21
- image: ruby:2.4
19
+ test:2.7:
20
+ image: ruby:2.7
22
21
  script: bundle exec rake test
23
22
  except:
24
23
  - tags
25
24
  cache:
26
- key: ruby:2.4
25
+ key: ruby:2.7
27
26
  paths:
28
27
  - deps
29
28
 
30
- test:2.5:
31
- image: ruby:2.5
29
+ test:3.0:
30
+ image: ruby:3.0
32
31
  script: bundle exec rake test
33
32
  except:
34
33
  - tags
35
34
  cache:
36
- key: ruby:2.5
35
+ key: ruby:3.0
37
36
  paths:
38
37
  - deps
39
38
 
40
- test:2.6:
41
- image: ruby:2.6
39
+ test:3.1:
40
+ image: ruby:3.1
42
41
  script: bundle exec rake test
43
42
  except:
44
43
  - tags
45
44
  cache:
46
- key: ruby:2.6
45
+ key: ruby:3.1
47
46
  paths:
48
47
  - deps
49
48
 
50
- test:2.7:
51
- image: ruby:2.7
49
+ test:3.2:
50
+ image: ruby:3.2
52
51
  script: bundle exec rake test
53
52
  except:
54
53
  - tags
55
54
  cache:
56
- key: ruby:2.7
55
+ key: ruby:3.2
57
56
  paths:
58
57
  - deps
59
58
 
60
- test:3.0:
61
- image: ruby:3.0-rc
59
+ test:3.3:
60
+ image: ruby:3.3
62
61
  script: bundle exec rake test
63
62
  except:
64
63
  - tags
65
64
  cache:
66
- key: ruby:3.0
65
+ key: ruby:3.3
66
+ paths:
67
+ - deps
68
+
69
+ test:3.4:
70
+ image: ruby:3.4
71
+ script: bundle exec rake test
72
+ except:
73
+ - tags
74
+ cache:
75
+ key: ruby:3.4
67
76
  paths:
68
77
  - deps
data/CHANGELOG.markdown CHANGED
@@ -1,3 +1,13 @@
1
+ 0.1.9
2
+ -----
3
+
4
+ * Fix output of package@prefix
5
+
6
+ 0.1.8
7
+ -----
8
+
9
+ * Add adapter for Rubyzip
10
+
1
11
  0.1.7
2
12
  -----
3
13
 
data/Gemfile CHANGED
@@ -1,8 +1,8 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
- if ENV['EDGE_PARSER'] == '1'
3
+ if ENV["EPUB_PARSER_PATH"]
4
4
  group :development do
5
- gem 'epub-parser', path: '../epub-parser'
5
+ gem 'epub-parser', path: ENV["EPUB_PARSER_PATH"]
6
6
  end
7
7
  end
8
8
 
data/README.markdown CHANGED
@@ -177,6 +177,13 @@ Todo
177
177
 
178
178
  Recent Changes
179
179
  --------------
180
+ ### 0.1.9
181
+
182
+ * Fix output of package@prefix
183
+
184
+ ### 0.1.8
185
+
186
+ * Add adapter for Rubyzip
180
187
 
181
188
  ### 0.1.7
182
189
 
@@ -186,16 +193,6 @@ Recent Changes
186
193
 
187
194
  * [BUG FIX]Add `mtime` keyword argument to `OCF::PhysicalContainer::Zipruby#write`
188
195
 
189
- ### 0.1.5
190
-
191
- * [BUG FIX]Compare path name in the same encoding when finding file in ZIP archive
192
- * Add `PhysicalContaienr.mtime` API to set mtime of files in EPUB archive
193
-
194
- ### 0.1.4
195
-
196
- * Add `Publication::Package::Metadata#modified=` method
197
- * Rescue Errno::EXDEV on renaming temporary EPUB file
198
-
199
196
  Contributing
200
197
  ------------
201
198
 
data/epub-maker.gemspec CHANGED
@@ -20,7 +20,7 @@ Gem::Specification.new do |gem|
20
20
  gem.require_paths = ["lib"]
21
21
  gem.required_ruby_version = '>= 2.2.0'
22
22
 
23
- gem.add_runtime_dependency 'epub-parser', '>= 0.2.6'
23
+ gem.add_runtime_dependency 'epub-parser', '>= 0.4.8'
24
24
  gem.add_runtime_dependency 'mimemagic'
25
25
  gem.add_runtime_dependency 'archive-zip'
26
26
  gem.add_runtime_dependency 'rake'
@@ -29,6 +29,7 @@ Gem::Specification.new do |gem|
29
29
  gem.add_runtime_dependency "nokogiri"
30
30
 
31
31
  gem.add_development_dependency 'zipruby'
32
+ gem.add_development_dependency 'rubyzip'
32
33
  gem.add_development_dependency 'test-unit'
33
34
  gem.add_development_dependency 'test-unit-notify'
34
35
  gem.add_development_dependency 'epubcheck-ruby'
@@ -0,0 +1,19 @@
1
+ require "epub/ocf/physical_container/rubyzip"
2
+
3
+ module EPUB
4
+ class OCF
5
+ class PhysicalContainer
6
+ class Rubyzip < self
7
+ def write(path_name, content, mtime: nil)
8
+ if @archive
9
+ @archive.remove path_name
10
+ @archive.get_output_stream(path_name, nil, nil, nil, nil, nil, nil, nil, mtime) {|f| f.write content}
11
+ @archive.commit
12
+ else
13
+ open {|container| container.write(path_name, content, mtime: mtime)}
14
+ end
15
+ end
16
+ end
17
+ end
18
+ end
19
+ end
@@ -8,7 +8,7 @@ module EPUB
8
8
  if @archive
9
9
  @archive.add_or_replace_buffer path_name, content
10
10
  else
11
- open {|container| container.save(path_name, content)}
11
+ open {|container| container.write(path_name, content, mtime: mtime)}
12
12
  end
13
13
  end
14
14
  end
@@ -2,7 +2,8 @@ require 'tmpdir'
2
2
  require 'epub/ocf/physical_container'
3
3
  [
4
4
  [:ArchiveZip, 'archive_zip'],
5
- [:Zipruby, 'zipruby']
5
+ [:Zipruby, 'zipruby'],
6
+ [:Rubyzip, 'rubyzip']
6
7
  ].each do |(class_name, feature_name)|
7
8
  if EPUB::OCF::PhysicalContainer.const_defined? class_name
8
9
  require "epub/maker/ocf/physical_container/#{feature_name}"
@@ -14,10 +14,10 @@ module EPUB
14
14
  'unique-identifier' => unique_identifier.id
15
15
  }
16
16
  [
17
- ['dir', dir],
18
- ['id', id],
19
- ['xml:lang', xml_lang],
20
- ['prefix', prefix.reduce('') {|attr, (pfx, iri)| [attr, [pfx, iri].join(':')].join(' ')}]
17
+ ['dir', dir],
18
+ ['id', id],
19
+ ['xml:lang', xml_lang],
20
+ ['prefix', prefix.collect {|pfx, iri| [pfx, iri].join(": ")}.join("\n")]
21
21
  ].each do |(name, value)|
22
22
  next if value.nil? or value.empty?
23
23
  attrs[name] = value
@@ -1,5 +1,5 @@
1
1
  module EPUB
2
2
  module Maker
3
- VERSION = "0.1.7"
3
+ VERSION = "0.1.9"
4
4
  end
5
5
  end
@@ -7,7 +7,6 @@
7
7
  <div>
8
8
  <nav epub:type="toc" id="idid">
9
9
  <hgroup>
10
- <h2>Sub Navigation</h2>
11
10
  <h1>Table of Contents</h1>
12
11
  </hgroup>
13
12
  <ol>
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: epub-maker
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.7
4
+ version: 0.1.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - KITAITI Makoto
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2021-12-26 00:00:00.000000000 Z
10
+ date: 2025-03-02 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: epub-parser
@@ -16,14 +15,14 @@ dependencies:
16
15
  requirements:
17
16
  - - ">="
18
17
  - !ruby/object:Gem::Version
19
- version: 0.2.6
18
+ version: 0.4.8
20
19
  type: :runtime
21
20
  prerelease: false
22
21
  version_requirements: !ruby/object:Gem::Requirement
23
22
  requirements:
24
23
  - - ">="
25
24
  - !ruby/object:Gem::Version
26
- version: 0.2.6
25
+ version: 0.4.8
27
26
  - !ruby/object:Gem::Dependency
28
27
  name: mimemagic
29
28
  requirement: !ruby/object:Gem::Requirement
@@ -122,6 +121,20 @@ dependencies:
122
121
  - - ">="
123
122
  - !ruby/object:Gem::Version
124
123
  version: '0'
124
+ - !ruby/object:Gem::Dependency
125
+ name: rubyzip
126
+ requirement: !ruby/object:Gem::Requirement
127
+ requirements:
128
+ - - ">="
129
+ - !ruby/object:Gem::Version
130
+ version: '0'
131
+ type: :development
132
+ prerelease: false
133
+ version_requirements: !ruby/object:Gem::Requirement
134
+ requirements:
135
+ - - ">="
136
+ - !ruby/object:Gem::Version
137
+ version: '0'
125
138
  - !ruby/object:Gem::Dependency
126
139
  name: test-unit
127
140
  requirement: !ruby/object:Gem::Requirement
@@ -257,6 +270,7 @@ files:
257
270
  - lib/epub/maker/ocf.rb
258
271
  - lib/epub/maker/ocf/physical_container.rb
259
272
  - lib/epub/maker/ocf/physical_container/archive_zip.rb
273
+ - lib/epub/maker/ocf/physical_container/rubyzip.rb
260
274
  - lib/epub/maker/ocf/physical_container/zipruby.rb
261
275
  - lib/epub/maker/publication.rb
262
276
  - lib/epub/maker/task.rb
@@ -282,7 +296,6 @@ files:
282
296
  homepage: http://www.rubydoc.info/gems/epub-maker
283
297
  licenses: []
284
298
  metadata: {}
285
- post_install_message:
286
299
  rdoc_options: []
287
300
  require_paths:
288
301
  - lib
@@ -297,8 +310,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
297
310
  - !ruby/object:Gem::Version
298
311
  version: '0'
299
312
  requirements: []
300
- rubygems_version: 3.3.3
301
- signing_key:
313
+ rubygems_version: 3.6.5
302
314
  specification_version: 4
303
315
  summary: EPUB Maker
304
316
  test_files: