From 92c1566f23de5ba9e65ce8cb4999ca16df4447e7 Mon Sep 17 00:00:00 2001 From: Gregg Kellogg Date: Fri, 28 Jan 2022 12:54:29 -0800 Subject: [PATCH 1/8] Update documentation links to use gh-pages, and add action to publish gh-pages from Yard docs. --- .github/workflows/ci.yml | 2 +- .github/workflows/generate-docs.yml | 27 +++++++++++++++++++++++++++ README.md | 6 +++--- lib/spira/persistence.rb | 10 +++++----- lib/spira/type.rb | 2 +- lib/spira/types/any.rb | 2 +- lib/spira/types/anyURI.rb | 2 +- lib/spira/types/boolean.rb | 2 +- lib/spira/types/date.rb | 2 +- lib/spira/types/dateTime.rb | 2 +- lib/spira/types/decimal.rb | 2 +- lib/spira/types/double.rb | 2 +- lib/spira/types/float.rb | 2 +- lib/spira/types/gYear.rb | 2 +- lib/spira/types/int.rb | 2 +- lib/spira/types/integer.rb | 2 +- lib/spira/types/long.rb | 2 +- lib/spira/types/negativeInteger.rb | 2 +- lib/spira/types/nonNegativeInteger.rb | 2 +- lib/spira/types/nonPositiveInteger.rb | 2 +- lib/spira/types/positiveInteger.rb | 2 +- lib/spira/types/string.rb | 2 +- lib/spira/types/time.rb | 2 +- lib/spira/types/uri.rb | 2 +- spira.gemspec | 9 ++++++++- 25 files changed, 64 insertions(+), 30 deletions(-) create mode 100644 .github/workflows/generate-docs.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0aaedb9..9a760e1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,7 +22,7 @@ jobs: ruby: - 2.6 - 2.7 - - 3.0 + - "3.0" - 3.1 - ruby-head - jruby diff --git a/.github/workflows/generate-docs.yml b/.github/workflows/generate-docs.yml new file mode 100644 index 0000000..b8d16ed --- /dev/null +++ b/.github/workflows/generate-docs.yml @@ -0,0 +1,27 @@ +name: Build & deploy documentation +on: + push: + branches: + - master + workflow_dispatch: +jobs: + build: + runs-on: ubuntu-latest + name: Update gh-pages with docs + steps: + - name: Clone repository + uses: actions/checkout@v2 + - name: Set up Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: "3.1" + - name: Install required gem dependencies + run: gem install yard --no-document + - name: Build YARD Ruby Documentation + run: yardoc + - name: Deploy + uses: peaceiris/actions-gh-pages@v3 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./doc/yard + publish_branch: gh-pages diff --git a/README.md b/README.md index 2edff59..ca02588 100644 --- a/README.md +++ b/README.md @@ -226,7 +226,7 @@ end Spira.repository = RDF::Repository.new rolling_stones = Album.for RDF::URI.new('http://example.org/cds/rolling-stones-hits') -# See RDF.rb at https://www.rubydoc.info/github/ruby-rdf/rdf/RDF/Enumerable.html for more information about #has_predicate? +# See RDF.rb at https://ruby-rdf.github.io/rdf/RDF/Enumerable.html for more information about #has_predicate? rolling_stones.has_predicate?(RDF.type) #=> true Album.type #=> RDF::URI('http://example.org/types/album') ``` @@ -392,7 +392,7 @@ are implemented: The default type for a Spira property is `Spira::Types::Any`, which uses `RDF::Literal`'s automatic boxing/unboxing of XSD types as best it can. -See [`RDF::Literal`](https://www.rubydoc.info/github/ruby-rdf/rdf/RDF/Literal.html) for more information. +See [`RDF::Literal`](https://ruby-rdf.github.io/rdf/RDF/Literal.html) for more information. You can implement your own types as well. Your class' serialize method should turn an RDF::Value into a ruby object, and vice versa. @@ -477,7 +477,7 @@ level. You can also access attributes that are not defined as properties. ## Documentation - + ## Support diff --git a/lib/spira/persistence.rb b/lib/spira/persistence.rb index afda836..0713b17 100644 --- a/lib/spira/persistence.rb +++ b/lib/spira/persistence.rb @@ -171,7 +171,7 @@ def create(attributes = nil, options = {}, &block) # @yield [self] Executes a given block and calls `#save!` # @yieldparam [self] self The newly created instance # @return [Spira::Base] The newly created instance - # @see https://www.rubydoc.info/github/ruby-rdf/rdf/RDF/URI.html + # @see https://ruby-rdf.github.io/rdf/RDF/URI.html def for(identifier, attributes = {}, &block) self.project(id_for(identifier), attributes, &block) end @@ -205,7 +205,7 @@ def project(subject, attributes = {}, &block) # @param [Any] identifier # @return [RDF::URI, RDF::Node] # @raise [ArgumentError] If this class cannot create an identifier from the given argument - # @see https://www.rubydoc.info/github/ruby-rdf/rdf/RDF/URI.html + # @see https://ruby-rdf.github.io/rdf/RDF/URI.html # @see Spira.base_uri # @see Spira.for def id_for(identifier) @@ -303,10 +303,10 @@ def destroy!(*args) ## # Enumerate each RDF statement that makes up this projection. This makes # each instance an `RDF::Enumerable`, with all of the nifty benefits - # thereof. See for + # thereof. See for # information on arguments. # - # @see https://www.rubydoc.info/github/ruby-rdf/rdf/RDF/Enumerable.html + # @see https://ruby-rdf.github.io/rdf/RDF/Enumerable.html def each if block_given? self.class.properties.each do |name, property| @@ -333,7 +333,7 @@ def each ## # The number of RDF::Statements this projection has. # - # @see https://www.rubydoc.info/github/ruby-rdf/rdf/RDF/Enumerable.html#count + # @see https://ruby-rdf.github.io/rdf/RDF/Enumerable.html#count def count each.count end diff --git a/lib/spira/type.rb b/lib/spira/type.rb index 0d70e61..6fcee5e 100644 --- a/lib/spira/type.rb +++ b/lib/spira/type.rb @@ -32,7 +32,7 @@ module Spira # `Spira::Type`s include the RDF namespace and thus have all of the base RDF # vocabularies available to them without the `RDF::` prefix. # - # @see https://www.rubydoc.info/github/ruby-rdf/rdf/RDF/Value.html + # @see https://ruby-rdf.github.io/rdf/RDF/Value.html # @see Spira::Resource module Type diff --git a/lib/spira/types/any.rb b/lib/spira/types/any.rb index e3c430d..325a5d8 100644 --- a/lib/spira/types/any.rb +++ b/lib/spira/types/any.rb @@ -6,7 +6,7 @@ module Spira::Types # Its behavior is defined as 'What `RDF::Literal` does' for a given value. # # @see Spira::Type - # @see https://www.rubydoc.info/github/ruby-rdf/rdf/RDF/Literal.html + # @see https://ruby-rdf.github.io/rdf/RDF/Literal.html class Any include Spira::Type diff --git a/lib/spira/types/anyURI.rb b/lib/spira/types/anyURI.rb index db51b48..3884233 100644 --- a/lib/spira/types/anyURI.rb +++ b/lib/spira/types/anyURI.rb @@ -8,7 +8,7 @@ module Spira::Types # `Spira::Types::AnyURI`, `AnyURI`, or `XSD.anyURI`. # # @see Spira::Type - # @see https://www.rubydoc.info/github/ruby-rdf/rdf/RDF/Literal.html + # @see https://ruby-rdf.github.io/rdf/RDF/Literal.html class AnyURI include Spira::Type diff --git a/lib/spira/types/boolean.rb b/lib/spira/types/boolean.rb index 8c855c1..396be3e 100644 --- a/lib/spira/types/boolean.rb +++ b/lib/spira/types/boolean.rb @@ -8,7 +8,7 @@ module Spira::Types # `Spira::Types::Boolean`, `Boolean`, or `XSD.boolean`. # # @see Spira::Type - # @see https://www.rubydoc.info/github/ruby-rdf/rdf/RDF/Literal.html + # @see https://ruby-rdf.github.io/rdf/RDF/Literal.html class Boolean include Spira::Type diff --git a/lib/spira/types/date.rb b/lib/spira/types/date.rb index 6919e65..6277614 100644 --- a/lib/spira/types/date.rb +++ b/lib/spira/types/date.rb @@ -8,7 +8,7 @@ module Spira::Types # `Spira::Types::Date`, `Date`, or `XSD.date`. # # @see Spira::Type - # @see https://www.rubydoc.info/github/ruby-rdf/rdf/RDF/Literal.html + # @see https://ruby-rdf.github.io/rdf/RDF/Literal.html class Date include Spira::Type diff --git a/lib/spira/types/dateTime.rb b/lib/spira/types/dateTime.rb index b7f30e1..2b23977 100644 --- a/lib/spira/types/dateTime.rb +++ b/lib/spira/types/dateTime.rb @@ -8,7 +8,7 @@ module Spira::Types # `Spira::Types::DateTime`, `DateTime`, or `XSD.dateTime`. # # @see Spira::Type - # @see https://www.rubydoc.info/github/ruby-rdf/rdf/RDF/Literal.html + # @see https://ruby-rdf.github.io/rdf/RDF/Literal.html class DateTime include Spira::Type diff --git a/lib/spira/types/decimal.rb b/lib/spira/types/decimal.rb index 60f4fd4..0fbe848 100644 --- a/lib/spira/types/decimal.rb +++ b/lib/spira/types/decimal.rb @@ -10,7 +10,7 @@ module Spira::Types # `Spira::Types::Integer`, `Integer`, or `XSD.integer`. # # @see Spira::Type - # @see https://www.rubydoc.info/github/ruby-rdf/rdf/RDF/Literal.html + # @see https://ruby-rdf.github.io/rdf/RDF/Literal.html class Decimal include Spira::Type diff --git a/lib/spira/types/double.rb b/lib/spira/types/double.rb index f95db08..4e0f719 100644 --- a/lib/spira/types/double.rb +++ b/lib/spira/types/double.rb @@ -8,7 +8,7 @@ module Spira::Types # `Spira::Types::Double`, `Double`, or `XSD.double`. # # @see Spira::Type - # @see https://www.rubydoc.info/github/ruby-rdf/rdf/RDF/Literal.html + # @see https://ruby-rdf.github.io/rdf/RDF/Literal.html class Double include Spira::Type diff --git a/lib/spira/types/float.rb b/lib/spira/types/float.rb index aa0c69c..fbe8641 100644 --- a/lib/spira/types/float.rb +++ b/lib/spira/types/float.rb @@ -8,7 +8,7 @@ module Spira::Types # `Spira::Types::Float`, `Float`, or `XSD.float`. # # @see Spira::Type - # @see https://www.rubydoc.info/github/ruby-rdf/rdf/RDF/Literal.html + # @see https://ruby-rdf.github.io/rdf/RDF/Literal.html class Float include Spira::Type diff --git a/lib/spira/types/gYear.rb b/lib/spira/types/gYear.rb index 576b8e5..17b1519 100644 --- a/lib/spira/types/gYear.rb +++ b/lib/spira/types/gYear.rb @@ -8,7 +8,7 @@ module Spira::Types # `Spira::Types::GYear`, `GYear`, or `XSD.gYear`. # # @see Spira::Type - # @see https://www.rubydoc.info/github/ruby-rdf/rdf/RDF/Literal.html + # @see https://ruby-rdf.github.io/rdf/RDF/Literal.html class GYear include Spira::Type diff --git a/lib/spira/types/int.rb b/lib/spira/types/int.rb index 2f50f28..299aed4 100644 --- a/lib/spira/types/int.rb +++ b/lib/spira/types/int.rb @@ -8,7 +8,7 @@ module Spira::Types # `Spira::Types::Int`, `Int`, or `XSD.int`. # # @see Spira::Type - # @see https://www.rubydoc.info/github/ruby-rdf/rdf/RDF/Literal.html + # @see https://ruby-rdf.github.io/rdf/RDF/Literal.html class Int include Spira::Type diff --git a/lib/spira/types/integer.rb b/lib/spira/types/integer.rb index ca2ca4c..7670128 100644 --- a/lib/spira/types/integer.rb +++ b/lib/spira/types/integer.rb @@ -8,7 +8,7 @@ module Spira::Types # `Spira::Types::Integer`, `Integer`, or `XSD.integer`. # # @see Spira::Type - # @see https://www.rubydoc.info/github/ruby-rdf/rdf/RDF/Literal.html + # @see https://ruby-rdf.github.io/rdf/RDF/Literal.html class Integer include Spira::Type diff --git a/lib/spira/types/long.rb b/lib/spira/types/long.rb index 27e1050..d19912b 100644 --- a/lib/spira/types/long.rb +++ b/lib/spira/types/long.rb @@ -8,7 +8,7 @@ module Spira::Types # `Spira::Types::Long`, `Long`, or `XSD.long`. # # @see Spira::Type - # @see https://www.rubydoc.info/github/ruby-rdf/rdf/RDF/Literal.html + # @see https://ruby-rdf.github.io/rdf/RDF/Literal.html class Long include Spira::Type diff --git a/lib/spira/types/negativeInteger.rb b/lib/spira/types/negativeInteger.rb index b007717..4dbbc68 100644 --- a/lib/spira/types/negativeInteger.rb +++ b/lib/spira/types/negativeInteger.rb @@ -8,7 +8,7 @@ module Spira::Types # `Spira::Types::NegativeInteger`, `NegativeInteger`, or `XSD.negativeInteger`. # # @see Spira::Type - # @see https://www.rubydoc.info/github/ruby-rdf/rdf/RDF/Literal.html + # @see https://ruby-rdf.github.io/rdf/RDF/Literal.html class NegativeInteger include Spira::Type diff --git a/lib/spira/types/nonNegativeInteger.rb b/lib/spira/types/nonNegativeInteger.rb index ec5d728..cd132d9 100644 --- a/lib/spira/types/nonNegativeInteger.rb +++ b/lib/spira/types/nonNegativeInteger.rb @@ -8,7 +8,7 @@ module Spira::Types # `Spira::Types::NonNegativeInteger`, `NonNegativeInteger`, or `XSD.nonNegativeInteger`. # # @see Spira::Type - # @see https://www.rubydoc.info/github/ruby-rdf/rdf/RDF/Literal.html + # @see https://ruby-rdf.github.io/rdf/RDF/Literal.html class NonNegativeInteger include Spira::Type diff --git a/lib/spira/types/nonPositiveInteger.rb b/lib/spira/types/nonPositiveInteger.rb index c5fd73e..70baf28 100644 --- a/lib/spira/types/nonPositiveInteger.rb +++ b/lib/spira/types/nonPositiveInteger.rb @@ -8,7 +8,7 @@ module Spira::Types # `Spira::Types::NonPositiveInteger`, `NonPositiveInteger`, or `XSD.nonPositiveInteger`. # # @see Spira::Type - # @see https://www.rubydoc.info/github/ruby-rdf/rdf/RDF/Literal.html + # @see https://ruby-rdf.github.io/rdf/RDF/Literal.html class NonPositiveInteger include Spira::Type diff --git a/lib/spira/types/positiveInteger.rb b/lib/spira/types/positiveInteger.rb index 61ff362..c032733 100644 --- a/lib/spira/types/positiveInteger.rb +++ b/lib/spira/types/positiveInteger.rb @@ -8,7 +8,7 @@ module Spira::Types # `Spira::Types::PositiveInteger`, `PositiveInteger`, or `XSD.positiveInteger`. # # @see Spira::Type - # @see https://www.rubydoc.info/github/ruby-rdf/rdf/RDF/Literal.html + # @see https://ruby-rdf.github.io/rdf/RDF/Literal.html class PositiveInteger include Spira::Type diff --git a/lib/spira/types/string.rb b/lib/spira/types/string.rb index f63b52d..cb13187 100644 --- a/lib/spira/types/string.rb +++ b/lib/spira/types/string.rb @@ -8,7 +8,7 @@ module Spira::Types # `Spira::Types::String`, `String`, or `XSD.string`. # # @see Spira::Type - # @see https://www.rubydoc.info/github/ruby-rdf/rdf/RDF/Literal.html + # @see https://ruby-rdf.github.io/rdf/RDF/Literal.html class String include Spira::Type diff --git a/lib/spira/types/time.rb b/lib/spira/types/time.rb index 9562b85..18962e9 100644 --- a/lib/spira/types/time.rb +++ b/lib/spira/types/time.rb @@ -8,7 +8,7 @@ module Spira::Types # `Spira::Types::Time`, `Time`, or `XSD.time`. # # @see Spira::Type - # @see https://www.rubydoc.info/github/ruby-rdf/rdf/RDF/Literal.html + # @see https://ruby-rdf.github.io/rdf/RDF/Literal.html class Time include Spira::Type diff --git a/lib/spira/types/uri.rb b/lib/spira/types/uri.rb index 5176e9c..b547dc6 100644 --- a/lib/spira/types/uri.rb +++ b/lib/spira/types/uri.rb @@ -5,7 +5,7 @@ module Spira::Types # ruby representation. # # @see Spira::Type - # @see https://www.rubydoc.info/github/ruby-rdf/rdf/RDF/URI.html + # @see https://ruby-rdf.github.io/rdf/RDF/URI.html class URI include Spira::Type diff --git a/spira.gemspec b/spira.gemspec index b3e6c85..e2a9358 100755 --- a/spira.gemspec +++ b/spira.gemspec @@ -9,10 +9,17 @@ Gem::Specification.new do |gem| gem.date = Time.now.strftime('%Y-%m-%d') gem.name = 'spira' - gem.homepage = 'https://ruby-rdf.github.io/spira/' + gem.homepage = 'https://github.com/ruby-rdf/spira' gem.license = 'Unlicense' gem.summary = 'A framework for using the information in RDF.rb repositories as model objects.' gem.description = 'Spira is a framework for using the information in RDF.rb repositories as model objects.' + gem.metadata = { + "documentation_uri" => "https://ruby-rdf.github.io/spira", + "bug_tracker_uri" => "https://github.com/ruby-rdf/spira/issues", + "homepage_uri" => "https://github.com/ruby-rdf/spira", + "mailing_list_uri" => "https://lists.w3.org/Archives/Public/public-rdf-ruby/", + "source_code_uri" => "https://github.com/ruby-rdf/spira", + } gem.authors = ['Ben Lavender'] gem.email = 'blavender@gmail.com' From e1ca9c91bd1a1b36dd1db60e55d149cc2890a27c Mon Sep 17 00:00:00 2001 From: Gregg Kellogg Date: Wed, 4 Jan 2023 13:40:59 -0800 Subject: [PATCH 2/8] CI on 3.2. --- .github/workflows/ci.yml | 10 ++-------- .github/workflows/generate-docs.yml | 2 +- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9a760e1..c3e9a06 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: [2.6, 2.7, '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: 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: From f94d77f05c45bf9c214721e0791fc2c9f346acda Mon Sep 17 00:00:00 2001 From: Gregg Kellogg Date: Wed, 3 May 2023 15:27:42 -0700 Subject: [PATCH 3/8] Update badges --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index ca02588..622a860 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Spira -[![Gem Version](https://badge.fury.io/rb/spira.png)](https://badge.fury.io/rb/spira) +[![Gem Version](https://badge.fury.io/rb/spira.svg)](https://badge.fury.io/rb/spira) [![Build Status](https://github.com/ruby-rdf/spira/workflows/CI/badge.svg?branch=develop)](https://github.com/ruby-rdf/spira/actions?query=workflow%3ACI) [![Coverage Status](https://coveralls.io/repos/ruby-rdf/spira/badge.png?branch=develop)](https://coveralls.io/r/ruby-rdf/spira) [![Code Climate](https://codeclimate.com/github/ruby-rdf/spira.png)](https://codeclimate.com/github/ruby-rdf/spira) From b50e46f17d26c815e3d962e56556e8cd41cdc767 Mon Sep 17 00:00:00 2001 From: Gregg Kellogg Date: Thu, 4 May 2023 15:16:13 -0700 Subject: [PATCH 4/8] Improve comparison of time values. --- spec/types/time_spec.rb | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/spec/types/time_spec.rb b/spec/types/time_spec.rb index d2a64df..49e027d 100644 --- a/spec/types/time_spec.rb +++ b/spec/types/time_spec.rb @@ -2,24 +2,22 @@ describe Spira::Types::Time do - before :all do - @time = Time.now - end + let!(:time) {Time.now} context "when serializing" do it "should serialize times to XSD times" do - serialized = Spira::Types::Time.serialize(@time) + serialized = Spira::Types::Time.serialize(time) expect(serialized).to be_a RDF::Literal expect(serialized).to have_datatype expect(serialized.datatype).to eql RDF::XSD.time - expect(serialized).to eql RDF::Literal.new(@time, datatype: RDF::XSD.time) + expect(serialized).to eql RDF::Literal.new(time, datatype: RDF::XSD.time) end end context "when unserializing" do it "should unserialize XSD times to times" do - value = Spira::Types::Time.unserialize(RDF::Literal.new(@time, datatype: RDF::XSD.time)) - expect(value).to eq @time + value = Spira::Types::Time.unserialize(RDF::Literal.new(time, datatype: RDF::XSD.time)) + expect(value.strftime("%H:%M:%S")).to eq time.strftime("%H:%M:%S") end end end \ No newline at end of file From a54366f4bd12169aff25517c756099089132c928 Mon Sep 17 00:00:00 2001 From: Gregg Kellogg Date: Thu, 4 May 2023 15:16:30 -0700 Subject: [PATCH 5/8] Update method signature for queries. --- spec/querying_spec.rb | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/spec/querying_spec.rb b/spec/querying_spec.rb index 3e1d5c2..12c51b8 100644 --- a/spec/querying_spec.rb +++ b/spec/querying_spec.rb @@ -155,7 +155,7 @@ class ::LoadTest < Spira::Base it "should not query the repository when loading a parent and not accessing a child" do name_statements = parent_statements.select {|st| st.predicate == RDF::Vocab::FOAF.name } - expect(repo).to receive(:query).with(subject: uri).once.and_return(name_statements) + expect(repo).to receive(:query).with({subject: uri}).once.and_return(name_statements) test = uri.as(LoadTest) test.name @@ -163,8 +163,8 @@ class ::LoadTest < Spira::Base it "should query the repository when loading a parent and accessing a field on a child" do name_statements = parent_statements.select {|st| st.predicate == RDF::Vocab::FOAF.name } - expect(repo).to receive(:query).with(subject: uri).once.and_return(parent_statements) - expect(repo).to receive(:query).with(subject: child_uri).once.and_return(name_statements) + expect(repo).to receive(:query).with({subject: uri}).once.and_return(parent_statements) + expect(repo).to receive(:query).with({subject: child_uri}).once.and_return(name_statements) test = uri.as(LoadTest) test.child.name @@ -172,8 +172,8 @@ class ::LoadTest < Spira::Base it "should not re-query to access a child twice" do name_statements = parent_statements.select {|st| st.predicate == RDF::Vocab::FOAF.name } - expect(repo).to receive(:query).with(subject: uri).once.and_return(parent_statements) - expect(repo).to receive(:query).with(subject: child_uri).once.and_return(name_statements) + expect(repo).to receive(:query).with({subject: uri}).once.and_return(parent_statements) + expect(repo).to receive(:query).with({subject: child_uri}).once.and_return(name_statements) test = uri.as(LoadTest) 2.times { test.child.name } @@ -181,8 +181,8 @@ class ::LoadTest < Spira::Base it "should re-query to access a child's parent from the child" do name_statements = parent_statements.select {|st| st.predicate == RDF::Vocab::FOAF.name } - expect(repo).to receive(:query).with(subject: uri).twice.and_return(parent_statements) - expect(repo).to receive(:query).with(subject: child_uri).once.and_return(child_statements) + expect(repo).to receive(:query).with({subject: uri}).twice.and_return(parent_statements) + expect(repo).to receive(:query).with({subject: child_uri}).once.and_return(child_statements) test = uri.as(LoadTest) 3.times do @@ -193,8 +193,8 @@ class ::LoadTest < Spira::Base it "should re-query for children after a #reload" do parent_name_statements = parent_statements.select {|st| st.predicate == RDF::Vocab::FOAF.name } child_name_statements = child_statements.select {|st| st.predicate == RDF::Vocab::FOAF.name } - expect(repo).to receive(:query).with(subject: uri).exactly(4).times.and_return(parent_statements) - expect(repo).to receive(:query).with(subject: child_uri).twice.and_return(child_statements) + expect(repo).to receive(:query).with({subject: uri}).exactly(4).times.and_return(parent_statements) + expect(repo).to receive(:query).with({subject: child_uri}).twice.and_return(child_statements) test = uri.as(LoadTest) expect(test.child.child.name).to eql "a name" From a2d7575c8ad3493890c1434c9fc690720f74fa89 Mon Sep 17 00:00:00 2001 From: Gregg Kellogg Date: Thu, 4 May 2023 15:16:49 -0700 Subject: [PATCH 6/8] Fix date comparisons. --- spec/types/date_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/types/date_spec.rb b/spec/types/date_spec.rb index 69127de..eea3965 100644 --- a/spec/types/date_spec.rb +++ b/spec/types/date_spec.rb @@ -19,7 +19,7 @@ context "when unserializing" do it "should unserialize XSD dates to dates" do value = Spira::Types::Date.unserialize(RDF::Literal.new(@date, datatype: RDF::XSD.date)) - expect(value).to equal @date + expect(value).to eql @date end end From a8b3fff415a4ab597d662045d957e405f46677be Mon Sep 17 00:00:00 2001 From: Gregg Kellogg Date: Sat, 26 Aug 2023 15:32:22 -0700 Subject: [PATCH 7/8] Updates for version 3.3.0 with minimum Ruby version 3.0. --- .github/workflows/ci.yml | 6 +++--- VERSION | 2 +- spira.gemspec | 22 +++++++++++----------- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c3e9a06..00b888b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,7 +19,7 @@ jobs: strategy: fail-fast: false matrix: - ruby: [2.6, 2.7, '3.0', 3.1, 3.2, ruby-head, jruby] + ruby: ['3.0', 3.1, 3.2, ruby-head, jruby] steps: - name: Clone repository uses: actions/checkout@v3 @@ -32,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/VERSION b/VERSION index 944880f..15a2799 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -3.2.0 +3.3.0 diff --git a/spira.gemspec b/spira.gemspec index e2a9358..bd548db 100755 --- a/spira.gemspec +++ b/spira.gemspec @@ -29,20 +29,20 @@ Gem::Specification.new do |gem| gem.require_paths = %w(lib) gem.has_yardoc = true if gem.respond_to?(:has_yardoc) - 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-isomorphic', '~> 3.2' + gem.add_runtime_dependency 'rdf', '~> 3.3' + gem.add_runtime_dependency 'rdf-isomorphic', '~> 3.3' gem.add_runtime_dependency 'promise', '~> 0.3' - gem.add_runtime_dependency 'activemodel', '~> 6.1' - gem.add_runtime_dependency 'activesupport', '~> 6.1' - gem.add_runtime_dependency 'i18n', '~> 1.8' - - gem.add_development_dependency 'rdf-spec', '~> 3.2' - gem.add_development_dependency 'rdf-turtle', '~> 3.2' - gem.add_development_dependency 'rdf-vocab', '~> 3.2' - gem.add_development_dependency 'rspec', '~> 3.10' + gem.add_runtime_dependency 'activemodel', '~> 7.0' + gem.add_runtime_dependency 'activesupport', '~> 7.0' + gem.add_runtime_dependency 'i18n', '~> 1.14' + + gem.add_development_dependency 'rdf-spec', '~> 3.3' + gem.add_development_dependency 'rdf-turtle', '~> 3.3' + gem.add_development_dependency 'rdf-vocab', '~> 3.3' + gem.add_development_dependency 'rspec', '~> 3.12' gem.add_development_dependency 'rspec-its', '~> 1.3' gem.add_development_dependency 'yard', '~> 0.9' From b97c892d4cd972a967a24ce3a3ac17d34c664430 Mon Sep 17 00:00:00 2001 From: Gregg Kellogg Date: Fri, 1 Sep 2023 14:18:49 -0700 Subject: [PATCH 8/8] simplecov 0.22. --- Gemfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile b/Gemfile index 9abfa52..c203c5a 100644 --- a/Gemfile +++ b/Gemfile @@ -18,7 +18,7 @@ group :development, :test do end group :test do - gem 'simplecov', '~> 0.21', platforms: :mri + gem 'simplecov', '~> 0.22', platforms: :mri gem 'simplecov-lcov', '~> 0.8', platforms: :mri gem 'guard' #, '~> 2.13.0' gem 'guard-rspec' #, '~> 3.1.0'