rdf-microdata 2.1.0 → 2.2.0

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
  SHA1:
3
- metadata.gz: 0ba221943521987728e95b8f18a19c20451e5077
4
- data.tar.gz: d8a00da347f6a0418312a593179da5223fc6677a
3
+ metadata.gz: 8f6e4d7ffb9a9bf707600045b9c7cba536316b67
4
+ data.tar.gz: 6b9aadb82f70285d2b96b954945f199e835352c0
5
5
  SHA512:
6
- metadata.gz: 3ddf521a191536815305f0e9ea69f87840a0ca80d5b930022bb7e2e33bed027b760f31c9fca66f5e5591e3c5d6b198ee1e2d506ee05d43c6c18d70bf91bc2345
7
- data.tar.gz: a9e390502b0b34a05e8eab479856591098bbf50eb74560268f86bc24d7eb5de38768c014fe2407c2494008528008c585cb2b1023f3758cbee00813ed98c4ef28
6
+ metadata.gz: c6c2bfcab6a5b88c714ac95d2aa7ff8f818dd403e1874731702b5e912d1ffc66aad517bb3099cdb47bcaa1c318fd4e83ca672f7629ab8b9f87014fd9231b19e7
7
+ data.tar.gz: e669901363b4245751b92b4a62201619ad08a8f80e9b5c1c1c6eb19dced6c824738037246cf4629a26304c2f9fa1fcd345c3ef1d5cd2662aa7fc9b5be400db3c
data/README.md CHANGED
@@ -13,6 +13,7 @@ RDF::Microdata parses [Microdata][] into statements or triples using the rules d
13
13
 
14
14
  * Microdata parser.
15
15
  * Uses Nokogiri for parsing HTML
16
+ * If available, uses [Nokogumbo][] gem for are pure-HTML5 parser with better error detection.
16
17
 
17
18
  Install with 'gem install rdf-microdata'
18
19
 
@@ -47,7 +48,8 @@ If the `RDFa` parser is available, {RDF::Microdata::Format} will not assert cont
47
48
  * [RDF.rb](http://rubygems.org/gems/rdf) (>= 2.0)
48
49
  * [RDF::XSD](http://rubygems.org/gems/rdf-xsd) (>= 2.0)
49
50
  * [HTMLEntities](https://rubygems.org/gems/htmlentities) ('>= 4.3.0')
50
- * Soft dependency on [Nokogiri](http://rubygems.org/gems/nokogiri) (>= 1.6.6)
51
+ * [Nokogiri](http://rubygems.org/gems/nokogiri) (>= 1.7.1)
52
+ * Soft dependency on [Nokogumbo](https://github.com/rubys/nokogumbo) (>= 1.4.10)
51
53
 
52
54
  ## Documentation
53
55
  Full documentation available on [Rubydoc.info][Microdata doc]
@@ -103,3 +105,4 @@ see <http://unlicense.org/> or the accompanying {file:UNLICENSE} file.
103
105
  [Microdata]: http://dev.w3.org/html5/md/Overview.html "HTML Microdata"
104
106
  [Microdata RDF]: http://dvcs.w3.org/hg/htmldata/raw-file/default/microdata-rdf/index.html "Microdata to RDF"
105
107
  [Microdata doc]: http://rubydoc.info/github/ruby-rdf/rdf-microdata/frames
108
+ [Nokogumbo]: https://github.com/rubys/nokogumbo/#readme
data/VERSION CHANGED
@@ -1 +1 @@
1
- 2.1.0
1
+ 2.2.0
@@ -185,7 +185,13 @@ module RDF::Microdata
185
185
  options[:encoding] ||= 'utf-8'
186
186
  options[:encoding] = options[:encoding].to_s if options[:encoding]
187
187
 
188
- ::Nokogiri::HTML.parse(input, base_uri.to_s, options[:encoding])
188
+ begin
189
+ require 'nokogumbo' unless defined?(::Nokogumbo)
190
+ input = input.read if input.respond_to?(:read)
191
+ ::Nokogiri::HTML5(input.force_encoding(options[:encoding]))
192
+ rescue LoadError
193
+ ::Nokogiri::HTML.parse(input, base_uri.to_s, options[:encoding])
194
+ end
189
195
  end
190
196
  end
191
197
 
@@ -200,8 +206,7 @@ module RDF::Microdata
200
206
  ##
201
207
  # Document errors
202
208
  def doc_errors
203
- # FIXME: Nokogiri version 1.5.5 thinks many HTML5 elements are invalid
204
- @doc.errors.reject {|e| e.to_s =~ /(Tag (?:article|aside|audio|canvas|command|datalist|details|embed|figcaption|figure|footer|header|hgroup|keygen|main|mark|meter|nav|output|progress|ruby|section|time|video|wbr) invalid|Missing attribute name)/}
209
+ @doc.errors.reject {|e| e.to_s =~ /The doctype must be the first token in the document/}
205
210
  end
206
211
 
207
212
  ##
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rdf-microdata
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.0
4
+ version: 2.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gregg
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2016-12-31 00:00:00.000000000 Z
12
+ date: 2017-05-10 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rdf
@@ -17,28 +17,28 @@ dependencies:
17
17
  requirements:
18
18
  - - "~>"
19
19
  - !ruby/object:Gem::Version
20
- version: '2.0'
20
+ version: '2.2'
21
21
  type: :runtime
22
22
  prerelease: false
23
23
  version_requirements: !ruby/object:Gem::Requirement
24
24
  requirements:
25
25
  - - "~>"
26
26
  - !ruby/object:Gem::Version
27
- version: '2.0'
27
+ version: '2.2'
28
28
  - !ruby/object:Gem::Dependency
29
29
  name: rdf-xsd
30
30
  requirement: !ruby/object:Gem::Requirement
31
31
  requirements:
32
32
  - - "~>"
33
33
  - !ruby/object:Gem::Version
34
- version: '2.0'
34
+ version: '2.1'
35
35
  type: :runtime
36
36
  prerelease: false
37
37
  version_requirements: !ruby/object:Gem::Requirement
38
38
  requirements:
39
39
  - - "~>"
40
40
  - !ruby/object:Gem::Version
41
- version: '2.0'
41
+ version: '2.1'
42
42
  - !ruby/object:Gem::Dependency
43
43
  name: htmlentities
44
44
  requirement: !ruby/object:Gem::Requirement
@@ -59,14 +59,14 @@ dependencies:
59
59
  requirements:
60
60
  - - "~>"
61
61
  - !ruby/object:Gem::Version
62
- version: '1.6'
62
+ version: '1.7'
63
63
  type: :runtime
64
64
  prerelease: false
65
65
  version_requirements: !ruby/object:Gem::Requirement
66
66
  requirements:
67
67
  - - "~>"
68
68
  - !ruby/object:Gem::Version
69
- version: '1.6'
69
+ version: '1.7'
70
70
  - !ruby/object:Gem::Dependency
71
71
  name: equivalent-xml
72
72
  requirement: !ruby/object:Gem::Requirement
@@ -87,70 +87,28 @@ dependencies:
87
87
  requirements:
88
88
  - - "~>"
89
89
  - !ruby/object:Gem::Version
90
- version: '0.8'
90
+ version: '0.9'
91
91
  type: :development
92
92
  prerelease: false
93
93
  version_requirements: !ruby/object:Gem::Requirement
94
94
  requirements:
95
95
  - - "~>"
96
96
  - !ruby/object:Gem::Version
97
- version: '0.8'
98
- - !ruby/object:Gem::Dependency
99
- name: rack-cache
100
- requirement: !ruby/object:Gem::Requirement
101
- requirements:
102
- - - "~>"
103
- - !ruby/object:Gem::Version
104
- version: '1.6'
105
- type: :development
106
- prerelease: false
107
- version_requirements: !ruby/object:Gem::Requirement
108
- requirements:
109
- - - "~>"
110
- - !ruby/object:Gem::Version
111
- version: '1.6'
112
- - !ruby/object:Gem::Dependency
113
- name: rest-client
114
- requirement: !ruby/object:Gem::Requirement
115
- requirements:
116
- - - "~>"
117
- - !ruby/object:Gem::Version
118
- version: '1.8'
119
- type: :development
120
- prerelease: false
121
- version_requirements: !ruby/object:Gem::Requirement
122
- requirements:
123
- - - "~>"
124
- - !ruby/object:Gem::Version
125
- version: '1.8'
126
- - !ruby/object:Gem::Dependency
127
- name: rest-client-components
128
- requirement: !ruby/object:Gem::Requirement
129
- requirements:
130
- - - "~>"
131
- - !ruby/object:Gem::Version
132
- version: '1.4'
133
- type: :development
134
- prerelease: false
135
- version_requirements: !ruby/object:Gem::Requirement
136
- requirements:
137
- - - "~>"
138
- - !ruby/object:Gem::Version
139
- version: '1.4'
97
+ version: '0.9'
140
98
  - !ruby/object:Gem::Dependency
141
99
  name: rspec
142
100
  requirement: !ruby/object:Gem::Requirement
143
101
  requirements:
144
102
  - - "~>"
145
103
  - !ruby/object:Gem::Version
146
- version: '3.4'
104
+ version: '3.5'
147
105
  type: :development
148
106
  prerelease: false
149
107
  version_requirements: !ruby/object:Gem::Requirement
150
108
  requirements:
151
109
  - - "~>"
152
110
  - !ruby/object:Gem::Version
153
- version: '3.4'
111
+ version: '3.5'
154
112
  - !ruby/object:Gem::Dependency
155
113
  name: rspec-its
156
114
  requirement: !ruby/object:Gem::Requirement
@@ -171,56 +129,56 @@ dependencies:
171
129
  requirements:
172
130
  - - "~>"
173
131
  - !ruby/object:Gem::Version
174
- version: '2.0'
132
+ version: '2.2'
175
133
  type: :development
176
134
  prerelease: false
177
135
  version_requirements: !ruby/object:Gem::Requirement
178
136
  requirements:
179
137
  - - "~>"
180
138
  - !ruby/object:Gem::Version
181
- version: '2.0'
139
+ version: '2.2'
182
140
  - !ruby/object:Gem::Dependency
183
141
  name: rdf-rdfa
184
142
  requirement: !ruby/object:Gem::Requirement
185
143
  requirements:
186
144
  - - "~>"
187
145
  - !ruby/object:Gem::Version
188
- version: '2.0'
146
+ version: '2.2'
189
147
  type: :development
190
148
  prerelease: false
191
149
  version_requirements: !ruby/object:Gem::Requirement
192
150
  requirements:
193
151
  - - "~>"
194
152
  - !ruby/object:Gem::Version
195
- version: '2.0'
153
+ version: '2.2'
196
154
  - !ruby/object:Gem::Dependency
197
155
  name: rdf-turtle
198
156
  requirement: !ruby/object:Gem::Requirement
199
157
  requirements:
200
158
  - - "~>"
201
159
  - !ruby/object:Gem::Version
202
- version: '2.0'
160
+ version: '2.2'
203
161
  type: :development
204
162
  prerelease: false
205
163
  version_requirements: !ruby/object:Gem::Requirement
206
164
  requirements:
207
165
  - - "~>"
208
166
  - !ruby/object:Gem::Version
209
- version: '2.0'
167
+ version: '2.2'
210
168
  - !ruby/object:Gem::Dependency
211
169
  name: rdf-isomorphic
212
170
  requirement: !ruby/object:Gem::Requirement
213
171
  requirements:
214
172
  - - "~>"
215
173
  - !ruby/object:Gem::Version
216
- version: '2.0'
174
+ version: '2.2'
217
175
  type: :development
218
176
  prerelease: false
219
177
  version_requirements: !ruby/object:Gem::Requirement
220
178
  requirements:
221
179
  - - "~>"
222
180
  - !ruby/object:Gem::Version
223
- version: '2.0'
181
+ version: '2.2'
224
182
  description: Reads HTML Microdata as RDF.
225
183
  email: public-rdf-ruby@w3.org
226
184
  executables: []
@@ -262,7 +220,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
262
220
  version: '0'
263
221
  requirements: []
264
222
  rubyforge_project: rdf-microdata
265
- rubygems_version: 2.6.8
223
+ rubygems_version: 2.6.11
266
224
  signing_key:
267
225
  specification_version: 4
268
226
  summary: Microdata reader for Ruby.