epub-parser 0.4.7 → 0.4.8

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: 5267c2c665a4fd1fe119e59ed905fdafee49e4f68f063750d80260424ef26ccc
4
- data.tar.gz: 3d79ee849a6a7da2e0ac424e6aa5ef272beda4544af29e909f432fabb0f7d402
3
+ metadata.gz: 33ec17f68d55ead850d39f0df0ec73f0d9cda4901cdc4ee83612ebd95c0b1927
4
+ data.tar.gz: 580741918f923319e665203b8334725e48afb1c69bdb2fe7ca412cefed3477d6
5
5
  SHA512:
6
- metadata.gz: eda5efdf8d48603ffe69b135011bbd8156d1dff9c78794971d2250162069d5e1b18f0ff579d7324511656df26e0202302c1ce991421eee0c286ad8c6104b6f92
7
- data.tar.gz: 7f73b72cb0b7b7fc77c783ce643bd58fc99cf2644497c8eced82f002c412825025a1515a923f6b8a7bd7b7a4d76bc6335c5d520fa0176313cef9daa61529d400
6
+ metadata.gz: 7683c526bc654bf55556db4d2be9efeccebc25ad29524ab14f264c85513649c0741b6b281eaa100e0cdbf93706ab1115ffca4522408299964cf1ef36136bc3be
7
+ data.tar.gz: 7522670e7f7126a33a1ea19a89577382b5f25d0555974cf1b014184d30a44be5a475467b95772f2d5386ac76f2ab4fc6720cea91f68c7ae07e562a1c3229e186
data/.gitlab-ci.yml CHANGED
@@ -5,66 +5,53 @@ before_script:
5
5
  - bundle install --jobs=$(nproc) --path=deps "${FLAGS[@]}"
6
6
  - bundle clean
7
7
 
8
- test:2.3:
9
- image: ruby:2.3
8
+ test:2.6:
9
+ image: ruby:2.6
10
10
  script: bundle exec rake test XML_BACKEND=REXML 2>/dev/null && bundle exec rake test XML_BACKEND=Oga 2>/dev/null && bundle exec rake test XML_BACKEND=Nokogiri 2>/dev/null
11
11
  except:
12
12
  - tags
13
13
  cache:
14
- key: ruby:2.3
14
+ key: ruby:2.6
15
15
  paths:
16
16
  - deps
17
17
 
18
- test:2.4:
19
- image: ruby:2.4
18
+ test:2.7:
19
+ image: ruby:2.7
20
20
  script: bundle exec rake test XML_BACKEND=REXML 2>/dev/null && bundle exec rake test XML_BACKEND=Oga 2>/dev/null && bundle exec rake test XML_BACKEND=Nokogiri 2>/dev/null
21
21
  except:
22
22
  - tags
23
23
  cache:
24
- key: ruby:2.4
25
- paths:
26
- - deps
27
-
28
- test:2.5:
29
- image: ruby:2.5
30
- script: bundle exec rake test XML_BACKEND=REXML 2>/dev/null && bundle exec rake test XML_BACKEND=Oga 2>/dev/null && bundle exec rake test XML_BACKEND=Nokogiri 2>/dev/null
31
- except:
32
- - tags
33
- artifacts:
34
- paths:
35
- - coverage
36
- cache:
37
- key: ruby:2.5
24
+ key: ruby:2.7
38
25
  paths:
39
26
  - deps
40
27
 
41
- test:2.6:
42
- image: ruby:2.6
28
+ test:3.0:
29
+ image: ruby:3.0
43
30
  script: bundle exec rake test XML_BACKEND=REXML 2>/dev/null && bundle exec rake test XML_BACKEND=Oga 2>/dev/null && bundle exec rake test XML_BACKEND=Nokogiri 2>/dev/null
44
31
  except:
45
32
  - tags
46
33
  cache:
47
- key: ruby:2.6
34
+ key: ruby:3.0
48
35
  paths:
49
36
  - deps
50
37
 
51
- test:2.7:
52
- image: ruby:2.7
38
+ test:3.1:
39
+ image: ruby:3.1
53
40
  script: bundle exec rake test XML_BACKEND=REXML 2>/dev/null && bundle exec rake test XML_BACKEND=Oga 2>/dev/null && bundle exec rake test XML_BACKEND=Nokogiri 2>/dev/null
54
41
  except:
55
42
  - tags
56
43
  cache:
57
- key: ruby:2.7
44
+ key: ruby:3.1
58
45
  paths:
59
46
  - deps
60
47
 
61
- test:3.0:
62
- image: ruby:3.0-rc
48
+ test:3.2:
49
+ image: ruby:3.2
63
50
  script: bundle exec rake test XML_BACKEND=REXML 2>/dev/null && bundle exec rake test XML_BACKEND=Oga 2>/dev/null && bundle exec rake test XML_BACKEND=Nokogiri 2>/dev/null
64
51
  except:
65
52
  - tags
66
53
  cache:
67
- key: ruby:3.0
54
+ key: ruby:3.2
68
55
  paths:
69
56
  - deps
70
57
 
data/CHANGELOG.adoc CHANGED
@@ -1,5 +1,9 @@
1
1
  = CHANGELOG
2
2
 
3
+ == 0.4.8
4
+
5
+ * Add Rubyzip adapter
6
+
3
7
  == 0.4.7
4
8
 
5
9
  * [BUG FIX]Fix a bug that epubinfo doesn't handle navigation properly
data/README.adoc CHANGED
@@ -176,6 +176,10 @@ If you find other gems, please tell me or request a pull request.
176
176
 
177
177
  == RECENT CHANGES
178
178
 
179
+ === 0.4.8
180
+
181
+ * Add Rubyzip adapter
182
+
179
183
  === 0.4.7
180
184
 
181
185
  * [BUG FIX]Fix a bug that epubinfo doesn't handle navigation properly
@@ -186,26 +190,6 @@ If you find other gems, please tell me or request a pull request.
186
190
  * Tiny modifcation on Zip archive manipulation
187
191
  * Remove version specification from Nokogiri to migrate to Ruby 3.1
188
192
 
189
- === 0.4.5
190
-
191
- * [BUG FIX]Handle the case EPUB path is a Pathname
192
-
193
- === 0.4.4
194
-
195
- * [BUG FIX]Fix navigation type check bug
196
- * Add feature to show navigations to `epubinfo` command-line tool
197
-
198
- === 0.4.3
199
-
200
- * Encode file name passed from file system on Unix
201
-
202
- === 0.4.2
203
-
204
- * [BUG FIX]Fix a bug that epub-cover refers out of scope variable
205
-
206
- * [BUG FIX]Fix a bug that `epubinfo` command with `--words` or `--chars` option causes load error if there is not Nokogiri in environment
207
- * [BUG FIX]Fix a bug that REXML::Element#content ignores descendant nodes
208
-
209
193
  See {file:CHANGELOG.adoc} for older changelogs and details.
210
194
 
211
195
  == TODOS
data/epub-parser.gemspec CHANGED
@@ -28,6 +28,7 @@ Gem::Specification.new do |s|
28
28
  s.add_development_dependency 'rake'
29
29
  s.add_development_dependency 'rubygems-tasks'
30
30
  s.add_development_dependency 'zipruby' unless RUBY_PLATFORM.match /mingw|arm64-darwin/
31
+ s.add_development_dependency 'rubyzip', '>= 3.0.0.alpha'
31
32
  s.add_development_dependency 'pry'
32
33
  s.add_development_dependency 'pry-doc'
33
34
  s.add_development_dependency 'test-unit'
@@ -0,0 +1,38 @@
1
+ require "zip"
2
+
3
+ module EPUB
4
+ class OCF
5
+ class PhysicalContainer
6
+ class Rubyzip < self
7
+ def open
8
+ orig_encoding = Zip.force_entry_names_encoding
9
+ begin
10
+ Zip.force_entry_names_encoding = "UTF-8"
11
+ Zip::File.open @container_path do |archive|
12
+ @monitor.synchronize do
13
+ @archive = archive
14
+ begin
15
+ yield self
16
+ ensure
17
+ @archive = nil
18
+ end
19
+ end
20
+ end
21
+ ensure
22
+ Zip.force_entry_names_encoding = orig_encoding
23
+ end
24
+ end
25
+
26
+ def read(path_name)
27
+ if @archive
28
+ @archive.read(path_name)
29
+ else
30
+ open {|container| container.read(path_name)}
31
+ end
32
+ rescue Errno::ENOENT => error
33
+ raise NoEntry.from_error(error)
34
+ end
35
+ end
36
+ end
37
+ end
38
+ end
@@ -1,5 +1,5 @@
1
1
  module EPUB
2
2
  class Parser
3
- VERSION = "0.4.7"
3
+ VERSION = "0.4.8"
4
4
  end
5
5
  end
@@ -86,6 +86,17 @@ class TestOCFPhysicalContainer < Test::Unit::TestCase
86
86
  end
87
87
  end
88
88
 
89
+ require "epub/ocf/physical_container/rubyzip"
90
+ class TestRubyzip < self
91
+ include ConcreteContainer
92
+
93
+ def setup
94
+ super
95
+ @class = EPUB::OCF::PhysicalContainer::Rubyzip
96
+ @container = @class.new(@container_path)
97
+ end
98
+ end
99
+
89
100
  class TestUnpackedURI < self
90
101
  def setup
91
102
  super
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: epub-parser
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.7
4
+ version: 0.4.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - KITAITI Makoto
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-11-19 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: rake
@@ -38,6 +38,20 @@ dependencies:
38
38
  - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rubyzip
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: 3.0.0.alpha
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: 3.0.0.alpha
41
55
  - !ruby/object:Gem::Dependency
42
56
  name: pry
43
57
  requirement: !ruby/object:Gem::Requirement
@@ -378,6 +392,7 @@ files:
378
392
  - lib/epub/ocf/metadata.rb
379
393
  - lib/epub/ocf/physical_container.rb
380
394
  - lib/epub/ocf/physical_container/archive_zip.rb
395
+ - lib/epub/ocf/physical_container/rubyzip.rb
381
396
  - lib/epub/ocf/physical_container/unpacked_directory.rb
382
397
  - lib/epub/ocf/physical_container/unpacked_uri.rb
383
398
  - lib/epub/ocf/physical_container/zipruby.rb
@@ -460,7 +475,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
460
475
  - !ruby/object:Gem::Version
461
476
  version: '0'
462
477
  requirements: []
463
- rubygems_version: 3.4.21
478
+ rubygems_version: 3.4.22
464
479
  signing_key:
465
480
  specification_version: 4
466
481
  summary: EPUB 3 Parser