diff --git a/.coveralls.yml b/.coveralls.yml
new file mode 100644
index 0000000..95ac3a5
--- /dev/null
+++ b/.coveralls.yml
@@ -0,0 +1 @@
+repo_token: Me6Vqlj2P292rGH0feiRAVt6hc6jwjndv
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
new file mode 100644
index 0000000..5d49a23
--- /dev/null
+++ b/.github/workflows/ci.yml
@@ -0,0 +1,40 @@
+# This workflow runs continuous CI across different versions of ruby on all branches and pull requests to develop.
+
+name: CI
+on:
+ push:
+ branches: [ '**' ]
+ pull_request:
+ branches: [ develop ]
+ workflow_dispatch:
+
+jobs:
+ tests:
+ name: Ruby ${{ matrix.ruby }}
+ if: "contains(github.event.commits[0].message, '[ci skip]') == false"
+ runs-on: ubuntu-latest
+ env:
+ CI: true
+ strategy:
+ fail-fast: false
+ matrix:
+ ruby:
+ - 2.4
+ - 2.5
+ - 2.6
+ - 2.7
+ - 3.0
+ - ruby-head
+ #- jruby # No Nokogumbo on JRuby
+ steps:
+ - name: Clone repository
+ uses: actions/checkout@v2
+ - name: Set up Ruby
+ uses: ruby/setup-ruby@v1
+ with:
+ ruby-version: ${{ matrix.ruby }}
+ - name: Install dependencies
+ run: bundle install --jobs 4 --retry 3
+ - name: Run tests
+ run: bundle exec rspec spec
+
diff --git a/.gitignore b/.gitignore
index 57f6a7d..1a674f4 100644
--- a/.gitignore
+++ b/.gitignore
@@ -4,3 +4,4 @@
/.rbx/
Gemfile.lock
/.byebug_history
+coverage
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 6a5ebbd..5dd3041 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -28,9 +28,11 @@ This repository uses [Git Flow](https://github.com/nvie/gitflow) to manage devel
enough, be assured we will eventually add you in there.
* Do note that in order for us to merge any non-trivial changes (as a rule
of thumb, additions larger than about 15 lines of code), we need an
- explicit [public domain dedication][PDD] on record from you.
+ explicit [public domain dedication][PDD] on record from you,
+ which you will be asked to agree to on the first commit to a repo within the organization.
+ Note that the agreement applies to all repos in the [Ruby RDF](https://github.com/ruby-rdf/) organization.
[YARD]: https://yardoc.org/
[YARD-GS]: https://rubydoc.info/docs/yard/file/docs/GettingStarted.md
-[PDD]: https://lists.w3.org/Archives/Public/public-rdf-ruby/2010May/0013.html
-[pr]: https://github.com/ruby-rdf/rdf-microdata/compare/
+[PDD]: https://unlicense.org/#unlicensing-contributions
+[pr]: https://github.com/ruby-rdf/rdf/compare/
diff --git a/Gemfile b/Gemfile
index 2b51158..e33063c 100644
--- a/Gemfile
+++ b/Gemfile
@@ -9,7 +9,6 @@ gem "nokogumbo", '~> 2.0'
group :development do
gem "json-ld", git: "https://github.com/ruby-rdf/json-ld", branch: "develop"
- #gem 'linkeddata'
gem 'ebnf', git: "https://github.com/dryruby/ebnf", branch: "develop"
gem 'rdf-aggregate-repo', git: "https://github.com/ruby-rdf/rdf-aggregate-repo", branch: "develop"
gem 'rdf-isomorphic', git: "https://github.com/ruby-rdf/rdf-isomorphic", branch: "develop"
@@ -22,3 +21,8 @@ end
group :debug do
gem "byebug", platform: :mri
end
+
+group :test do
+ gem 'simplecov', '~> 0.16', platforms: :mri
+ gem 'coveralls', '~> 0.8', platforms: :mri
+end
diff --git a/README.md b/README.md
index 85e1050..ea16205 100755
--- a/README.md
+++ b/README.md
@@ -3,7 +3,9 @@
[Microdata][] parser for RDF.rb.
[![Gem Version](https://badge.fury.io/rb/rdf-microdata.png)](https://badge.fury.io/rb/rdf-microdata)
-[![Build Status](https://secure.travis-ci.org/ruby-rdf/rdf-microdata.png?branch=master)](https://travis-ci.org/ruby-rdf/rdf-microdata)
+[![Build Status](https://github.com/ruby-rdf/rdf-microdata/workflows/CI/badge.svg?branch=develop)](https://github.com/ruby-rdf/rdf-microdata/actions?query=workflow%3ACI)
+[![Coverage Status](https://coveralls.io/repos/ruby-rdf/rdf-microdata/badge.svg?branch=develop)](https://coveralls.io/github/ruby-rdf/rdf-microdata?branch=develop)
+[![Gitter chat](https://badges.gitter.im/ruby-rdf/rdf.png)](https://gitter.im/ruby-rdf/rdf)
## DESCRIPTION
RDF::Microdata is a Microdata reader for Ruby using the [RDF.rb][RDF.rb] library suite.
@@ -45,10 +47,11 @@ GRDDL-type triple generation, such as for html>head>title anchor tags.
If the `RDFa` parser is available, {RDF::Microdata::Format} will not assert content type `text/html` or file extension `.html`, as this is also asserted by RDFa. Instead, the RDFa reader will invoke the microdata reader if an `@itemscope` attribute is detected.
## Dependencies
-* [RDF.rb](https://rubygems.org/gems/rdf) (>= 3.1)
-* [RDF::XSD](https://rubygems.org/gems/rdf-xsd) (>= 3.1)
-* [HTMLEntities](https://rubygems.org/gems/htmlentities) ('>= 4.3.0')
-* [Nokogiri](https://rubygems.org/gems/nokogiri) (>= 1.10)
+* [RDF.rb](https://rubygems.org/gems/rdf) (~> 3.1)
+* [RDF::RDFa](https://rubygems.org/gems/rdf-xsd) (~> 3.1)
+* [RDF::XSD](https://rubygems.org/gems/rdf-xsd) (~> 3.1)
+* [HTMLEntities](https://rubygems.org/gems/htmlentities) ('~> 4.3')
+* [Nokogiri](https://rubygems.org/gems/nokogiri) (~> 1.10)
* Soft dependency on [Nokogumbo](https://github.com/rubys/nokogumbo) (~> 2.0)
## Documentation
@@ -90,7 +93,9 @@ The reader exposes a `#rdfa` method, which can be used to retrieve the transform
list in the the `README`. Alphabetical order applies.
* Do note that in order for us to merge any non-trivial changes (as a rule
of thumb, additions larger than about 15 lines of code), we need an
- explicit [public domain dedication][PDD] on record from you.
+ explicit [public domain dedication][PDD] on record from you,
+ which you will be asked to agree to on the first commit to a repo within the organization.
+ Note that the agreement applies to all repos in the [Ruby RDF](https://github.com/ruby-rdf/) organization.
## License
@@ -107,7 +112,7 @@ see or the accompanying {file:UNLICENSE} file.
[RDF.rb]: https://github.com/ruby-rdf/rdf
[YARD]: https://yardoc.org/
[YARD-GS]: https://rubydoc.info/docs/yard/file/docs/GettingStarted.md
-[PDD]: https://lists.w3.org/Archives/Public/public-rdf-ruby/2010May/0013.html
+[PDD]: https://unlicense.org/#unlicensing-contributions
[Microdata]: https://dev.w3.org/html5/md/Overview.html "HTML Microdata"
[Microdata RDF]: https://dvcs.w3.org/hg/htmldata/raw-file/default/microdata-rdf/index.html "Microdata to RDF"
[Microdata doc]: https://rubydoc.info/github/ruby-rdf/rdf-microdata/frames
diff --git a/VERSION b/VERSION
index 94ff29c..ef538c2 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-3.1.1
+3.1.2
diff --git a/etc/doap.ttl b/etc/doap.ttl
index f633e7c..1490fb6 100644
--- a/etc/doap.ttl
+++ b/etc/doap.ttl
@@ -6,14 +6,14 @@
@prefix xsd: .
<> a doap:Project;
+ doap:name "RDF::Microdata";
+ doap:shortdesc "Microdata reader for Ruby RDF.rb."@en;
+ doap:description "RDF::Microdata is an Microdata reader for Ruby using the RDF.rb library suite."@en;
dc:creator ;
doap:blog ;
doap:bug-database ;
doap:category ;
doap:created "2011-08-29"^^xsd:date;
- doap:description """
- RDF::Microdata is an Microdata reader for Ruby using the RDF.rb library suite.
- """@en;
doap:developer ;
doap:documenter ;
doap:download-page <>;
@@ -22,7 +22,5 @@
doap:license ;
doap:mailing-list ;
doap:maintainer ;
- doap:name "RDF::Microdata";
doap:programming-language "Ruby";
- doap:shortdesc "Microdata reader for Ruby."@en;
foaf:creator .
diff --git a/rdf-microdata.gemspec b/rdf-microdata.gemspec
index aa0f116..a0d124a 100755
--- a/rdf-microdata.gemspec
+++ b/rdf-microdata.gemspec
@@ -20,21 +20,21 @@ Gem::Specification.new do |gem|
gem.required_ruby_version = '>= 2.4'
gem.requirements = []
- gem.add_runtime_dependency 'rdf', '~> 3.1'
+ gem.add_runtime_dependency 'rdf', '~> 3.1', '>= 3.1.13'
+ gem.add_runtime_dependency 'rdf-rdfa', '~> 3.1', '>= 3.1.3'
gem.add_runtime_dependency 'rdf-xsd', '~> 3.1'
gem.add_runtime_dependency 'htmlentities', '~> 4.3'
- gem.add_runtime_dependency 'nokogiri' , '~> 1.10'
+ gem.add_runtime_dependency 'nokogiri' , '~> 1.10' # 1.11 Ruby 2.5
gem.add_development_dependency 'equivalent-xml' , '~> 0.6'
- gem.add_development_dependency 'yard' , '~> 0.9.20'
- gem.add_development_dependency 'rspec', '~> 3.9'
+ gem.add_development_dependency 'yard' , '~> 0.9'
+ gem.add_development_dependency 'rspec', '~> 3.10'
gem.add_development_dependency 'rspec-its', '~> 1.3'
gem.add_development_dependency 'rdf-spec', '~> 3.1'
- gem.add_development_dependency 'rdf-turtle', '>= 3.1'
+ gem.add_development_dependency 'rdf-turtle', '~> 3.1'
gem.add_development_dependency 'rdf-isomorphic', '~> 3.1'
gem.add_development_dependency 'json-ld', '~> 3.1'
- gem.add_development_dependency 'rdf-rdfa', '~> 3.1'
gem.post_install_message = nil
end
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index adf8bd4..62e89fa 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -17,7 +17,20 @@
c.include(RDF::Spec::Matchers)
end
-TMP_DIR = File.join(File.expand_path(File.dirname(__FILE__)), "tmp")
+begin
+ require 'simplecov'
+ require 'coveralls'
+ SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter.new([
+ SimpleCov::Formatter::HTMLFormatter,
+ Coveralls::SimpleCov::Formatter
+ ])
+ SimpleCov.start do
+ add_filter "/spec/"
+ end
+ Coveralls.wear!
+rescue LoadError => e
+ STDERR.puts "Coverage Skipped: #{e.message}"
+end
# Heuristically detect the input stream
def detect_format(stream)
diff --git a/spec/suite_spec.rb b/spec/suite_spec.rb
index 1d63b5e..55beff2 100644
--- a/spec/suite_spec.rb
+++ b/spec/suite_spec.rb
@@ -47,7 +47,7 @@
if t.evaluate?
# Remove any rdfa:usesVocabulary property
- graph.query(predicate: RDF::RDFA.usesVocabulary) do |st|
+ graph.query({predicate: RDF::RDFA.usesVocabulary}) do |st|
graph.delete!(st)
end
output_graph = RDF::Graph.load(t.result, base_uri: t.action)