earl-report 0.4.0 → 0.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -0
- data/VERSION +1 -1
- data/lib/earl_report.rb +9 -1
- data/spec/earl_report_spec.rb +24 -0
- data/spec/spec_helper.rb +9 -0
- data/spec/test-files/results.html +10 -10
- data/spec/test-files/results.jsonld +4 -4
- data/spec/test-files/results.ttl +8 -8
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1f48a7efb4101689b295d5f8ffc5e5921a5e6c85
|
4
|
+
data.tar.gz: d21010e7dcf61659ef1afb68bdc0b8353fd1df6a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cf1b903bdbc2e2190ae8411b8ce9a273edaa73887eedec5917dc8df0a17a01cda40073805bda9623658cc08979fcdd2b482895f44cb26edb5ebd4bb645d286d0
|
7
|
+
data.tar.gz: 076a2ee44c17f7ad9d916957d14c639ce427259026f743189f544720a1ebefc8cc7983d338b4ff1fa65a1a5c5e4178e7d8595aec2620aed9fca5439ba5df8db5
|
data/README.md
CHANGED
@@ -3,6 +3,7 @@ Ruby gem to consolidate multiple EARL report and generate a rollup conformance r
|
|
3
3
|
|
4
4
|
[![Gem Version](https://badge.fury.io/rb/earl-report.png)](http://badge.fury.io/rb/earl-report)
|
5
5
|
[![Build Status](https://travis-ci.org/gkellogg/earl-report.png?branch=master)](http://travis-ci.org/gkellogg/earl-report)
|
6
|
+
[![Coverage Status](https://coveralls.io/repos/gkellogg/earl-report/badge.svg)](https://coveralls.io/r/gkellogg/earl-report)
|
6
7
|
|
7
8
|
## Description
|
8
9
|
Reads a test manifest in the
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.4.
|
1
|
+
0.4.1
|
data/lib/earl_report.rb
CHANGED
@@ -171,7 +171,15 @@ class EarlReport
|
|
171
171
|
# If provided :json, it is used for generating all other output forms
|
172
172
|
if @options[:json]
|
173
173
|
@json_hash = ::JSON.parse(File.read(files.first))
|
174
|
-
|
174
|
+
# Add a base_uri so relative subjects aren't dropped
|
175
|
+
JSON::LD::Reader.open(files.first, base_uri: "http://example.org/report") do |r|
|
176
|
+
@graph = RDF::Graph.new
|
177
|
+
r.each_statement do |statement|
|
178
|
+
# restore relative subject
|
179
|
+
statement.subject = RDF::URI("") if statement.subject == "http://example.org/report"
|
180
|
+
@graph << statement
|
181
|
+
end
|
182
|
+
end
|
175
183
|
return
|
176
184
|
end
|
177
185
|
|
data/spec/earl_report_spec.rb
CHANGED
@@ -316,6 +316,30 @@ describe EarlReport do
|
|
316
316
|
}.not_to raise_error
|
317
317
|
end
|
318
318
|
|
319
|
+
it "saves output as Turtle" do
|
320
|
+
output = subject.generate(format: :turtle)
|
321
|
+
expect {
|
322
|
+
File.open(File.expand_path("../test-files/results.ttl", __FILE__), "w") do |f|
|
323
|
+
f.write(output)
|
324
|
+
end
|
325
|
+
}.not_to raise_error
|
326
|
+
end
|
327
|
+
|
328
|
+
context "output as JSON-LD" do
|
329
|
+
let(:output) {subject.generate(format: :jsonld)}
|
330
|
+
it "saves output" do
|
331
|
+
expect {
|
332
|
+
File.open(File.expand_path("../test-files/results.jsonld", __FILE__), "w") do |f|
|
333
|
+
f.write(output)
|
334
|
+
end
|
335
|
+
}.not_to raise_error
|
336
|
+
end
|
337
|
+
|
338
|
+
it "reads a previously generated JSON-LD file" do
|
339
|
+
expect {EarlReport.new(File.expand_path("../test-files/results.jsonld", __FILE__), json: true)}.not_to raise_error
|
340
|
+
end
|
341
|
+
end
|
342
|
+
|
319
343
|
it "has Report" do
|
320
344
|
expect(SPARQL.execute(REPORT_QUERY, graph)).to eq RDF::Literal::TRUE
|
321
345
|
end
|
data/spec/spec_helper.rb
CHANGED
@@ -4,6 +4,15 @@ $:.unshift File.dirname(__FILE__)
|
|
4
4
|
require "bundler/setup"
|
5
5
|
require 'rspec'
|
6
6
|
require 'rspec/its'
|
7
|
+
require 'simplecov'
|
8
|
+
require 'coveralls'
|
9
|
+
SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[
|
10
|
+
SimpleCov::Formatter::HTMLFormatter,
|
11
|
+
Coveralls::SimpleCov::Formatter
|
12
|
+
]
|
13
|
+
SimpleCov.start do
|
14
|
+
add_filter "/spec/"
|
15
|
+
end
|
7
16
|
require 'earl_report'
|
8
17
|
|
9
18
|
JSON_STATE = JSON::State.new(
|
@@ -27,7 +27,7 @@
|
|
27
27
|
shortName: "turtle-earl",
|
28
28
|
subtitle: "Turtle Implementation Conformance Report",
|
29
29
|
// if you wish the publication date to be other than today, set this
|
30
|
-
publishDate: "2015/
|
30
|
+
publishDate: "2015/10/04",
|
31
31
|
|
32
32
|
// if there is a previously published draft, uncomment this and set its YYYY-MM-DD date
|
33
33
|
// and its maturity status
|
@@ -167,12 +167,12 @@
|
|
167
167
|
</span>
|
168
168
|
</td>
|
169
169
|
</tr>
|
170
|
-
<tr inlist='inlist' rel='mf:entries' resource='_:
|
170
|
+
<tr inlist='inlist' rel='mf:entries' resource='_:b2' typeof='http://www.w3.org/ns/rdftest#TestTurtleEval TestCriterion TestCase'>
|
171
171
|
<td>
|
172
|
-
<a href='#
|
172
|
+
<a href='#test_9430e2f85f26fd582ac7fcccd7f50d46'>subm-test-01</a>
|
173
173
|
</td>
|
174
174
|
<td class='UNTESTED' property='earl:assertions' typeof='Assertion'>
|
175
|
-
<link href='_:
|
175
|
+
<link href='_:b2' property='earl:test' />
|
176
176
|
<link href='http://rubygems.org/gems/rdf-turtle' property='earl:subject' />
|
177
177
|
<link href='6' property='earl:mode' />
|
178
178
|
<span property='earl:result' typeof='TestResult'>
|
@@ -278,11 +278,11 @@
|
|
278
278
|
<pre class='example actionDoc' property='mf:action' resource='http://example/test-00.ttl' title='subm-test-00 Input'>http://example/test-00.ttl not loaded</pre>
|
279
279
|
<pre class='example resultDoc' property='mf:result' resource='http://example/test-00.out' title='subm-test-00 Result'>http://example/test-00.out not loaded</pre>
|
280
280
|
</dd>
|
281
|
-
<dt id='
|
281
|
+
<dt id='test_9430e2f85f26fd582ac7fcccd7f50d46' resource='_:b2'>
|
282
282
|
Test
|
283
283
|
<span property='dc:title mf:name'>subm-test-01</span>
|
284
284
|
</dt>
|
285
|
-
<dd resource='_:
|
285
|
+
<dd resource='_:b2'>
|
286
286
|
<p property='dc:description rdfs:comment'>7</p>
|
287
287
|
<pre class='example actionDoc' property='mf:action' resource='http://example/test-01.ttl' title='subm-test-01 Input'>http://example/test-01.ttl not loaded</pre>
|
288
288
|
<pre class='example resultDoc' property='mf:result' resource='http://example/test-01.out' title='subm-test-01 Result'>http://example/test-01.out not loaded</pre>
|
@@ -300,10 +300,10 @@
|
|
300
300
|
<meta content='Earl Report summary generator' property='doap:shortdesc' />
|
301
301
|
<meta content='EarlReport generates HTML+RDFa rollups of multiple EARL reports' property='doap:description' />
|
302
302
|
version
|
303
|
-
<span property='doap:release' resource='https://github.com/gkellogg/earl-report/tree/0.
|
304
|
-
<span property='doap:revision'>0.
|
305
|
-
<meta content='earl-report-0.
|
306
|
-
<meta content='2015-
|
303
|
+
<span property='doap:release' resource='https://github.com/gkellogg/earl-report/tree/0.4.0' typeof='doap:Version'>
|
304
|
+
<span property='doap:revision'>0.4.0</span>
|
305
|
+
<meta content='earl-report-0.4.0' property='doap:name' />
|
306
|
+
<meta content='2015-08-10' datatype='xsd:date' property='doap:created' />
|
307
307
|
</span>
|
308
308
|
an
|
309
309
|
<a href='http://unlicense.org' property='doap:license'>Unlicensed</a>
|
@@ -199,11 +199,11 @@
|
|
199
199
|
"license": "http://unlicense.org",
|
200
200
|
"name": "earl-report",
|
201
201
|
"release": {
|
202
|
-
"@id": "https://github.com/gkellogg/earl-report/tree/0.
|
202
|
+
"@id": "https://github.com/gkellogg/earl-report/tree/0.4.0",
|
203
203
|
"@type": "doap:Version",
|
204
|
-
"created": "2015-
|
205
|
-
"name": "earl-report-0.
|
206
|
-
"revision": "0.
|
204
|
+
"created": "2015-08-10",
|
205
|
+
"name": "earl-report-0.4.0",
|
206
|
+
"revision": "0.4.0"
|
207
207
|
},
|
208
208
|
"shortdesc": "Earl Report summary generator"
|
209
209
|
},
|
data/spec/test-files/results.ttl
CHANGED
@@ -21,7 +21,7 @@
|
|
21
21
|
<http://example/manifest.ttl> a mf:Manifest,
|
22
22
|
earl:Report;
|
23
23
|
rdfs:comment "Description for Example Test Cases";
|
24
|
-
mf:entries (<http://example/manifest.ttl#testeval00> _:
|
24
|
+
mf:entries (<http://example/manifest.ttl#testeval00> _:g70243612323780);
|
25
25
|
mf:name "Example Test Cases" .
|
26
26
|
|
27
27
|
<http://example/manifest.ttl#testeval00> a <http://www.w3.org/ns/rdftest#TestTurtleEval>,
|
@@ -43,7 +43,7 @@
|
|
43
43
|
earl:test <http://example/manifest.ttl#testeval00>
|
44
44
|
] .
|
45
45
|
|
46
|
-
_:
|
46
|
+
_:g70243612323780 a <http://www.w3.org/ns/rdftest#TestTurtleEval>,
|
47
47
|
earl:TestCriterion,
|
48
48
|
earl:TestCase;
|
49
49
|
rdfs:comment "@prefix and qnames";
|
@@ -57,7 +57,7 @@ _:g70278498983360 a <http://www.w3.org/ns/rdftest#TestTurtleEval>,
|
|
57
57
|
earl:outcome earl:untested
|
58
58
|
];
|
59
59
|
earl:subject <http://rubygems.org/gems/rdf-turtle>;
|
60
|
-
earl:test _:
|
60
|
+
earl:test _:g70243612323780
|
61
61
|
] .
|
62
62
|
|
63
63
|
# Test Subjects
|
@@ -86,10 +86,10 @@ _:g70278498983360 a <http://www.w3.org/ns/rdftest#TestTurtleEval>,
|
|
86
86
|
doap:license <http://unlicense.org>;
|
87
87
|
doap:name "earl-report";
|
88
88
|
doap:programming-language "Ruby";
|
89
|
-
doap:release <https://github.com/gkellogg/earl-report/tree/0.
|
89
|
+
doap:release <https://github.com/gkellogg/earl-report/tree/0.4.0>;
|
90
90
|
doap:shortdesc "Earl Report summary generator"@en .
|
91
91
|
|
92
|
-
<https://github.com/gkellogg/earl-report/tree/0.
|
93
|
-
doap:created "2015-
|
94
|
-
doap:name "earl-report-0.
|
95
|
-
doap:revision "0.
|
92
|
+
<https://github.com/gkellogg/earl-report/tree/0.4.0> a doap:Version;
|
93
|
+
doap:created "2015-08-10"^^xsd:date;
|
94
|
+
doap:name "earl-report-0.4.0";
|
95
|
+
doap:revision "0.4.0" .
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: earl-report
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gregg Kellogg
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-10-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: linkeddata
|