diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2832fda..6d1b24c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,16 +19,10 @@ jobs: strategy: fail-fast: false matrix: - ruby: - - 2.6 - - 2.7 - - "3.0" - - 3.1 - - ruby-head - - jruby + ruby: ['3.0', 3.1, 3.2, ruby-head, jruby] steps: - name: Clone repository - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Set up Ruby uses: ruby/setup-ruby@v1 with: @@ -38,7 +32,7 @@ jobs: - name: Run tests run: ruby --version; bundle exec rspec spec || $ALLOW_FAILURES - name: Coveralls GitHub Action - uses: coverallsapp/github-action@v1.1.2 - if: "matrix.ruby == '3.0'" + uses: coverallsapp/github-action@v2 + if: "matrix.ruby == '3.2'" with: github-token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/generate-docs.yml b/.github/workflows/generate-docs.yml index b8d16ed..65aea93 100644 --- a/.github/workflows/generate-docs.yml +++ b/.github/workflows/generate-docs.yml @@ -10,7 +10,7 @@ jobs: name: Update gh-pages with docs steps: - name: Clone repository - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Set up Ruby uses: ruby/setup-ruby@v1 with: diff --git a/Gemfile b/Gemfile index f4d64cd..e6160a0 100644 --- a/Gemfile +++ b/Gemfile @@ -22,6 +22,6 @@ group :debug do end group :test do - gem 'simplecov', '~> 0.21', platforms: :mri + gem 'simplecov', '~> 0.22', platforms: :mri gem 'simplecov-lcov', '~> 0.8', platforms: :mri end diff --git a/README.md b/README.md index 32bd880..3801b35 100755 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ [Microdata][] parser for RDF.rb. -[![Gem Version](https://badge.fury.io/rb/rdf-microdata.png)](https://badge.fury.io/rb/rdf-microdata) +[![Gem Version](https://badge.fury.io/rb/rdf-microdata.svg)](https://badge.fury.io/rb/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) @@ -46,11 +46,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.2) -* [RDF::RDFa](https://rubygems.org/gems/rdf-xsd) (~> 3.2) -* [RDF::XSD](https://rubygems.org/gems/rdf-xsd) (~> 3.2) +* [RDF.rb](https://rubygems.org/gems/rdf) (~> 3.3) +* [RDF::RDFa](https://rubygems.org/gems/rdf-xsd) (~> 3.3) +* [RDF::XSD](https://rubygems.org/gems/rdf-xsd) (~> 3.3) * [HTMLEntities](https://rubygems.org/gems/htmlentities) ('~> 4.3') -* [Nokogiri](https://rubygems.org/gems/nokogiri) (~> 1.12) +* [Nokogiri](https://rubygems.org/gems/nokogiri) (~> 1.15) ## Documentation Full documentation available on [Rubydoc.info][Microdata doc] diff --git a/VERSION b/VERSION index e4604e3..15a2799 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -3.2.1 +3.3.0 diff --git a/lib/rdf/microdata/format.rb b/lib/rdf/microdata/format.rb index 4973c9a..cfc33df 100644 --- a/lib/rdf/microdata/format.rb +++ b/lib/rdf/microdata/format.rb @@ -26,7 +26,11 @@ class Format < RDF::Format # Only define content type if RDFa is not available. # The Microdata processor will be launched from there # otherwise. - content_type 'text/html;q=0.5', extension: :html unless RDF::Format.for(:rdfa) + unless RDF::Format.for(:rdfa) + content_type 'text/html;q=0.5', + extension: :html, + uri: 'http://www.w3.org/ns/formats/microdata' + end reader { RDF::Microdata::Reader } ## diff --git a/lib/rdf/microdata/rdfa_reader.rb b/lib/rdf/microdata/rdfa_reader.rb index bdc674f..0ac34aa 100644 --- a/lib/rdf/microdata/rdfa_reader.rb +++ b/lib/rdf/microdata/rdfa_reader.rb @@ -97,7 +97,6 @@ def initialize(input = $stdin, **options, &block) # Add @vocab to referenced using the closest ansestor having @vocab of item. # If the element with id reference has no resource attribute, add a resource attribute whose value is a NUMBER SIGN U+0023 followed by reference to the element. # If the element with id reference has no typeof attribute, add a typeof="rdfa:Pattern" attribute to the element. - # FIXME: This broke in Nokogiri 13.0 referenced.wrap(%(
)) # Add a link child element to the element that represents the item, with a rel="rdfa:copy" attribute and an href attribute whose value is a NUMBER SIGN U+0023 followed by reference diff --git a/rdf-microdata.gemspec b/rdf-microdata.gemspec index 3c7fef1..d3d09b4 100755 --- a/rdf-microdata.gemspec +++ b/rdf-microdata.gemspec @@ -25,23 +25,23 @@ Gem::Specification.new do |gem| gem.files = %w(AUTHORS README.md UNLICENSE VERSION) + Dir.glob('lib/**/*.rb') + Dir.glob('etc/*') gem.require_paths = %w(lib) - gem.required_ruby_version = '>= 2.6' + gem.required_ruby_version = '>= 3.0' gem.requirements = [] - gem.add_runtime_dependency 'rdf', '~> 3.2' - gem.add_runtime_dependency 'rdf-rdfa', '~> 3.2' - gem.add_runtime_dependency 'rdf-xsd', '~> 3.2' + gem.add_runtime_dependency 'rdf', '~> 3.3' + gem.add_runtime_dependency 'rdf-rdfa', '~> 3.3' + gem.add_runtime_dependency 'rdf-xsd', '~> 3.3' gem.add_runtime_dependency 'htmlentities', '~> 4.3' - gem.add_runtime_dependency 'nokogiri' , '~> 1.13' + gem.add_runtime_dependency 'nokogiri' , '~> 1.15', '>= 1.15.4' gem.add_development_dependency 'equivalent-xml' , '~> 0.6' gem.add_development_dependency 'yard' , '~> 0.9' - gem.add_development_dependency 'rspec', '~> 3.10' + gem.add_development_dependency 'rspec', '~> 3.12' gem.add_development_dependency 'rspec-its', '~> 1.3' - gem.add_development_dependency 'rdf-spec', '~> 3.2' - gem.add_development_dependency 'rdf-turtle', '~> 3.2' - gem.add_development_dependency 'rdf-isomorphic', '~> 3.2' - gem.add_development_dependency 'json-ld', '~> 3.2' + gem.add_development_dependency 'rdf-spec', '~> 3.3' + gem.add_development_dependency 'rdf-turtle', '~> 3.3' + gem.add_development_dependency 'rdf-isomorphic', '~> 3.3' + gem.add_development_dependency 'json-ld', '~> 3.3' gem.post_install_message = nil end diff --git a/spec/format_spec.rb b/spec/format_spec.rb index 5baacec..b00503c 100644 --- a/spec/format_spec.rb +++ b/spec/format_spec.rb @@ -34,6 +34,11 @@ specify {expect(described_class.to_sym).to eq :microdata} end + # This interferes with RDFa. + describe "#to_uri", skip: true do + specify {expect(described_class.to_uri).to eq RDF::URI('http://www.w3.org/ns/formats/microdata')} + end + describe ".detect" do { itemprop: '
', diff --git a/spec/rdfa_reader_spec.rb b/spec/rdfa_reader_spec.rb index e42a11e..0403471 100644 --- a/spec/rdfa_reader_spec.rb +++ b/spec/rdfa_reader_spec.rb @@ -629,7 +629,8 @@ ], }.each do |name, (md, nt)| - it "parses #{name}", pending: "Broke in Nokogiri 13.0" do + it "parses #{name}" do + pending "Broke in Nokogiri 13.0" if RUBY_VERSION < "2.7" expect(parse(md)).to be_equivalent_graph(nt, logger: @logger) end end