epubmeta 0.5.0 → 0.6.2

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: 1011bfe3193d925bd9c24d7581533a9517be04f3daae0a045b94a4fd88d87887
4
- data.tar.gz: 8beea6a90e8502b7a7adbedd6fc52e2a02a22723569c311417c56584d4d41a9c
3
+ metadata.gz: 01d97aff642d69f3e17351c6777073a8129467169cebb2fa16b749d106aded05
4
+ data.tar.gz: 07e34324f0208be8532dcebea818f62c57d6f8affa75d20c2eb54d7daa32d372
5
5
  SHA512:
6
- metadata.gz: a47ea2db7f32ec6315a7c8fe5aeeecc56d19a3feb666c6b947214fc46031e1bf9face4c98f7631324be9c537de482dce08afcb58550743caed41a09e4578a837
7
- data.tar.gz: 1414699d02f38d19332d81c6682efff214f963cf6dd61a50aba0a27320f49f68a1e0489214fe2238e10c33ba7af8ca69e542303deb3d282aab6d8d9aebc7766d
6
+ metadata.gz: c05f91dec38c79c93041dfc47be55d19baa9a1644ab89d32cc0b1929736c38822385cf21a65b093807e7f89dd67ed961c83738ede492d4a7f81588333b1af353
7
+ data.tar.gz: 16d3405f68eeac330470b3072d8907633bc8786e76d4524d333d5c8ad4eb474fb5c73ed3fda40b5d8b6ab60ce0bf7eb6acc270f0cf22af98fb6ec912f16b23d1
data/README.md CHANGED
@@ -14,6 +14,39 @@ Which returns a `EPUBMeta::Models::Book` instance, please refer to the [API docu
14
14
 
15
15
  ## Changelog
16
16
 
17
+ **0.6.2** *June 2, 2021*
18
+
19
+ * Extract the container parser logic to make it easier to test.
20
+ * Bump nokogiri to v1.11.4 to incorporate several security issues.
21
+
22
+ **0.6.1** *May 11, 2021*
23
+
24
+ * Update nokogiri dependency to `>= 1.11.0` to mitigate CVE-2020-26247
25
+
26
+ **0.6.0** *May 06, 2020*
27
+
28
+ * Support reading rendition property. Accessible via `Book.fixed_layout?`
29
+ * Update nokogiri dependency to `>= 1.10.8` to mitigate CVE-2020-7595
30
+
31
+ **0.5.4** *Februry 04, 2020*
32
+
33
+ * Update rubyzip dependency to `~> 1.3.0` to mitigate CVE-2019-16892
34
+
35
+ **0.5.3** *November 26, 2019*
36
+
37
+ * Update nokogiri dependency to `>= 1.10.4` to mitigate CVE-2019-5477
38
+ * Update yard dependency to `>= 0.9.20` to mitigate CVE-2019-1020001
39
+
40
+ **0.5.2** *October 09, 2018*
41
+
42
+ * Remove `redcarpet` dependency
43
+ * Update gemspec to use correct runtime and development dependency syntax
44
+
45
+ **0.5.1** *October 09, 2018*
46
+
47
+ * Update rubyzip dependency due to security vulnerability
48
+ * Fix gemspec dependencies to use up-to-date versions (as found in the Gemfile)
49
+
17
50
  **0.5.0** *August 10, 2018*
18
51
 
19
52
  * Convert module name EPUBMeta
@@ -35,6 +68,6 @@ Which returns a `EPUBMeta::Models::Book` instance, please refer to the [API docu
35
68
 
36
69
  ## Copyright
37
70
 
38
- Copyright (c) 2018 Andrew Roberts.
71
+ Copyright (c) 2018--2020 Andrew Roberts.
39
72
  Copyright (c) 2012--2014 Christof Dorner.
40
- See LICENSE.txt for further details.
73
+ See LICENSE.txt for further details.
@@ -39,6 +39,12 @@ module EPUBMeta
39
39
  attr_accessor :identifiers
40
40
  def identifiers; @identifiers || []; end
41
41
 
42
+ # Fixed layout
43
+ # @return [Boolean]
44
+ attr_accessor :fixed_layout
45
+ def fixed_layout; @fixed_layout || false; end
46
+ alias :fixed_layout? :fixed_layout
47
+
42
48
  # Source ({http://idpf.org/epub/20/spec/OPF_2.0.1_draft.htm#Section2.2.11 EPUB2 reference})
43
49
  # @return [String]
44
50
  attr_accessor :source
@@ -92,6 +98,13 @@ module EPUBMeta
92
98
  self.rights = metadata.xpath('.//rights').first.content rescue nil
93
99
  self.drm_protected = parser.drm_protected?
94
100
  self.cover = EPUBMeta::Models::Cover.new(parser)
101
+
102
+ rendition_element = metadata.xpath(".//meta[@property='rendition:layout']").first
103
+ if rendition_element.nil?
104
+ self.fixed_layout = false
105
+ else
106
+ self.fixed_layout = rendition_element.content == "pre-paginated"
107
+ end
95
108
  end
96
109
 
97
110
 
@@ -111,6 +124,7 @@ module EPUBMeta
111
124
  :languages => @languages,
112
125
  :rights => @rights,
113
126
  :drm_protected => @drm_protected,
127
+ :fixed_layout => @fixed_layout,
114
128
  :cover => @cover,
115
129
  }
116
130
  end
@@ -25,10 +25,12 @@ module EPUBMeta
25
25
  end
26
26
 
27
27
  def metadata_path
28
- @metadata_path ||= begin
29
- root_document.remove_namespaces!
30
- root_document.css('container rootfiles rootfile:first-child').attribute('full-path').content
31
- end
28
+ @metadata_path ||= get_full_path(root_document)
29
+ end
30
+
31
+ def get_full_path(container_root_doc)
32
+ container_root_doc.remove_namespaces!
33
+ container_root_doc.css('container rootfiles rootfile:first-child').attribute('full-path').content
32
34
  end
33
35
 
34
36
  private
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: epubmeta
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.6.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Roberts
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-08-10 00:00:00.000000000 Z
11
+ date: 2021-05-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rubyzip
@@ -16,33 +16,48 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '1.0'
19
+ version: 1.2.2
20
+ - - "<"
21
+ - !ruby/object:Gem::Version
22
+ version: '3.0'
20
23
  type: :runtime
21
24
  prerelease: false
22
25
  version_requirements: !ruby/object:Gem::Requirement
23
26
  requirements:
24
27
  - - ">="
25
28
  - !ruby/object:Gem::Version
26
- version: '1.0'
29
+ version: 1.2.2
30
+ - - "<"
31
+ - !ruby/object:Gem::Version
32
+ version: '3.0'
27
33
  - !ruby/object:Gem::Dependency
28
34
  name: nokogiri
29
35
  requirement: !ruby/object:Gem::Requirement
30
36
  requirements:
37
+ - - "~>"
38
+ - !ruby/object:Gem::Version
39
+ version: '1.11'
31
40
  - - ">="
32
41
  - !ruby/object:Gem::Version
33
- version: 1.4.2
42
+ version: 1.11.4
34
43
  type: :runtime
35
44
  prerelease: false
36
45
  version_requirements: !ruby/object:Gem::Requirement
37
46
  requirements:
47
+ - - "~>"
48
+ - !ruby/object:Gem::Version
49
+ version: '1.11'
38
50
  - - ">="
39
51
  - !ruby/object:Gem::Version
40
- version: 1.4.2
52
+ version: 1.11.4
41
53
  - !ruby/object:Gem::Dependency
42
54
  name: rspec
43
55
  requirement: !ruby/object:Gem::Requirement
44
56
  requirements:
45
57
  - - "~>"
58
+ - !ruby/object:Gem::Version
59
+ version: '2.14'
60
+ - - ">="
46
61
  - !ruby/object:Gem::Version
47
62
  version: 2.14.1
48
63
  type: :development
@@ -50,6 +65,9 @@ dependencies:
50
65
  version_requirements: !ruby/object:Gem::Requirement
51
66
  requirements:
52
67
  - - "~>"
68
+ - !ruby/object:Gem::Version
69
+ version: '2.14'
70
+ - - ">="
53
71
  - !ruby/object:Gem::Version
54
72
  version: 2.14.1
55
73
  - !ruby/object:Gem::Dependency
@@ -58,42 +76,14 @@ dependencies:
58
76
  requirements:
59
77
  - - "~>"
60
78
  - !ruby/object:Gem::Version
61
- version: 0.8.7
79
+ version: 0.9.20
62
80
  type: :development
63
81
  prerelease: false
64
82
  version_requirements: !ruby/object:Gem::Requirement
65
83
  requirements:
66
84
  - - "~>"
67
85
  - !ruby/object:Gem::Version
68
- version: 0.8.7
69
- - !ruby/object:Gem::Dependency
70
- name: jeweler
71
- requirement: !ruby/object:Gem::Requirement
72
- requirements:
73
- - - "~>"
74
- - !ruby/object:Gem::Version
75
- version: 2.0.1
76
- type: :development
77
- prerelease: false
78
- version_requirements: !ruby/object:Gem::Requirement
79
- requirements:
80
- - - "~>"
81
- - !ruby/object:Gem::Version
82
- version: 2.0.1
83
- - !ruby/object:Gem::Dependency
84
- name: redcarpet
85
- requirement: !ruby/object:Gem::Requirement
86
- requirements:
87
- - - ">="
88
- - !ruby/object:Gem::Version
89
- version: '0'
90
- type: :development
91
- prerelease: false
92
- version_requirements: !ruby/object:Gem::Requirement
93
- requirements:
94
- - - ">="
95
- - !ruby/object:Gem::Version
96
- version: '0'
86
+ version: 0.9.20
97
87
  description: Supports EPUB2 and EPUB3 formats.
98
88
  email: andy.roberts.uk@gmail.com
99
89
  executables: []
@@ -116,7 +106,7 @@ homepage: https://github.com/andyroberts/epubmeta
116
106
  licenses:
117
107
  - MIT
118
108
  metadata: {}
119
- post_install_message:
109
+ post_install_message:
120
110
  rdoc_options: []
121
111
  require_paths:
122
112
  - lib
@@ -124,16 +114,16 @@ required_ruby_version: !ruby/object:Gem::Requirement
124
114
  requirements:
125
115
  - - ">="
126
116
  - !ruby/object:Gem::Version
127
- version: '0'
117
+ version: 2.5.0
128
118
  required_rubygems_version: !ruby/object:Gem::Requirement
129
119
  requirements:
130
120
  - - ">="
131
121
  - !ruby/object:Gem::Version
132
122
  version: '0'
133
123
  requirements: []
134
- rubyforge_project:
135
- rubygems_version: 2.7.5
136
- signing_key:
124
+ rubyforge_project:
125
+ rubygems_version: 2.7.10
126
+ signing_key:
137
127
  specification_version: 4
138
128
  summary: Extracts metadata information from EPUB files
139
129
  test_files: []