rdf-rdfa 1.1.6 → 1.1.6.1

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: 7c35772b1f7eef50854625886073f4f9be64a5c2
4
- data.tar.gz: d7a977d1d2d7bd9a9214da5086e793d207ec0993
3
+ metadata.gz: 37184941079a9de95652928cc6444e4c81c0ae0b
4
+ data.tar.gz: 1115b899aaa0df5f9d9f5b0146e6188386dc5b4b
5
5
  SHA512:
6
- metadata.gz: 225fa0befb726050bb84c824932d1b84ba833900d87b7b35ca8575ed6e4d58cc2f35e15b1211bcb0e4343729aefc455398edc4943b10a9f01202f4ee9dd4bd69
7
- data.tar.gz: ba139cbe2580ce9aed68be9cf851ec1e1956fe4568cb09aa1b2784e2f864cb77483259534d7890ea2fe1626f382b8cbf1029fd960f8fd42df8bd52352bb5a254
6
+ metadata.gz: 69aada8837f30c1e952b133d96019f69c449bb8989450070849e7529f91fb8fa2d18ee9a0fb66290d942f3f0541590eadf66b26ac3a2804a8609d87cbf0450d8
7
+ data.tar.gz: d35995ba25cf44a360eba057bd9bd8221094e8de62c23f1522336d133aa5883f1493dad247b273c7a2de47735a7ff2a6c6ad6af78958ab2b7132b4a335e618a9
data/README CHANGED
@@ -5,6 +5,7 @@ This repository uses [Git Flow](https://github.com/nvie/gitflow) to mange develo
5
5
 
6
6
  [![Gem Version](https://badge.fury.io/rb/rdf-rdfa.png)](http://badge.fury.io/rb/rdf-rdfa)
7
7
  [![Build Status](https://travis-ci.org/ruby-rdf/rdf-rdfa.png?branch=master)](http://travis-ci.org/ruby-rdf/rdf-rdfa)
8
+ [![Coverage Status](https://coveralls.io/repos/ruby-rdf/rdf-rdfa/badge.svg)](https://coveralls.io/r/ruby-rdf/rdf-rdfa)
8
9
 
9
10
  ## DESCRIPTION
10
11
  RDF::RDFa is an RDFa reader and writer for Ruby using the [RDF.rb][RDF.rb] library suite.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.1.6
1
+ 1.1.6.1
@@ -99,6 +99,16 @@ module RDF::RDFa
99
99
  # @return [Module]
100
100
  attr_reader :implementation
101
101
 
102
+ ##
103
+ # Warnings found during processing
104
+ # @return [Array<String>]
105
+ attr_reader :warnings
106
+
107
+ ##
108
+ # Accumulated errors found during processing
109
+ # @return [Array<String>]
110
+ attr_reader :errors
111
+
102
112
  # The Recursive Baggage
103
113
  # @private
104
114
  class EvaluationContext # :nodoc:
@@ -266,6 +276,10 @@ module RDF::RDFa
266
276
  # Value is an array containing on or both of :output or :processor.
267
277
  # @option options [Repository] :vocab_repository (nil)
268
278
  # Repository to save loaded vocabularies.
279
+ # @option options [Array] :errors
280
+ # array for placing errors found when parsing
281
+ # @option options [Array] :warnings
282
+ # array for placing warnings found when parsing
269
283
  # @option options [Array] :debug
270
284
  # Array to place debug messages
271
285
  # @return [reader]
@@ -275,7 +289,9 @@ module RDF::RDFa
275
289
  # @raise [RDF::ReaderError] if _validate_
276
290
  def initialize(input = $stdin, options = {}, &block)
277
291
  super do
278
- @debug = options[:debug]
292
+ @errors = @options[:errors]
293
+ @warnings = @options[:warnings]
294
+ @debug = @options[:debug]
279
295
  @options = {:reference_folding => true}.merge(@options)
280
296
  @repository = RDF::Repository.new
281
297
 
@@ -313,7 +329,7 @@ module RDF::RDFa
313
329
  add_error(nil, "Malformed document: #{$!.message}")
314
330
  end
315
331
  add_error(nil, "Empty document") if root.nil?
316
- add_error(nil, "Syntax errors:\n#{doc_errors}") if !doc_errors.empty?
332
+ add_error(nil, doc_errors.map(&:message).uniq.join("\n")) if !doc_errors.empty?
317
333
 
318
334
  # Section 4.2 RDFa Host Language Conformance
319
335
  #
@@ -369,23 +385,30 @@ module RDF::RDFa
369
385
  begin
370
386
  # Formats don't exist unless they've been required
371
387
  case type.to_s
372
- when 'application/rdf+xml' then require 'rdf/rdfxml'
373
- when 'text/ntriples' then require 'rdf/ntriples'
374
- when 'text/turtle' then require 'rdf/turtle'
375
- when 'application/ld+json' then require 'json/ld'
388
+ when 'application/csvm+json' then require 'rdf/tabular'
389
+ when 'application/ld+json' then require 'json/ld'
390
+ when 'application/rdf+xml' then require 'rdf/rdfxml'
391
+ when 'text/ntriples' then require 'rdf/ntriples'
392
+ when 'text/turtle' then require 'rdf/turtle'
376
393
  end
377
394
  rescue LoadError
378
395
  end
379
396
 
380
- if reader = RDF::Reader.for(:content_type => type)
397
+ if reader = RDF::Reader.for(:content_type => type.to_s)
381
398
  add_debug(el, "=> reader #{reader.to_sym}")
382
- reader.new(input, options).each(&block)
399
+ # Wrap input in a RemoteDocument with appropriate content-type
400
+ doc = if input.is_a?(String)
401
+ RDF::Util::File::RemoteDocument.new(input, options.merge(content_type: type.to_s))
402
+ else
403
+ input
404
+ end
405
+ reader.new(doc, options).each(&block)
383
406
  else
384
407
  add_debug(el, "=> no reader found")
385
408
  end
386
409
  end
387
410
 
388
- # Look for Embedded Turtle and RDF/XML
411
+ # Look for Embedded RDF/XML
389
412
  unless @root.xpath("//rdf:RDF", "rdf" => "http://www.w3.org/1999/02/22-rdf-syntax-ns#").empty?
390
413
  extract_script(@root, @doc, "application/rdf+xml", @options) do |statement|
391
414
  @repository << statement
@@ -484,10 +507,12 @@ module RDF::RDFa
484
507
  end
485
508
 
486
509
  def add_warning(node, message, process_class = RDF::RDFA.Warning)
510
+ @warnings << "#{node_path(node)}: #{message}" if @warnings
487
511
  add_processor_message(node, message, process_class)
488
512
  end
489
513
 
490
514
  def add_error(node, message, process_class = RDF::RDFA.Error)
515
+ @errors << "#{node_path(node)}: #{message}" if @errors
491
516
  add_processor_message(node, message, process_class)
492
517
  raise RDF::ReaderError, message if validate?
493
518
  end
@@ -1458,8 +1483,15 @@ module RDF::RDFa
1458
1483
  end
1459
1484
 
1460
1485
  def uri(value, append = nil)
1461
- value = RDF::URI.new(value)
1462
- value = value.join(append) if append
1486
+ append = RDF::URI(append)
1487
+ value = RDF::URI(value)
1488
+ value = if append.absolute?
1489
+ value = append
1490
+ elsif append
1491
+ value = value.join(append)
1492
+ else
1493
+ value
1494
+ end
1463
1495
  value.validate! if validate?
1464
1496
  value.canonicalize! if canonicalize?
1465
1497
  value = RDF::URI.intern(value) if intern?
@@ -279,8 +279,8 @@ module RDF::RDFa
279
279
  ##
280
280
  # Document errors
281
281
  def doc_errors
282
- # FIXME: Nokogiri version 1.5.5 things <time> is invalid
283
- @doc.errors.reject {|e| e.to_s =~ /(Tag time invalid|Missing attribute name)/}
282
+ # FIXME: Nokogiri version 1.5.5 thinks many HTML5 elements are invalid
283
+ @doc.errors.reject {|e| e.to_s =~ /(Tag (?:article|aside|audio|canvas|command|datalist|details|embed|figure|footer|header|hgroup|keygen|mark|meter|nav|output|progress|ruby|section|time|video|wbr) invalid|Missing attribute name)/}
284
284
  end
285
285
 
286
286
  ##
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: 1.1.6
4
+ version: 1.1.6.1
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: 2015-04-02 00:00:00.000000000 Z
12
+ date: 2015-11-09 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rdf
@@ -21,6 +21,9 @@ dependencies:
21
21
  - - ">="
22
22
  - !ruby/object:Gem::Version
23
23
  version: 1.1.6
24
+ - - "<"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.99'
24
27
  type: :runtime
25
28
  prerelease: false
26
29
  version_requirements: !ruby/object:Gem::Requirement
@@ -31,6 +34,9 @@ dependencies:
31
34
  - - ">="
32
35
  - !ruby/object:Gem::Version
33
36
  version: 1.1.6
37
+ - - "<"
38
+ - !ruby/object:Gem::Version
39
+ version: '1.99'
34
40
  - !ruby/object:Gem::Dependency
35
41
  name: haml
36
42
  requirement: !ruby/object:Gem::Requirement
@@ -52,6 +58,9 @@ dependencies:
52
58
  - - "~>"
53
59
  - !ruby/object:Gem::Version
54
60
  version: '1.1'
61
+ - - "<"
62
+ - !ruby/object:Gem::Version
63
+ version: '1.99'
55
64
  type: :runtime
56
65
  prerelease: false
57
66
  version_requirements: !ruby/object:Gem::Requirement
@@ -59,6 +68,9 @@ dependencies:
59
68
  - - "~>"
60
69
  - !ruby/object:Gem::Version
61
70
  version: '1.1'
71
+ - - "<"
72
+ - !ruby/object:Gem::Version
73
+ version: '1.99'
62
74
  - !ruby/object:Gem::Dependency
63
75
  name: rdf-aggregate-repo
64
76
  requirement: !ruby/object:Gem::Requirement
@@ -66,6 +78,9 @@ dependencies:
66
78
  - - "~>"
67
79
  - !ruby/object:Gem::Version
68
80
  version: '1.1'
81
+ - - "<"
82
+ - !ruby/object:Gem::Version
83
+ version: '1.99'
69
84
  type: :runtime
70
85
  prerelease: false
71
86
  version_requirements: !ruby/object:Gem::Requirement
@@ -73,6 +88,9 @@ dependencies:
73
88
  - - "~>"
74
89
  - !ruby/object:Gem::Version
75
90
  version: '1.1'
91
+ - - "<"
92
+ - !ruby/object:Gem::Version
93
+ version: '1.99'
76
94
  - !ruby/object:Gem::Dependency
77
95
  name: htmlentities
78
96
  requirement: !ruby/object:Gem::Requirement
@@ -114,6 +132,9 @@ dependencies:
114
132
  - - "~>"
115
133
  - !ruby/object:Gem::Version
116
134
  version: '1.1'
135
+ - - "<"
136
+ - !ruby/object:Gem::Version
137
+ version: '1.99'
117
138
  type: :development
118
139
  prerelease: false
119
140
  version_requirements: !ruby/object:Gem::Requirement
@@ -121,6 +142,9 @@ dependencies:
121
142
  - - "~>"
122
143
  - !ruby/object:Gem::Version
123
144
  version: '1.1'
145
+ - - "<"
146
+ - !ruby/object:Gem::Version
147
+ version: '1.99'
124
148
  - !ruby/object:Gem::Dependency
125
149
  name: rspec
126
150
  requirement: !ruby/object:Gem::Requirement
@@ -156,6 +180,9 @@ dependencies:
156
180
  - - "~>"
157
181
  - !ruby/object:Gem::Version
158
182
  version: '1.1'
183
+ - - "<"
184
+ - !ruby/object:Gem::Version
185
+ version: '1.99'
159
186
  type: :development
160
187
  prerelease: false
161
188
  version_requirements: !ruby/object:Gem::Requirement
@@ -163,6 +190,23 @@ dependencies:
163
190
  - - "~>"
164
191
  - !ruby/object:Gem::Version
165
192
  version: '1.1'
193
+ - - "<"
194
+ - !ruby/object:Gem::Version
195
+ version: '1.99'
196
+ - !ruby/object:Gem::Dependency
197
+ name: rdf-microdata
198
+ requirement: !ruby/object:Gem::Requirement
199
+ requirements:
200
+ - - "~>"
201
+ - !ruby/object:Gem::Version
202
+ version: 2.0.2
203
+ type: :development
204
+ prerelease: false
205
+ version_requirements: !ruby/object:Gem::Requirement
206
+ requirements:
207
+ - - "~>"
208
+ - !ruby/object:Gem::Version
209
+ version: 2.0.2
166
210
  - !ruby/object:Gem::Dependency
167
211
  name: rdf-turtle
168
212
  requirement: !ruby/object:Gem::Requirement
@@ -170,6 +214,9 @@ dependencies:
170
214
  - - "~>"
171
215
  - !ruby/object:Gem::Version
172
216
  version: '1.1'
217
+ - - "<"
218
+ - !ruby/object:Gem::Version
219
+ version: '1.99'
173
220
  type: :development
174
221
  prerelease: false
175
222
  version_requirements: !ruby/object:Gem::Requirement
@@ -177,6 +224,9 @@ dependencies:
177
224
  - - "~>"
178
225
  - !ruby/object:Gem::Version
179
226
  version: '1.1'
227
+ - - "<"
228
+ - !ruby/object:Gem::Version
229
+ version: '1.99'
180
230
  - !ruby/object:Gem::Dependency
181
231
  name: rdf-rdfxml
182
232
  requirement: !ruby/object:Gem::Requirement
@@ -184,6 +234,9 @@ dependencies:
184
234
  - - "~>"
185
235
  - !ruby/object:Gem::Version
186
236
  version: '1.1'
237
+ - - "<"
238
+ - !ruby/object:Gem::Version
239
+ version: '1.99'
187
240
  type: :development
188
241
  prerelease: false
189
242
  version_requirements: !ruby/object:Gem::Requirement
@@ -191,6 +244,9 @@ dependencies:
191
244
  - - "~>"
192
245
  - !ruby/object:Gem::Version
193
246
  version: '1.1'
247
+ - - "<"
248
+ - !ruby/object:Gem::Version
249
+ version: '1.99'
194
250
  - !ruby/object:Gem::Dependency
195
251
  name: rdf-isomorphic
196
252
  requirement: !ruby/object:Gem::Requirement
@@ -198,6 +254,9 @@ dependencies:
198
254
  - - "~>"
199
255
  - !ruby/object:Gem::Version
200
256
  version: '1.1'
257
+ - - "<"
258
+ - !ruby/object:Gem::Version
259
+ version: '1.99'
201
260
  type: :development
202
261
  prerelease: false
203
262
  version_requirements: !ruby/object:Gem::Requirement
@@ -205,6 +264,9 @@ dependencies:
205
264
  - - "~>"
206
265
  - !ruby/object:Gem::Version
207
266
  version: '1.1'
267
+ - - "<"
268
+ - !ruby/object:Gem::Version
269
+ version: '1.99'
208
270
  - !ruby/object:Gem::Dependency
209
271
  name: sparql
210
272
  requirement: !ruby/object:Gem::Requirement
@@ -212,6 +274,9 @@ dependencies:
212
274
  - - "~>"
213
275
  - !ruby/object:Gem::Version
214
276
  version: '1.1'
277
+ - - "<"
278
+ - !ruby/object:Gem::Version
279
+ version: '1.99'
215
280
  type: :development
216
281
  prerelease: false
217
282
  version_requirements: !ruby/object:Gem::Requirement
@@ -219,6 +284,9 @@ dependencies:
219
284
  - - "~>"
220
285
  - !ruby/object:Gem::Version
221
286
  version: '1.1'
287
+ - - "<"
288
+ - !ruby/object:Gem::Version
289
+ version: '1.99'
222
290
  - !ruby/object:Gem::Dependency
223
291
  name: yard
224
292
  requirement: !ruby/object:Gem::Requirement
@@ -279,7 +347,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
279
347
  version: '0'
280
348
  requirements: []
281
349
  rubyforge_project: rdf-rdfa
282
- rubygems_version: 2.4.3
350
+ rubygems_version: 2.4.5.1
283
351
  signing_key:
284
352
  specification_version: 4
285
353
  summary: RDFa reader/writer for RDF.rb.