rdf-rdfa 2.1.1 → 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: f187314f46c58533e2e502410bcb4fc619c299cc
4
- data.tar.gz: a6db308c5c755593287d7be19657d484e94e9f36
3
+ metadata.gz: efe1e914ab5f68689c7d747eaedbeac80e2284d9
4
+ data.tar.gz: dd152d38c8f15bb6844aac06008256502be2a840
5
5
  SHA512:
6
- metadata.gz: 62f0033e9eb902cb3784ef015e1b100fe5bb8c257efeb39345a73ed1f680dc8e61035d391960ff3c6121dcb08847bf09974644f4435a0e3b39bdd6d901c9ada9
7
- data.tar.gz: c3961199f1ea7153257c17368e3434343975a95f731a4569417244e9dcf4640abf85290191e3230301888d2e29e4eb0a147837665e5f8787c4907375542a04da
6
+ metadata.gz: 9ce2b653872a4d6e2d9f2e3fd8d02de3e6b596eba1faa4407ecc8199be14db84525f0766b1477f41b41813137434c04084e727c6d856e227d662a537dbfd2c8e
7
+ data.tar.gz: 1b4f7148e069c17d1e4169b6ff9e94a685be46df0539b26f5eecc856ce82b9411836b8aff183b6dc8f34f2a3f5ae34344e6055c3888c204e6c658509631a3b7c
data/README.md CHANGED
@@ -16,14 +16,15 @@ RDF::RDFa parses [RDFa][RDFa 1.1 Core] into statements or triples.
16
16
  * Fully compliant RDFa 1.1 parser.
17
17
  * Template-based Writer to generate XHTML+RDFa.
18
18
  * Writer uses user-replacable [Haml][Haml]-based templates to generate RDFa.
19
- * If available, uses Nokogiri for parsing HTML/SVG, falls back to REXML otherwise
19
+ * If available, uses [Nokogiri][] for parsing HTML/SVG, falls back to REXML otherwise. For HTML5, include the [Nokogumbo][] gem for are pure-HTML5 parser with better error detection.
20
20
 
21
21
  Install with `gem install rdf-rdfa`
22
22
 
23
23
  ### Pure Ruby
24
- In order to run as pure ruby (not requiring any C modules), this gem does not directly depend on [Nokogiri](http://www.nokogiri.org)
25
- and falls back to using REXML. As REXML is not really an HTML parsing library, the results will only be useful if the HTML is well-formed.
26
- For best performance, install the Nokogiri gem as well.
24
+ In order to run as pure ruby (not requiring any C modules), this gem does not directly depend on [Nokogiri][] or [Nokogumbo][]
25
+ and falls back to using REXML. [Nokogumbo][] uses the [Gumbo pure-C HTML5 parser](https://github.com/google/gumbo-parser#readme).
26
+ As REXML is not really an HTML parsing library, the results will only be useful if the HTML is well-formed.
27
+ For best performance, install the [Nokogiri][] and [Nokogumbo][] gems as well.
27
28
 
28
29
  ### Important changes from previous versions
29
30
  RDFa is an evolving standard, undergoing some substantial recent changes partly due to perceived competition
@@ -396,11 +397,12 @@ The template hash defines four Haml templates:
396
397
  }
397
398
 
398
399
  ## Dependencies
399
- * [Ruby](http://ruby-lang.org/) (>= 2.0)
400
- * [RDF.rb](http://rubygems.org/gems/rdf) (>= 2.0)
400
+ * [Ruby](http://ruby-lang.org/) (>= 2.2)
401
+ * [RDF.rb](http://rubygems.org/gems/rdf) (>= 2.2)
401
402
  * [Haml](https://rubygems.org/gems/haml) (>= 4.0)
402
403
  * [HTMLEntities](https://rubygems.org/gems/htmlentities) (>= 4.3.1)
403
- * Soft dependency on [Nokogiri](http://rubygems.org/gems/nokogiri) (>= 1.6.8)
404
+ * Soft dependency on [Nokogiri](http://rubygems.org/gems/nokogiri) (>= 1.7.1)
405
+ * Soft dependency on [Nokogumbo](https://github.com/rubys/nokogumbo) (>= 1.4.10)
404
406
 
405
407
  ## Documentation
406
408
  Full documentation available on [Rubydoc.info][RDFa doc]
@@ -484,4 +486,5 @@ see <http://unlicense.org/> or the accompanying [UNLICENSE](UNLICENSE) file.
484
486
  [RDFa doc]: http://rubydoc.info/github/ruby-rdf/rdf-rdfa/frames
485
487
  [Haml]: http://haml-lang.com/
486
488
  [Turtle]: http://www.w3.org/TR/2011/WD-turtle-20110809/
487
- [Backports]: http://rubygems.org/gems/backports
489
+ [Nokogiri]: http://www.nokogiri.org
490
+ [Nokogumbo]: https://github.com/rubys/nokogumbo/#readme
data/VERSION CHANGED
@@ -1 +1 @@
1
- 2.1.1
1
+ 2.2.0
@@ -174,8 +174,16 @@ module RDF::RDFa
174
174
  options[:encoding] = options[:encoding].to_s if options[:encoding]
175
175
 
176
176
  case @host_language
177
- when :html4, :html5
177
+ when :html4
178
178
  ::Nokogiri::HTML.parse(input, base_uri.to_s, options[:encoding])
179
+ when :html5
180
+ begin
181
+ require 'nokogumbo' unless defined?(::Nokogumbo)
182
+ input = input.read if input.respond_to?(:read)
183
+ ::Nokogiri::HTML5(input.force_encoding(options[:encoding]))
184
+ rescue LoadError
185
+ ::Nokogiri::HTML.parse(input, base_uri.to_s, options[:encoding])
186
+ end
179
187
  else
180
188
  ::Nokogiri::XML.parse(input, base_uri.to_s, options[:encoding])
181
189
  end
@@ -281,7 +289,11 @@ module RDF::RDFa
281
289
  def doc_errors
282
290
  # FIXME: Nokogiri version 1.5 thinks many HTML5 elements are invalid, so just ignore all Tag errors.
283
291
  # Nokogumbo might make this simpler
284
- @doc.errors.reject {|e| e.to_s =~ /(?:Tag \w+ invalid)|(?:Missing attribute name)/}
292
+ if @host_language == :html5
293
+ @doc.errors
294
+ else
295
+ @doc.errors.reject {|e| e.to_s =~ /(?:Tag \w+ invalid)|(?:Missing attribute name)/}
296
+ end
285
297
  end
286
298
 
287
299
  ##
@@ -195,13 +195,20 @@ module RDF::RDFa
195
195
  %table.properties
196
196
  - predicates.each do |predicate|
197
197
  != yield(predicate)
198
- - else
198
+ - elsif rel
199
199
  %td{rel: rel, resource: (about || resource), typeof: typeof, inlist: inlist}
200
200
  - if typeof
201
201
  %span.type!= typeof
202
202
  %table.properties
203
203
  - predicates.each do |predicate|
204
204
  != yield(predicate)
205
+ - else
206
+ %div{resource: (about || resource), typeof: typeof, inlist: inlist}
207
+ - if typeof
208
+ %span.type!= typeof
209
+ %table.properties
210
+ - predicates.each do |predicate|
211
+ != yield(predicate)
205
212
  ),
206
213
 
207
214
  # Output for single-valued properties
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rdf-rdfa
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.1
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: 2017-01-24 00:00:00.000000000 Z
12
+ date: 2017-04-16 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rdf
@@ -17,14 +17,14 @@ 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: haml
30
30
  requirement: !ruby/object:Gem::Requirement
@@ -45,28 +45,28 @@ dependencies:
45
45
  requirements:
46
46
  - - "~>"
47
47
  - !ruby/object:Gem::Version
48
- version: '2.0'
48
+ version: '2.1'
49
49
  type: :runtime
50
50
  prerelease: false
51
51
  version_requirements: !ruby/object:Gem::Requirement
52
52
  requirements:
53
53
  - - "~>"
54
54
  - !ruby/object:Gem::Version
55
- version: '2.0'
55
+ version: '2.1'
56
56
  - !ruby/object:Gem::Dependency
57
57
  name: rdf-aggregate-repo
58
58
  requirement: !ruby/object:Gem::Requirement
59
59
  requirements:
60
60
  - - "~>"
61
61
  - !ruby/object:Gem::Version
62
- version: '2.0'
62
+ version: '2.2'
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: '2.0'
69
+ version: '2.2'
70
70
  - !ruby/object:Gem::Dependency
71
71
  name: htmlentities
72
72
  requirement: !ruby/object:Gem::Requirement
@@ -121,14 +121,14 @@ dependencies:
121
121
  requirements:
122
122
  - - "~>"
123
123
  - !ruby/object:Gem::Version
124
- version: '3.4'
124
+ version: '3.5'
125
125
  type: :development
126
126
  prerelease: false
127
127
  version_requirements: !ruby/object:Gem::Requirement
128
128
  requirements:
129
129
  - - "~>"
130
130
  - !ruby/object:Gem::Version
131
- version: '3.4'
131
+ version: '3.5'
132
132
  - !ruby/object:Gem::Dependency
133
133
  name: rspec-its
134
134
  requirement: !ruby/object:Gem::Requirement
@@ -149,42 +149,42 @@ dependencies:
149
149
  requirements:
150
150
  - - "~>"
151
151
  - !ruby/object:Gem::Version
152
- version: '2.0'
152
+ version: '2.2'
153
153
  type: :development
154
154
  prerelease: false
155
155
  version_requirements: !ruby/object:Gem::Requirement
156
156
  requirements:
157
157
  - - "~>"
158
158
  - !ruby/object:Gem::Version
159
- version: '2.0'
159
+ version: '2.2'
160
160
  - !ruby/object:Gem::Dependency
161
161
  name: rdf-tabular
162
162
  requirement: !ruby/object:Gem::Requirement
163
163
  requirements:
164
164
  - - "~>"
165
165
  - !ruby/object:Gem::Version
166
- version: '0.4'
166
+ version: '2.2'
167
167
  type: :development
168
168
  prerelease: false
169
169
  version_requirements: !ruby/object:Gem::Requirement
170
170
  requirements:
171
171
  - - "~>"
172
172
  - !ruby/object:Gem::Version
173
- version: '0.4'
173
+ version: '2.2'
174
174
  - !ruby/object:Gem::Dependency
175
175
  name: rdf-turtle
176
176
  requirement: !ruby/object:Gem::Requirement
177
177
  requirements:
178
178
  - - "~>"
179
179
  - !ruby/object:Gem::Version
180
- version: '2.0'
180
+ version: '2.2'
181
181
  type: :development
182
182
  prerelease: false
183
183
  version_requirements: !ruby/object:Gem::Requirement
184
184
  requirements:
185
185
  - - "~>"
186
186
  - !ruby/object:Gem::Version
187
- version: '2.0'
187
+ version: '2.2'
188
188
  - !ruby/object:Gem::Dependency
189
189
  name: rdf-rdfxml
190
190
  requirement: !ruby/object:Gem::Requirement
@@ -205,14 +205,14 @@ dependencies:
205
205
  requirements:
206
206
  - - "~>"
207
207
  - !ruby/object:Gem::Version
208
- version: '2.0'
208
+ version: '2.2'
209
209
  type: :development
210
210
  prerelease: false
211
211
  version_requirements: !ruby/object:Gem::Requirement
212
212
  requirements:
213
213
  - - "~>"
214
214
  - !ruby/object:Gem::Version
215
- version: '2.0'
215
+ version: '2.2'
216
216
  - !ruby/object:Gem::Dependency
217
217
  name: rdf-isomorphic
218
218
  requirement: !ruby/object:Gem::Requirement
@@ -233,28 +233,28 @@ dependencies:
233
233
  requirements:
234
234
  - - "~>"
235
235
  - !ruby/object:Gem::Version
236
- version: '2.0'
236
+ version: '2.2'
237
237
  type: :development
238
238
  prerelease: false
239
239
  version_requirements: !ruby/object:Gem::Requirement
240
240
  requirements:
241
241
  - - "~>"
242
242
  - !ruby/object:Gem::Version
243
- version: '2.0'
243
+ version: '2.2'
244
244
  - !ruby/object:Gem::Dependency
245
245
  name: yard
246
246
  requirement: !ruby/object:Gem::Requirement
247
247
  requirements:
248
248
  - - "~>"
249
249
  - !ruby/object:Gem::Version
250
- version: '0.8'
250
+ version: '0.9'
251
251
  type: :development
252
252
  prerelease: false
253
253
  version_requirements: !ruby/object:Gem::Requirement
254
254
  requirements:
255
255
  - - "~>"
256
256
  - !ruby/object:Gem::Version
257
- version: '0.8'
257
+ version: '0.9'
258
258
  description: RDF::RDFa is an RDFa reader/writer for Ruby using the RDF.rb library
259
259
  suite.
260
260
  email: public-rdf-ruby@w3.org
@@ -301,7 +301,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
301
301
  version: '0'
302
302
  requirements: []
303
303
  rubyforge_project: rdf-rdfa
304
- rubygems_version: 2.6.8
304
+ rubygems_version: 2.6.11
305
305
  signing_key:
306
306
  specification_version: 4
307
307
  summary: RDFa reader/writer for RDF.rb.