From 4827f083ed188480332818222a90e93fb445d5ac Mon Sep 17 00:00:00 2001 From: Gregg Kellogg Date: Wed, 3 May 2023 14:49:05 -0700 Subject: [PATCH 1/3] Update badges --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 3c4ad69..172f43d 100755 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ [RDFa][RDFa 1.1 Core] parser for RDF.rb. -[![Gem Version](https://badge.fury.io/rb/rdf-rdfa.png)](https://badge.fury.io/rb/rdf-rdfa) +[![Gem Version](https://badge.fury.io/rb/rdf-rdfa.svg)](https://badge.fury.io/rb/rdf-rdfa) [![Build Status](https://github.com/ruby-rdf/rdf-rdfa/workflows/CI/badge.svg?branch=develop)](https://github.com/ruby-rdf/rdf-rdfa/actions?query=workflow%3ACI) [![Coverage Status](https://coveralls.io/repos/ruby-rdf/rdf-rdfa/badge.svg?branch=develop)](https://coveralls.io/github/ruby-rdf/rdf-rdfa?branch=develop) [![Gitter chat](https://badges.gitter.im/ruby-rdf/rdf.png)](https://gitter.im/ruby-rdf/rdf) From 544c502ab2dc8d5fdb1737e3fa138cef59589ff6 Mon Sep 17 00:00:00 2001 From: Gregg Kellogg Date: Sun, 23 Jul 2023 13:33:39 -0700 Subject: [PATCH 2/3] Don't define RDF::XML or RDF::XSI, use strings instead. --- .github/workflows/ci.yml | 2 +- lib/rdf/rdfa/reader/nokogiri.rb | 8 ++++---- lib/rdf/rdfa/reader/rexml.rb | 12 ++++++------ lib/rdf/rdfa/vocab.rb | 3 --- 4 files changed, 11 insertions(+), 14 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7eb055f..32255be 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -36,7 +36,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 + uses: coverallsapp/github-action@v2 if: ${{ matrix.ruby == '3.0' && matrix.gemfile == 'Gemfile' }} with: github-token: ${{ secrets.GITHUB_TOKEN }} diff --git a/lib/rdf/rdfa/reader/nokogiri.rb b/lib/rdf/rdfa/reader/nokogiri.rb index 97d31d7..0f00bbd 100644 --- a/lib/rdf/rdfa/reader/nokogiri.rb +++ b/lib/rdf/rdfa/reader/nokogiri.rb @@ -35,8 +35,8 @@ def initialize(node, parent = nil) # @return [String] def language case - when @node.attribute_with_ns("lang", RDF::XML.to_s) - @node.attribute_with_ns("lang", RDF::XML.to_s) + when @node.attribute_with_ns("lang", "http://www.w3.org/XML/1998/namespace") + @node.attribute_with_ns("lang", "http://www.w3.org/XML/1998/namespace") when @node.attribute("xml:lang") @node.attribute("xml:lang").to_s when @node.attribute("lang") @@ -49,7 +49,7 @@ def language # # @return [String] def base - @node.attribute_with_ns("base", RDF::XML.to_s) || @node.attribute('xml:base') + @node.attribute_with_ns("base", "http://www.w3.org/XML/1998/namespace") || @node.attribute('xml:base') end def display_path @@ -303,7 +303,7 @@ def doc_base(base) base_el = @doc.at_css("html>head>base") base = base.join(base_el.attribute("href").to_s.split("#").first) if base_el else - xml_base = root.attribute_with_ns("base", RDF::XML.to_s) || root.attribute('xml:base') if root + xml_base = root.attribute_with_ns("base", "http://www.w3.org/XML/1998/namespace") || root.attribute('xml:base') if root base = base.join(xml_base) if xml_base end diff --git a/lib/rdf/rdfa/reader/rexml.rb b/lib/rdf/rdfa/reader/rexml.rb index a6f2753..60081a3 100644 --- a/lib/rdf/rdfa/reader/rexml.rb +++ b/lib/rdf/rdfa/reader/rexml.rb @@ -36,9 +36,9 @@ def initialize(node, parent = nil) # # @return [String] def language - language = case - when @node.attribute("lang", RDF::XML.to_s) - @node.attribute("lang", RDF::XML.to_s) + case + when @node.attribute("lang", "http://www.w3.org/XML/1998/namespace") + @node.attribute("lang", "http://www.w3.org/XML/1998/namespace") when @node.attribute("xml:lang") @node.attribute("xml:lang").to_s when @node.attribute("lang") @@ -51,7 +51,7 @@ def language # # @return [String] def base - @node.attribute("base", RDF::XML.to_s) || @node.attribute('xml:base') + @node.attribute("base", "http://www.w3.org/XML/1998/namespace") || @node.attribute('xml:base') end def display_path @@ -224,7 +224,7 @@ def initialize_xml(input, **options) @base_uri = base_uri ? base_uri.to_s : nil # Only parse as XML, no HTML mode - doc = ::REXML::Document.new(input.respond_to?(:read) ? input.read : input.to_s) + ::REXML::Document.new(input.respond_to?(:read) ? input.read : input.to_s) end end @@ -331,7 +331,7 @@ def doc_base(base) base_el = ::REXML::XPath.first(@doc, "/html/head/base") rescue nil base = base.join(base_el.attribute("href").to_s.split("#").first) if base_el else - xml_base = root.attribute("base", RDF::XML.to_s) || root.attribute('xml:base') if root + xml_base = root.attribute("base", "http://www.w3.org/XML/1998/namespace") || root.attribute('xml:base') if root base = base.join(xml_base) if xml_base end diff --git a/lib/rdf/rdfa/vocab.rb b/lib/rdf/rdfa/vocab.rb index b2c2b94..bd3cc1d 100644 --- a/lib/rdf/rdfa/vocab.rb +++ b/lib/rdf/rdfa/vocab.rb @@ -155,7 +155,4 @@ module RDF "dc:description": "is the class for all warnings".freeze, subClassOf: "rdfa:PGClass".freeze end - - XML = Class.new(Vocabulary("http://www.w3.org/XML/1998/namespace")) - XSI = Class.new(Vocabulary("http://www.w3.org/2001/XMLSchema-instance")) end From 47f7409a8e9823d07ae4f8de5f72fd232a29c988 Mon Sep 17 00:00:00 2001 From: Gregg Kellogg Date: Sun, 23 Jul 2023 13:42:28 -0700 Subject: [PATCH 3/3] Version 3.2.3. --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index be94e6f..b347b11 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -3.2.2 +3.2.3