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 +4 -4
- data/.gitlab-ci.yml +15 -25
- data/CHANGELOG.markdown +5 -0
- data/README.markdown +3 -10
- data/epub-maker.gemspec +3 -2
- data/lib/epub/maker/ocf/physical_container/rubyzip.rb +19 -0
- data/lib/epub/maker/ocf/physical_container/zipruby.rb +1 -1
- data/lib/epub/maker/ocf/physical_container.rb +2 -1
- data/lib/epub/maker/version.rb +1 -1
- data/test/fixtures/book/OPS/nav.xhtml +0 -1
- metadata +10 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1b26628c4a7d89e94b8e25bc92d7013aae3f6425a93b2b8af0797e47d4a658a7
|
4
|
+
data.tar.gz: bc67628100b42657aa0bfe5fa380051a46e17e2a20474c8bd0534afd11eeaf81
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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.
|
11
|
-
image: ruby:2.
|
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.
|
16
|
+
key: ruby:2.6
|
27
17
|
paths:
|
28
18
|
- deps
|
29
19
|
|
30
|
-
test:2.
|
31
|
-
image: ruby:2.
|
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.
|
26
|
+
key: ruby:2.7
|
37
27
|
paths:
|
38
28
|
- deps
|
39
29
|
|
40
|
-
test:
|
41
|
-
image: ruby:
|
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:
|
36
|
+
key: ruby:3.0
|
47
37
|
paths:
|
48
38
|
- deps
|
49
39
|
|
50
|
-
test:
|
51
|
-
image: ruby:
|
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:
|
46
|
+
key: ruby:3.1
|
57
47
|
paths:
|
58
48
|
- deps
|
59
49
|
|
60
|
-
test:3.
|
61
|
-
image: ruby:3.
|
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.
|
56
|
+
key: ruby:3.2
|
67
57
|
paths:
|
68
58
|
- deps
|
data/CHANGELOG.markdown
CHANGED
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.
|
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
|
@@ -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}"
|
data/lib/epub/maker/version.rb
CHANGED
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.
|
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:
|
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.
|
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.
|
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:
|
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.
|
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:
|