From 0f66a7be178d4521c69802acb9cb1671d0381f33 Mon Sep 17 00:00:00 2001 From: Gregg Kellogg Date: Wed, 11 Aug 2021 12:46:49 -0700 Subject: [PATCH 1/7] Update CI for coveralls. --- .github/workflows/ci.yml | 10 +++++++--- .travis.yml | 17 ----------------- Gemfile | 7 +++---- spec/spec_helper.rb | 11 +++++++++-- 4 files changed, 19 insertions(+), 26 deletions(-) delete mode 100644 .travis.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 866a35f..0b53c2f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,11 +16,11 @@ jobs: runs-on: ubuntu-latest env: CI: true + ALLOW_FAILURES: ${{ endsWith(matrix.ruby, 'head') }} strategy: fail-fast: false matrix: ruby: - - 2.4 - 2.5 - 2.6 - 2.7 @@ -42,5 +42,9 @@ jobs: - name: Install dependencies run: bundle install --jobs 4 --retry 3 - name: Run tests - run: bundle exec rspec spec - + run: bundle exec rspec spec || $ALLOW_FAILURES + - name: Coveralls GitHub Action + uses: coverallsapp/github-action@v1.1.2 + if: "matrix.ruby == '3.0'" + with: + github-token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index ce02a16..0000000 --- a/.travis.yml +++ /dev/null @@ -1,17 +0,0 @@ -language: ruby -script: "bundle exec rspec spec" -env: - - CI=true -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/Gemfile b/Gemfile index 8f367ff..3782c49 100644 --- a/Gemfile +++ b/Gemfile @@ -7,6 +7,7 @@ gem 'rdf', branch: 'develop' group :development, :test do + gem 'earl-report', platform: :mri gem 'json-ld', git: 'https://github.com/ruby-rdf/json-ld.git', branch: 'develop' gem 'rdf-isomorphic', git: 'https://github.com/ruby-rdf/rdf-isomorphic.git', branch: 'develop' gem 'rdf-ordered-repo', git: 'https://github.com/ruby-rdf/rdf-ordered-repo.git', branch: 'develop' @@ -18,10 +19,8 @@ group :development, :test do gem 'sxp', git: 'https://github.com/dryruby/sxp.rb.git', branch: 'develop' gem 'rake' - gem 'simplecov', '~> 0.16', platform: :mri - gem 'coveralls', '~> 0.8', '>= 0.8.23', platform: :mri - - gem 'earl-report', platform: :mri + gem 'simplecov', '~> 0.21', platforms: :mri + gem 'simplecov-lcov', '~> 0.8', platforms: :mri end group :debug do diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index c4b93bd..a452739 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -6,10 +6,17 @@ require 'rdf/ordered_repo' begin require 'simplecov' - require 'coveralls' + require 'simplecov-lcov' + + SimpleCov::Formatter::LcovFormatter.config do |config| + #Coveralls is coverage by default/lcov. Send info results + config.report_with_single_file = true + config.single_report_path = 'coverage/lcov.info' + end + SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter.new([ SimpleCov::Formatter::HTMLFormatter, - Coveralls::SimpleCov::Formatter + SimpleCov::Formatter::LcovFormatter ]) SimpleCov.start do add_filter "/spec/" From 0244b4892907ec9720ff6991c4c8d117fbf13121 Mon Sep 17 00:00:00 2001 From: Gregg Kellogg Date: Tue, 26 Oct 2021 11:42:37 -0700 Subject: [PATCH 2/7] Update CI. --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0b53c2f..06055be 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -42,7 +42,7 @@ jobs: - name: Install dependencies run: bundle install --jobs 4 --retry 3 - name: Run tests - run: bundle exec rspec spec || $ALLOW_FAILURES + 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'" From f5b0bd5152e2f4e19ede027811c6af63bcf929f8 Mon Sep 17 00:00:00 2001 From: Gregg Kellogg Date: Mon, 13 Dec 2021 12:22:33 -0800 Subject: [PATCH 3/7] Update documentation, dependencies, and version sync for 0.2. --- .github/workflows/ci.yml | 1 - Gemfile | 1 + README.md | 10 +++++----- VERSION | 2 +- shacl.gemspec | 16 ++++++++-------- 5 files changed, 15 insertions(+), 15 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 06055be..d2cd042 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -21,7 +21,6 @@ jobs: fail-fast: false matrix: ruby: - - 2.5 - 2.6 - 2.7 - 3.0 diff --git a/Gemfile b/Gemfile index 3782c49..9ca0e18 100644 --- a/Gemfile +++ b/Gemfile @@ -10,6 +10,7 @@ group :development, :test do gem 'earl-report', platform: :mri gem 'json-ld', git: 'https://github.com/ruby-rdf/json-ld.git', branch: 'develop' gem 'rdf-isomorphic', git: 'https://github.com/ruby-rdf/rdf-isomorphic.git', branch: 'develop' + gem 'rdf-aggregate-repo', git: 'https://github.com/ruby-rdf/rdf-aggregate-repo.git', branch: 'develop' gem 'rdf-ordered-repo', git: 'https://github.com/ruby-rdf/rdf-ordered-repo.git', branch: 'develop' gem 'rdf-reasoner', git: 'https://github.com/ruby-rdf/rdf-reasoner.git', branch: 'develop' gem 'rdf-spec', git: 'https://github.com/ruby-rdf/rdf-spec.git', branch: 'develop' diff --git a/README.md b/README.md index 6e669b4..068fb8a 100644 --- a/README.md +++ b/README.md @@ -82,11 +82,11 @@ This implementation is certainly not performant. Some things that can be be cons ## Dependencies -* [Ruby](https://ruby-lang.org/) (>= 2.4) -* [RDF.rb](https://rubygems.org/gems/rdf) (~> 3.1, => 3.1.8) -* [SPARQL](https://rubygems.org/gems/sparql) (~> 3.1, => 3.1.4) -* [json-ld](https://rubygems.org/gems/sparql) (~> 3.1, => 3.1.7) -* [sxp](https://rubygems.org/gems/sxp) (~> 1.1) +* [Ruby](https://ruby-lang.org/) (>= 2.6) +* [RDF.rb](https://rubygems.org/gems/rdf) (~> 3.2) +* [SPARQL](https://rubygems.org/gems/sparql) (~> 3.2) +* [json-ld](https://rubygems.org/gems/json-ld) (~> 3.2) +* [sxp](https://rubygems.org/gems/sxp) (~> 1.2) ## Installation diff --git a/VERSION b/VERSION index 17e51c3..0ea3a94 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.1.1 +0.2.0 diff --git a/shacl.gemspec b/shacl.gemspec index b1b871c..601021f 100755 --- a/shacl.gemspec +++ b/shacl.gemspec @@ -18,16 +18,16 @@ Gem::Specification.new do |gem| gem.files = %w(README.md LICENSE VERSION etc/doap.ttl) + Dir.glob('lib/**/*.rb') gem.require_paths = %w(lib) - gem.required_ruby_version = '>= 2.4' + gem.required_ruby_version = '>= 2.6' gem.requirements = [] - gem.add_runtime_dependency 'rdf', '~> 3.1', '>= 3.1.8' - gem.add_runtime_dependency 'json-ld', '~> 3.1', '>= 3.1.7' - gem.add_runtime_dependency 'sxp', '~> 1.1' - gem.add_runtime_dependency 'sparql', '~> 3.1' + gem.add_runtime_dependency 'rdf', '~> 3.2' + gem.add_runtime_dependency 'json-ld', '~> 3.2' + gem.add_runtime_dependency 'sxp', '~> 1.2' + gem.add_runtime_dependency 'sparql', '~> 3.2' - gem.add_development_dependency 'rdf-spec', '~> 3.1' - gem.add_development_dependency 'rdf-turtle', '~> 3.1' - gem.add_development_dependency 'rdf-xsd', '~> 3.1' + gem.add_development_dependency 'rdf-spec', '~> 3.2' + gem.add_development_dependency 'rdf-turtle', '~> 3.2' + gem.add_development_dependency 'rdf-xsd', '~> 3.2' gem.add_development_dependency 'rspec', '~> 3.10' gem.add_development_dependency 'rspec-its', '~> 1.3' gem.add_development_dependency 'yard', '~> 0.9' From 095caae7b233abe5dee9288be184254367ef4acc Mon Sep 17 00:00:00 2001 From: Gregg Kellogg Date: Thu, 16 Dec 2021 15:27:43 -0800 Subject: [PATCH 4/7] Synch with SXP changes in version 1.2 of the SXP gem. --- Gemfile | 2 +- lib/shacl/shapes.rb | 10 ++++++++-- lib/shacl/validation_report.rb | 10 ++++++++-- lib/shacl/validation_result.rb | 10 ++++++++-- 4 files changed, 25 insertions(+), 7 deletions(-) diff --git a/Gemfile b/Gemfile index 9ca0e18..292c540 100644 --- a/Gemfile +++ b/Gemfile @@ -7,7 +7,6 @@ gem 'rdf', branch: 'develop' group :development, :test do - gem 'earl-report', platform: :mri gem 'json-ld', git: 'https://github.com/ruby-rdf/json-ld.git', branch: 'develop' gem 'rdf-isomorphic', git: 'https://github.com/ruby-rdf/rdf-isomorphic.git', branch: 'develop' gem 'rdf-aggregate-repo', git: 'https://github.com/ruby-rdf/rdf-aggregate-repo.git', branch: 'develop' @@ -17,6 +16,7 @@ group :development, :test do gem 'rdf-turtle', git: 'https://github.com/ruby-rdf/rdf-turtle.git', branch: 'develop' gem 'rdf-xsd', git: 'https://github.com/ruby-rdf/rdf-xsd.git', branch: 'develop' gem 'sparql', git: 'https://github.com/ruby-rdf/sparql.git', branch: 'develop' + gem 'sparql-client', git: 'https://github.com/ruby-rdf/sparql-client.git', branch: 'develop' gem 'sxp', git: 'https://github.com/dryruby/sxp.rb.git', branch: 'develop' gem 'rake' diff --git a/lib/shacl/shapes.rb b/lib/shacl/shapes.rb index 2031c69..1d7c9ef 100644 --- a/lib/shacl/shapes.rb +++ b/lib/shacl/shapes.rb @@ -102,8 +102,14 @@ def to_sxp_bin [:shapes, super] end - def to_sxp - to_sxp_bin.to_sxp + ## + # Transform Shapes into an SXP. + # + # @param [Hash{Symbol => RDF::URI}] prefixes(nil) + # @param [RDF::URI] base_uri(nil) + # @return [String] + def to_sxp(prefixes: nil, base_uri: nil) + to_sxp_bin.to_sxp(prefixes: prefixes, base_uri: base_uri) end SHAPES_FRAME = JSON.parse(%({ diff --git a/lib/shacl/validation_report.rb b/lib/shacl/validation_report.rb index 3cb6be3..c9518b3 100644 --- a/lib/shacl/validation_report.rb +++ b/lib/shacl/validation_report.rb @@ -59,8 +59,14 @@ def to_sxp_bin [:ValidationReport, conform?, results].to_sxp_bin end - def to_sxp - self.to_sxp_bin.to_sxp + ## + # Transform Report to SXP + # + # @param [Hash{Symbol => RDF::URI}] prefixes(nil) + # @param [RDF::URI] base_uri(nil) + # @return [String] + def to_sxp(prefixes: nil, base_uri: nil) + self.to_sxp_bin.to_sxp(prefixes: prefixes, base_uri: base_uri) end def to_s diff --git a/lib/shacl/validation_result.rb b/lib/shacl/validation_result.rb index 007fec1..a6bd61a 100644 --- a/lib/shacl/validation_result.rb +++ b/lib/shacl/validation_result.rb @@ -50,8 +50,14 @@ def to_sxp_bin end.to_sxp_bin end - def to_sxp - self.to_sxp_bin.to_sxp + ## + # Transform ValidationResult to SXP + # + # @param [Hash{Symbol => RDF::URI}] prefixes(nil) + # @param [RDF::URI] base_uri(nil) + # @return [String] + def to_sxp(prefixes: nil, base_uri: nil) + self.to_sxp_bin.to_sxp(prefixes: prefixes, base_uri: base_uri) end ## From 17b0cfc696326da24b881dded7d6354662f2d952 Mon Sep 17 00:00:00 2001 From: Gregg Kellogg Date: Sun, 19 Dec 2021 12:49:13 -0800 Subject: [PATCH 5/7] Back off on explicit keyword arguments to to_sxp. --- lib/shacl/shapes.rb | 5 ++--- lib/shacl/validation_report.rb | 6 ++---- lib/shacl/validation_result.rb | 6 ++---- 3 files changed, 6 insertions(+), 11 deletions(-) diff --git a/lib/shacl/shapes.rb b/lib/shacl/shapes.rb index 1d7c9ef..fedcf58 100644 --- a/lib/shacl/shapes.rb +++ b/lib/shacl/shapes.rb @@ -105,11 +105,10 @@ def to_sxp_bin ## # Transform Shapes into an SXP. # - # @param [Hash{Symbol => RDF::URI}] prefixes(nil) # @param [RDF::URI] base_uri(nil) # @return [String] - def to_sxp(prefixes: nil, base_uri: nil) - to_sxp_bin.to_sxp(prefixes: prefixes, base_uri: base_uri) + def to_sxp(**options) + to_sxp_bin.to_sxp(**options) end SHAPES_FRAME = JSON.parse(%({ diff --git a/lib/shacl/validation_report.rb b/lib/shacl/validation_report.rb index c9518b3..615e99c 100644 --- a/lib/shacl/validation_report.rb +++ b/lib/shacl/validation_report.rb @@ -62,11 +62,9 @@ def to_sxp_bin ## # Transform Report to SXP # - # @param [Hash{Symbol => RDF::URI}] prefixes(nil) - # @param [RDF::URI] base_uri(nil) # @return [String] - def to_sxp(prefixes: nil, base_uri: nil) - self.to_sxp_bin.to_sxp(prefixes: prefixes, base_uri: base_uri) + def to_sxp(**options) + self.to_sxp_bin.to_sxp(**options) end def to_s diff --git a/lib/shacl/validation_result.rb b/lib/shacl/validation_result.rb index a6bd61a..1ef3f40 100644 --- a/lib/shacl/validation_result.rb +++ b/lib/shacl/validation_result.rb @@ -53,11 +53,9 @@ def to_sxp_bin ## # Transform ValidationResult to SXP # - # @param [Hash{Symbol => RDF::URI}] prefixes(nil) - # @param [RDF::URI] base_uri(nil) # @return [String] - def to_sxp(prefixes: nil, base_uri: nil) - self.to_sxp_bin.to_sxp(prefixes: prefixes, base_uri: base_uri) + def to_sxp(**options) + self.to_sxp_bin.to_sxp(**options) end ## From 25941cf0a13d277a2eff30aa48dcb44e5582ab7a Mon Sep 17 00:00:00 2001 From: Gregg Kellogg Date: Sun, 26 Dec 2021 22:47:01 -0800 Subject: [PATCH 6/7] CI on Ruby 3.1. --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d2cd042..fac4ca8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -24,6 +24,7 @@ jobs: - 2.6 - 2.7 - 3.0 + - 3.1 - ruby-head - jruby steps: From cd2018505988750c625dbe15a231ef3ffdd87689 Mon Sep 17 00:00:00 2001 From: Gregg Kellogg Date: Wed, 29 Dec 2021 12:26:35 -0800 Subject: [PATCH 7/7] Minor yard update. --- lib/shacl/shapes.rb | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/shacl/shapes.rb b/lib/shacl/shapes.rb index fedcf58..fb92864 100644 --- a/lib/shacl/shapes.rb +++ b/lib/shacl/shapes.rb @@ -105,7 +105,6 @@ def to_sxp_bin ## # Transform Shapes into an SXP. # - # @param [RDF::URI] base_uri(nil) # @return [String] def to_sxp(**options) to_sxp_bin.to_sxp(**options)