From d168eb5a0031d3e7bf8edaf4d52d0226fd49d986 Mon Sep 17 00:00:00 2001 From: Gregg Kellogg Date: Sat, 18 Jul 2020 18:04:41 -0700 Subject: [PATCH 01/11] Update log formatting for constant-width severity, which makes tracing indented logs simpler. --- lib/rdf/spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/rdf/spec.rb b/lib/rdf/spec.rb index ae33acd..4242b55 100644 --- a/lib/rdf/spec.rb +++ b/lib/rdf/spec.rb @@ -87,7 +87,7 @@ def to_s end end logger.level = Logger::DEBUG - logger.formatter = lambda {|severity, datetime, progname, msg| "#{severity} #{msg}\n"} + logger.formatter = lambda {|severity, datetime, progname, msg| "%5s %s\n" % [severity, msg]} logger end end # Spec From 579f921d5019c26cc96a01ebb727abb1dcbb398e Mon Sep 17 00:00:00 2001 From: Gregg Kellogg Date: Sun, 25 Oct 2020 16:45:29 -0700 Subject: [PATCH 02/11] Update PDD info in the README. --- CONTRIBUTING.md | 8 +++++--- README.md | 6 ++++-- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 06403de..7e21071 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-spec/compare/ +[PDD]: https://unlicense.org/#unlicensing-contributions +[pr]: https://github.com/ruby-rdf/rdf/compare/ diff --git a/README.md b/README.md index ec49636..560f867 100644 --- a/README.md +++ b/README.md @@ -76,7 +76,9 @@ follows: 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. License ------- @@ -87,4 +89,4 @@ see or the accompanying {file:UNLICENSE} file. [RDF.rb]: https://rubygems.org/gems/rdf [RSpec]: https://rspec.info/ [RubySpec]: https://rubyspec.org/wiki/rubyspec/Style_Guide -[PDD]: https://lists.w3.org/Archives/Public/public-rdf-ruby/2010May/0013.html +[PDD]: https://unlicense.org/#unlicensing-contributions From 61d02e254eea91ddf1efd1a668652e4129eacbee Mon Sep 17 00:00:00 2001 From: Gregg Kellogg Date: Sun, 8 Nov 2020 16:39:36 -0800 Subject: [PATCH 03/11] Allow other options to be used when serialzing results in `be_equivalent_graph`. --- lib/rdf/spec/matchers.rb | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/lib/rdf/spec/matchers.rb b/lib/rdf/spec/matchers.rb index e2eeec3..6a9a256 100644 --- a/lib/rdf/spec/matchers.rb +++ b/lib/rdf/spec/matchers.rb @@ -266,16 +266,18 @@ def io_name end end - Info = Struct.new(:id, :logger, :action, :result, :format) + Info = Struct.new(:id, :logger, :action, :result, :format, :options) do + def initialize(id:, logger: nil, action: nil, result: nil, format: nil, options: {}); super end + end RSpec::Matchers.define :be_equivalent_graph do |expected, info| match do |actual| @info = if (info.id rescue false) info elsif info.is_a?(Logger) - Info.new("", info) + Info.new(logger: info) elsif info.is_a?(Hash) - Info.new(info[:id], info[:logger], info[:action], info[:result], info[:format]) + Info.new(options: info, **info) else Info.new(info) end @@ -290,6 +292,7 @@ def io_name end failure_message do |actual| + dump_opts = {standard_prefixes: true, literal_shorthand: false, validate: false}.merge(@info.options) info = @info.respond_to?(:information) ? @info.information : @info.inspect if @expected.is_a?(RDF::Enumerable) && @actual.size != @expected.size "Graph entry counts differ:\nexpected: #{@expected.size}\nactual: #{@actual.size}\n" @@ -297,12 +300,13 @@ def io_name "Graphs differ\n" end + "\n#{info + "\n" unless info.empty?}" + - "Expected:\n#{@expected.dump(@info.format, standard_prefixes: true, literal_shorthand: false, validate: false) rescue @expected.inspect}" + - "Results:\n#{@actual.dump(@info.format, standard_prefixes: true, literal_shorthand: false, validate: false) rescue @actual.inspect}" + + "Expected:\n#{@expected.dump(@info.format, **dump_opts) rescue @expected.inspect}" + + "Results:\n#{@actual.dump(@info.format, **dump_opts) rescue @actual.inspect}" + "\nDebug:\n#{@info.logger}" end failure_message_when_negated do |actual| + dump_opts = {standard_prefixes: true, literal_shorthand: false, validate: false}.merge(@info.options) format = case when RDF.const_defined?(:TriG) then :trig when RDF.const_defined?(:Turtle) then :ttl @@ -311,7 +315,7 @@ def io_name info = @info.respond_to?(:information) ? @info.information : @info.inspect "Graphs identical\n" + "\n#{info + "\n" unless info.empty?}" + - "Results:\n#{actual.dump(@info.format, standard_prefixes: true, literal_shorthand: false, validate: false) rescue @actual.inspect}" + + "Results:\n#{actual.dump(@info.format, **dump_opts) rescue @actual.inspect}" + "\nDebug:\n#{@info.logger}" end From 551d12861f84625532bbadccb9d4bd2216113eef Mon Sep 17 00:00:00 2001 From: Gregg Kellogg Date: Sun, 8 Nov 2020 17:02:19 -0800 Subject: [PATCH 04/11] Update Info again to allow for `base` and `prefixes`, which are passed to `dump`. --- lib/rdf/spec/matchers.rb | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/lib/rdf/spec/matchers.rb b/lib/rdf/spec/matchers.rb index 6a9a256..e3bd4f7 100644 --- a/lib/rdf/spec/matchers.rb +++ b/lib/rdf/spec/matchers.rb @@ -266,9 +266,7 @@ def io_name end end - Info = Struct.new(:id, :logger, :action, :result, :format, :options) do - def initialize(id:, logger: nil, action: nil, result: nil, format: nil, options: {}); super end - end + Info = Struct.new(:id, :logger, :action, :result, :format, :base, :prefixes) RSpec::Matchers.define :be_equivalent_graph do |expected, info| match do |actual| @@ -277,7 +275,7 @@ def initialize(id:, logger: nil, action: nil, result: nil, format: nil, options: elsif info.is_a?(Logger) Info.new(logger: info) elsif info.is_a?(Hash) - Info.new(options: info, **info) + Info.new(info[:id], info[:logger], info[:action], info[:result], info[:format], info[:base], info[:prefixes]) else Info.new(info) end @@ -292,7 +290,13 @@ def initialize(id:, logger: nil, action: nil, result: nil, format: nil, options: end failure_message do |actual| - dump_opts = {standard_prefixes: true, literal_shorthand: false, validate: false}.merge(@info.options) + dump_opts = { + standard_prefixes: true, + literal_shorthand: false, + validate: false, + base_uri: @info.base, + prefixes: @info.prefixes + } info = @info.respond_to?(:information) ? @info.information : @info.inspect if @expected.is_a?(RDF::Enumerable) && @actual.size != @expected.size "Graph entry counts differ:\nexpected: #{@expected.size}\nactual: #{@actual.size}\n" @@ -306,7 +310,13 @@ def initialize(id:, logger: nil, action: nil, result: nil, format: nil, options: end failure_message_when_negated do |actual| - dump_opts = {standard_prefixes: true, literal_shorthand: false, validate: false}.merge(@info.options) + dump_opts = { + standard_prefixes: true, + literal_shorthand: false, + validate: false, + base: @info.base, + prefixes: @info.prefixes + } format = case when RDF.const_defined?(:TriG) then :trig when RDF.const_defined?(:Turtle) then :ttl From 5d89a0d8b24945baa5d6c2a650bf45aec602be2a Mon Sep 17 00:00:00 2001 From: Gregg Kellogg Date: Sat, 21 Nov 2020 12:05:25 -0800 Subject: [PATCH 05/11] Add development dependency on rexml, which seems to be needed for ruby-head and is used for webmock/crack. --- .travis.yml | 2 ++ rdf-spec.gemspec | 1 + 2 files changed, 3 insertions(+) diff --git a/.travis.yml b/.travis.yml index 83a126b..b5997e8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,10 +7,12 @@ rvm: - 2.5 - 2.6 - 2.7 + - ruby-head - jruby cache: bundler sudo: false matrix: allow_failures: - rvm: jruby + - rvm: ruby-head dist: trusty diff --git a/rdf-spec.gemspec b/rdf-spec.gemspec index 17aa173..2880835 100755 --- a/rdf-spec.gemspec +++ b/rdf-spec.gemspec @@ -25,6 +25,7 @@ Gem::Specification.new do |gem| gem.add_runtime_dependency 'rdf-isomorphic', '~> 3.1' gem.add_runtime_dependency 'rspec', '~> 3.9' gem.add_runtime_dependency 'rspec-its', '~> 1.3' + gem.add_development_dependency 'rexml', '~> 3.2' # For Webmock gem.add_runtime_dependency 'webmock', '~> 3.7' gem.add_development_dependency 'yard' , '~> 0.9.20' gem.post_install_message = nil From 50861616756c13466c6b8454344cdb03aeeaa565 Mon Sep 17 00:00:00 2001 From: Gregg Kellogg Date: Sat, 21 Nov 2020 12:23:34 -0800 Subject: [PATCH 06/11] Make rexml a runtime dependency. --- rdf-spec.gemspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rdf-spec.gemspec b/rdf-spec.gemspec index 2880835..4e2eab6 100755 --- a/rdf-spec.gemspec +++ b/rdf-spec.gemspec @@ -25,7 +25,7 @@ Gem::Specification.new do |gem| gem.add_runtime_dependency 'rdf-isomorphic', '~> 3.1' gem.add_runtime_dependency 'rspec', '~> 3.9' gem.add_runtime_dependency 'rspec-its', '~> 1.3' - gem.add_development_dependency 'rexml', '~> 3.2' # For Webmock + gem.add_runtime_dependency 'rexml', '~> 3.2' # For Webmock gem.add_runtime_dependency 'webmock', '~> 3.7' gem.add_development_dependency 'yard' , '~> 0.9.20' gem.post_install_message = nil From de1361a68cf85516e9adc48d39315c355c08885f Mon Sep 17 00:00:00 2001 From: Gregg Kellogg Date: Sat, 19 Dec 2020 16:44:58 -0800 Subject: [PATCH 07/11] Add CI and Gitstamp workflows. --- .github/workflows/ci.yml | 47 +++++++++++++++++++++++++++++++++ .github/workflows/gitstamp.yaml | 19 +++++++++++++ 2 files changed, 66 insertions(+) create mode 100644 .github/workflows/ci.yml create mode 100644 .github/workflows/gitstamp.yaml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..9c47cf4 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,47 @@ +# This workflow runs continuous CI across different versions of ruby on all branches and pull requests to develop. + +name: CI + +# Controls when the action will run. +on: + # Triggers the workflow on push or pull request events but only for the develop branch + push: + branches: [ '**' ] + pull_request: + branches: [ develop ] + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +# A workflow run is made up of one or more jobs that can run sequentially or in parallel +jobs: + # This workflow contains a single job called "build" + tests: + name: Ruby ${{ matrix.ruby }} + if: "contains(github.event.commits[0].message, '[ci skip]') == false" + runs-on: ubuntu-latest + env: + CI: true + ALLOW_FAILURES: false # ${{ endsWith(matrix.ruby, 'head') || matrix.ruby == 'jruby' }} + strategy: + fail-fast: false + matrix: + ruby: + - 2.4 + - 2.5 + - 2.6 + - 2.7 + - ruby-head + - 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 || $ALLOW_FAILURES + diff --git a/.github/workflows/gitstamp.yaml b/.github/workflows/gitstamp.yaml new file mode 100644 index 0000000..20b034a --- /dev/null +++ b/.github/workflows/gitstamp.yaml @@ -0,0 +1,19 @@ +# See: https://github.com/artob/gitstamp-action +--- +name: Gitstamp +on: + push: + branches: + - develop +jobs: + gitstamp: + runs-on: ubuntu-latest + name: Timestamp commit with Gitstamp + steps: + - name: Clone repository + uses: actions/checkout@v2 + - name: Submit Gitstamp transaction + uses: artob/gitstamp-action@v1 + with: + wallet-key: ${{ secrets.GITSTAMP_KEYFILE }} + commit-link: true From eeb3cb09cb02d37bbc9bdcf3838fd17af53a98e5 Mon Sep 17 00:00:00 2001 From: Gregg Kellogg Date: Sat, 19 Dec 2020 16:51:20 -0800 Subject: [PATCH 08/11] Remmove Gitstamp (requires some configuration). Update README with CI status badge. --- .github/workflows/gitstamp.yaml | 19 ------------------- README.md | 5 +++-- 2 files changed, 3 insertions(+), 21 deletions(-) delete mode 100644 .github/workflows/gitstamp.yaml diff --git a/.github/workflows/gitstamp.yaml b/.github/workflows/gitstamp.yaml deleted file mode 100644 index 20b034a..0000000 --- a/.github/workflows/gitstamp.yaml +++ /dev/null @@ -1,19 +0,0 @@ -# See: https://github.com/artob/gitstamp-action ---- -name: Gitstamp -on: - push: - branches: - - develop -jobs: - gitstamp: - runs-on: ubuntu-latest - name: Timestamp commit with Gitstamp - steps: - - name: Clone repository - uses: actions/checkout@v2 - - name: Submit Gitstamp transaction - uses: artob/gitstamp-action@v1 - with: - wallet-key: ${{ secrets.GITSTAMP_KEYFILE }} - commit-link: true diff --git a/README.md b/README.md index 560f867..e88ae9c 100644 --- a/README.md +++ b/README.md @@ -6,8 +6,9 @@ and shared examples for Ruby projects that use RDF.rb and RSpec. * [![Gem Version](https://badge.fury.io/rb/rdf-spec.png)](https://badge.fury.io/rb/rdf-spec) -[![Build Status](https://travis-ci.org/ruby-rdf/rdf-spec.png?branch=master)](https://travis-ci.org/ruby-rdf/rdf-spec) -[![Coverage Status](https://coveralls.io/repos/ruby-rdf/rdf-spec/badge.svg)](https://coveralls.io/r/ruby-rdf/rdf-spec) +[![Build Status](https://github.com/ruby-rdf/rdf-spec/workflows/CI/badge.svg?branch=develop)] +[![Coverage Status](https://coveralls.io/repos/ruby-rdf/rdf-spec/badge.svg)] +![Join the chat at https://gitter.im/ruby-rdf/rdf](https://badges.gitter.im/Join%20Chat.svg)] ## Documentation From 445f4207e8df906ba17b0cf00109f4f8c4f8d95c Mon Sep 17 00:00:00 2001 From: Gregg Kellogg Date: Sat, 19 Dec 2020 16:53:12 -0800 Subject: [PATCH 09/11] Another badge update. --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index e88ae9c..18e4a18 100644 --- a/README.md +++ b/README.md @@ -6,9 +6,9 @@ and shared examples for Ruby projects that use RDF.rb and RSpec. * [![Gem Version](https://badge.fury.io/rb/rdf-spec.png)](https://badge.fury.io/rb/rdf-spec) -[![Build Status](https://github.com/ruby-rdf/rdf-spec/workflows/CI/badge.svg?branch=develop)] -[![Coverage Status](https://coveralls.io/repos/ruby-rdf/rdf-spec/badge.svg)] -![Join the chat at https://gitter.im/ruby-rdf/rdf](https://badges.gitter.im/Join%20Chat.svg)] +![Build Status](https://github.com/ruby-rdf/rdf-spec/workflows/CI/badge.svg?branch=develop) +![Coverage Status](https://coveralls.io/repos/ruby-rdf/rdf-spec/badge.svg) +![Join the chat at https://gitter.im/ruby-rdf/rdf](https://badges.gitter.im/Join%20Chat.svg) ## Documentation From 8deb81f4479ce4139bf49b0c923f95399ef19aaa Mon Sep 17 00:00:00 2001 From: Gregg Kellogg Date: Sat, 19 Dec 2020 17:24:18 -0800 Subject: [PATCH 10/11] Badge updates. --- README.md | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 18e4a18..64252f2 100644 --- a/README.md +++ b/README.md @@ -3,12 +3,10 @@ This is an [RDF.rb][] extension that provides RDF-specific [RSpec][] matchers and shared examples for Ruby projects that use RDF.rb and RSpec. -* - [![Gem Version](https://badge.fury.io/rb/rdf-spec.png)](https://badge.fury.io/rb/rdf-spec) -![Build Status](https://github.com/ruby-rdf/rdf-spec/workflows/CI/badge.svg?branch=develop) -![Coverage Status](https://coveralls.io/repos/ruby-rdf/rdf-spec/badge.svg) -![Join the chat at https://gitter.im/ruby-rdf/rdf](https://badges.gitter.im/Join%20Chat.svg) +[![Build Status](https://github.com/ruby-rdf/rdf-spec/workflows/CI/badge.svg?branch=develop)](https://github.com/ruby-rdf/rdf-spec/actions?query=workflow%3ACI) +[![Coverage Status](https://coveralls.io/repos/ruby-rdf/rdf-spec/badge.svg)](https://coveralls.io/github/ruby-rdf/rdf-spec) +[![Gitter chat](https://badges.gitter.im/ruby-rdf/rdf.png)](https://gitter.im/ruby-rdf/rdf) ## Documentation From ab7c255198bf5c312b456b3358e24ba7cf6127b0 Mon Sep 17 00:00:00 2001 From: Gregg Kellogg Date: Fri, 25 Dec 2020 12:53:41 -0800 Subject: [PATCH 11/11] Version 3.1.2. --- .github/workflows/ci.yml | 4 ++-- Gemfile | 4 ++-- VERSION | 2 +- rdf-spec.gemspec | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9c47cf4..9b20426 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,7 +22,6 @@ jobs: runs-on: ubuntu-latest env: CI: true - ALLOW_FAILURES: false # ${{ endsWith(matrix.ruby, 'head') || matrix.ruby == 'jruby' }} strategy: fail-fast: false matrix: @@ -31,6 +30,7 @@ jobs: - 2.5 - 2.6 - 2.7 + - 3.0 - ruby-head - jruby steps: @@ -43,5 +43,5 @@ jobs: - name: Install dependencies run: bundle install --jobs 4 --retry 3 - name: Run tests - run: bundle exec rspec spec || $ALLOW_FAILURES + run: bundle exec rspec spec diff --git a/Gemfile b/Gemfile index 6cf6ad2..a2d8307 100644 --- a/Gemfile +++ b/Gemfile @@ -10,6 +10,6 @@ group :debug do end group :development, :test do - gem 'simplecov', platforms: :mri - gem 'coveralls', '~> 0.8', platforms: :mri + gem 'simplecov', require: false, platforms: :mri + gem 'coveralls', require: false, platforms: :mri end \ No newline at end of file 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/rdf-spec.gemspec b/rdf-spec.gemspec index 4e2eab6..2ea44e2 100755 --- a/rdf-spec.gemspec +++ b/rdf-spec.gemspec @@ -20,13 +20,13 @@ 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.8' gem.add_runtime_dependency 'awesome_print', '~> 1.8' gem.add_runtime_dependency 'rdf-isomorphic', '~> 3.1' gem.add_runtime_dependency 'rspec', '~> 3.9' gem.add_runtime_dependency 'rspec-its', '~> 1.3' gem.add_runtime_dependency 'rexml', '~> 3.2' # For Webmock gem.add_runtime_dependency 'webmock', '~> 3.7' - gem.add_development_dependency 'yard' , '~> 0.9.20' + gem.add_development_dependency 'yard' , '~> 0.9' gem.post_install_message = nil end