epub-maker 0.1.7 → 0.1.8

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: 0e50c70b73d483a46da5bb6110e0159c311a3ac2a9c1d30a02f9cb28bde5b512
4
- data.tar.gz: be7576c82dda592b0e0296b14b648594c510f122ad125a7b3302bce5d6448d25
3
+ metadata.gz: 1b26628c4a7d89e94b8e25bc92d7013aae3f6425a93b2b8af0797e47d4a658a7
4
+ data.tar.gz: bc67628100b42657aa0bfe5fa380051a46e17e2a20474c8bd0534afd11eeaf81
5
5
  SHA512:
6
- metadata.gz: 0a37e50046f9fc4dd1054b0d21e4a422548d1847a43f89bd6b49133864fa40852909f1f2555a3519cf77807eb169856fa6fe1a2b8705009bd5748b38dfd0431b
7
- data.tar.gz: 6cbb1058962c23db192085603a4cf47865271a4d8ab3ef79cd543de90a67948b0b98c39512392bae3f4e492df05945cd823018795615c371c133e983fb88793d
6
+ metadata.gz: d74593cad469b3d3acd0be9542536cbca6ca4e31376bf4536ec87737d44c924dce582b71091d6a9b5ad3e2743a48869f65a38fced547bbf0bc1a2a6d96acfcc6
7
+ data.tar.gz: e0d2cdcac5d58ea1bac5f495434dfe35b1bb78720e084823de14e0814c4739961a20b2a45765fdc29e6ca2304d7762d4edb5a42a54b9c3a7661a68521a9fd308
data/.gitlab-ci.yml CHANGED
@@ -7,62 +7,52 @@ before_script:
7
7
  - bundle install --jobs=$(nproc) --path=deps --quiet
8
8
  - bundle clean
9
9
 
10
- test:2.3:
11
- image: ruby:2.3
12
- script: bundle exec rake test
13
- except:
14
- - tags
15
- cache:
16
- key: ruby:2.3
17
- paths:
18
- - deps
19
-
20
- test:2.4:
21
- image: ruby:2.4
10
+ test:2.6:
11
+ image: ruby:2.6
22
12
  script: bundle exec rake test
23
13
  except:
24
14
  - tags
25
15
  cache:
26
- key: ruby:2.4
16
+ key: ruby:2.6
27
17
  paths:
28
18
  - deps
29
19
 
30
- test:2.5:
31
- image: ruby:2.5
20
+ test:2.7:
21
+ image: ruby:2.7
32
22
  script: bundle exec rake test
33
23
  except:
34
24
  - tags
35
25
  cache:
36
- key: ruby:2.5
26
+ key: ruby:2.7
37
27
  paths:
38
28
  - deps
39
29
 
40
- test:2.6:
41
- image: ruby:2.6
30
+ test:3.0:
31
+ image: ruby:3.0
42
32
  script: bundle exec rake test
43
33
  except:
44
34
  - tags
45
35
  cache:
46
- key: ruby:2.6
36
+ key: ruby:3.0
47
37
  paths:
48
38
  - deps
49
39
 
50
- test:2.7:
51
- image: ruby:2.7
40
+ test:3.1:
41
+ image: ruby:3.1
52
42
  script: bundle exec rake test
53
43
  except:
54
44
  - tags
55
45
  cache:
56
- key: ruby:2.7
46
+ key: ruby:3.1
57
47
  paths:
58
48
  - deps
59
49
 
60
- test:3.0:
61
- image: ruby:3.0-rc
50
+ test:3.2:
51
+ image: ruby:3.2
62
52
  script: bundle exec rake test
63
53
  except:
64
54
  - tags
65
55
  cache:
66
- key: ruby:3.0
56
+ key: ruby:3.2
67
57
  paths:
68
58
  - deps
data/CHANGELOG.markdown CHANGED
@@ -1,3 +1,8 @@
1
+ 0.1.8
2
+ -----
3
+
4
+ * Add adapter for Rubyzip
5
+
1
6
  0.1.7
2
7
  -----
3
8
 
data/README.markdown CHANGED
@@ -177,6 +177,9 @@ Todo
177
177
 
178
178
  Recent Changes
179
179
  --------------
180
+ ### 0.1.8
181
+
182
+ * Add adapter for Rubyzip
180
183
 
181
184
  ### 0.1.7
182
185
 
@@ -186,16 +189,6 @@ Recent Changes
186
189
 
187
190
  * [BUG FIX]Add `mtime` keyword argument to `OCF::PhysicalContainer::Zipruby#write`
188
191
 
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
192
  Contributing
200
193
  ------------
201
194
 
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'
@@ -28,7 +28,8 @@ Gem::Specification.new do |gem|
28
28
  gem.add_runtime_dependency 'rexml'
29
29
  gem.add_runtime_dependency "nokogiri"
30
30
 
31
- gem.add_development_dependency 'zipruby'
31
+ gem.add_development_dependency 'zipruby' unless RUBY_PLATFORM.match /mingw|arm64-darwin/
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)}
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}"
@@ -1,5 +1,5 @@
1
1
  module EPUB
2
2
  module Maker
3
- VERSION = "0.1.7"
3
+ VERSION = "0.1.8"
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,14 @@
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.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - KITAITI Makoto
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-12-26 00:00:00.000000000 Z
11
+ date: 2023-11-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: epub-parser
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: 0.2.6
19
+ version: 0.4.8
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: 0.2.6
26
+ version: 0.4.8
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: mimemagic
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -109,7 +109,7 @@ dependencies:
109
109
  - !ruby/object:Gem::Version
110
110
  version: '0'
111
111
  - !ruby/object:Gem::Dependency
112
- name: zipruby
112
+ name: rubyzip
113
113
  requirement: !ruby/object:Gem::Requirement
114
114
  requirements:
115
115
  - - ">="
@@ -257,6 +257,7 @@ files:
257
257
  - lib/epub/maker/ocf.rb
258
258
  - lib/epub/maker/ocf/physical_container.rb
259
259
  - lib/epub/maker/ocf/physical_container/archive_zip.rb
260
+ - lib/epub/maker/ocf/physical_container/rubyzip.rb
260
261
  - lib/epub/maker/ocf/physical_container/zipruby.rb
261
262
  - lib/epub/maker/publication.rb
262
263
  - lib/epub/maker/task.rb
@@ -282,7 +283,7 @@ files:
282
283
  homepage: http://www.rubydoc.info/gems/epub-maker
283
284
  licenses: []
284
285
  metadata: {}
285
- post_install_message:
286
+ post_install_message:
286
287
  rdoc_options: []
287
288
  require_paths:
288
289
  - lib
@@ -297,8 +298,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
297
298
  - !ruby/object:Gem::Version
298
299
  version: '0'
299
300
  requirements: []
300
- rubygems_version: 3.3.3
301
- signing_key:
301
+ rubygems_version: 3.4.22
302
+ signing_key:
302
303
  specification_version: 4
303
304
  summary: EPUB Maker
304
305
  test_files: