diff --git a/.coveralls.yml b/.coveralls.yml new file mode 100644 index 0000000..814feb3 --- /dev/null +++ b/.coveralls.yml @@ -0,0 +1 @@ +repo_token: YOp34g46QSPvbNL8LTcDmoXuuK69HOOxe diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..a056292 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,44 @@ +# This workflow runs continuous CI across different versions of ruby on all branches and pull requests to develop. + +name: CI +on: + push: + branches: [ '**' ] + pull_request: + branches: [ develop ] + workflow_dispatch: + +jobs: + tests: + name: Ruby ${{ matrix.ruby }} + if: "contains(github.event.commits[0].message, '[ci skip]') == false" + runs-on: ubuntu-latest + env: + CI: true + ALLOW_FAILURES: ${{ endsWith(matrix.ruby, 'head') }} + strategy: + fail-fast: false + matrix: + ruby: + - 2.6 + - 2.7 + - 3.0 + - 3.1 + - 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: ruby --version; 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 83a126b..0000000 --- a/.travis.yml +++ /dev/null @@ -1,16 +0,0 @@ -language: ruby -script: "bundle exec rspec spec" -env: - - CI=true -rvm: - - 2.4 - - 2.5 - - 2.6 - - 2.7 - - jruby -cache: bundler -sudo: false -matrix: - allow_failures: - - rvm: jruby -dist: trusty diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 62f0eae..bb363f9 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -6,7 +6,7 @@ Community contributions are essential for keeping Ruby RDF great. We want to kee This repository uses [Git Flow](https://github.com/nvie/gitflow) to manage development and release activity. All submissions _must_ be on a feature branch based on the _develop_ branch to ease staging and integration. -* create or respond to an issue on the [Github Repository](http://github.com/ruby-rdf/rdf-aggregate-repo/issues) +* create or respond to an issue on the [Github Repository](https://github.com/ruby-rdf/rdf-aggregate-repo/issues) * Fork and clone the repo: `git clone git@github.com:your-username/rdf-aggregate-repo.git` * Install bundle: @@ -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]: http://yardoc.org/ -[YARD-GS]: http://rubydoc.info/docs/yard/file/docs/GettingStarted.md -[PDD]: http://lists.w3.org/Archives/Public/public-rdf-ruby/2010May/0013.html -[pr]: https://github.com/ruby-rdf/rdf-aggregate-repo/compare/ +[YARD]: https://yardoc.org/ +[YARD-GS]: https://rubydoc.info/docs/yard/file/docs/GettingStarted.md +[PDD]: https://unlicense.org/#unlicensing-contributions +[pr]: https://github.com/ruby-rdf/rdf/compare/ diff --git a/Gemfile b/Gemfile index 04c814b..ea94e75 100644 --- a/Gemfile +++ b/Gemfile @@ -16,5 +16,7 @@ group :debug do end group :test do + gem 'simplecov', '~> 0.21', platforms: :mri + gem 'simplecov-lcov', '~> 0.8', platforms: :mri gem "rake" end diff --git a/README.md b/README.md index fc789d4..ddc3ad0 100644 --- a/README.md +++ b/README.md @@ -2,8 +2,10 @@ An aggregate RDF::Dataset supporting a subset of named graphs and zero or more named graphs mapped to the default graph. -[![Gem Version](https://badge.fury.io/rb/rdf-aggregate-repo.png)](http://badge.fury.io/rb/rdf-aggregate-repo) -[![Build Status](https://travis-ci.org/ruby-rdf/rdf-aggregate-repo.png?branch=master)](http://travis-ci.org/ruby-rdf/rdf-aggregate-repo) +[![Gem Version](https://badge.fury.io/rb/rdf-aggregate-repo.png)](https://badge.fury.io/rb/rdf-aggregate-repo) +[![Build Status](https://github.com/ruby-rdf/rdf-aggregate-repo/workflows/CI/badge.svg?branch=develop)](https://github.com/ruby-rdf/rdf-aggregate-repo/actions?query=workflow%3ACI) +[![Coverage Status](https://coveralls.io/repos/ruby-rdf/rdf-aggregate-repo/badge.svg?branch=develop)](https://coveralls.io/github/ruby-rdf/rdf-aggregate-repo?branch=develop) +[![Gitter chat](https://badges.gitter.im/ruby-rdf/rdf.png)](https://gitter.im/ruby-rdf/rdf) ## Description @@ -13,7 +15,7 @@ Maps named graphs from one or more `RDF::Queryable` instances into a single data require 'rdf' require 'rdf/nquads' - repo = RDF::Repository.load("http://ruby-rdf.github.com/rdf/etc/doap.nq") + repo = RDF::Repository.load("https://ruby-rdf.github.com/rdf/etc/doap.nq") # Instantiate a new aggregate repo based on an existing repo aggregate = RDF::AggregateRepo.new(repo) @@ -22,23 +24,23 @@ Maps named graphs from one or more `RDF::Queryable` instances into a single data aggregate.add_default(false) # Use a single named graph - aggregate.add_named(RDF::URI("http://greggkellogg.net/foaf#me")) + aggregate.add_named(RDF::URI("https://greggkellogg.net/foaf#me")) # Retrieve all contexts - aggreggate.contexts.to_a #=> [RDF::URI("http://greggkellogg.net/foaf#me")] + aggreggate.contexts.to_a #=> [RDF::URI("https://greggkellogg.net/foaf#me")] ## Dependencies -* [Ruby](http://ruby-lang.org/) (>= 2.4) -* [RDF.rb][] (~> 3.1) +* [Ruby](https://ruby-lang.org/) (>= 2.6) +* [RDF.rb][] (~> 3.2) ## Mailing List -* +* ## Author -* [Gregg Kellogg](http://github.com/gkellogg) - +* [Gregg Kellogg](https://github.com/gkellogg) - ## Contributing This repository uses [Git Flow](https://github.com/nvie/gitflow) to mange development and release activity. All submissions _must_ be on a feature branch based on the _develop_ branch to ease staging and integration. @@ -56,15 +58,17 @@ This repository uses [Git Flow](https://github.com/nvie/gitflow) to mange develo 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 This is free and unencumbered public domain software. For more information, -see or the accompanying {file:UNLICENSE} file. +see or the accompanying {file:UNLICENSE} file. -[RDF.rb]: http://ruby-rdf.github.com/ +[RDF.rb]: https://ruby-rdf.github.com/ [RDF Datasets]: https://www.w3.org/TR/rdf11-concepts/#dfn-rdf-dataset -[YARD]: http://yardoc.org/ -[YARD-GS]: http://rubydoc.info/docs/yard/file/docs/GettingStarted.md -[PDD]: http://lists.w3.org/Archives/Public/public-rdf-ruby/2010May/0013.html +[YARD]: https://yardoc.org/ +[YARD-GS]: https://rubydoc.info/docs/yard/file/docs/GettingStarted.md +[PDD]: https://unlicense.org/#unlicensing-contributions diff --git a/UNLICENSE b/UNLICENSE index 68a49da..efb9808 100644 --- a/UNLICENSE +++ b/UNLICENSE @@ -21,4 +21,4 @@ OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -For more information, please refer to +For more information, please refer to diff --git a/VERSION b/VERSION index fd2a018..944880f 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -3.1.0 +3.2.0 diff --git a/etc/doap.ttl b/etc/doap.ttl index 8c29d86..59ce46c 100644 --- a/etc/doap.ttl +++ b/etc/doap.ttl @@ -1,3 +1,4 @@ +@base . @prefix rdf: . @prefix rdfs: . @prefix dc: . @@ -7,27 +8,24 @@ @prefix ex: . @prefix xsd: . - a doap:Project, earl:Software ; +<> a doap:Project, earl:Software ; doap:name "RDF::AggregateRepo" ; - doap:homepage ; - doap:license ; - doap:shortdesc "An aggregate RDF::Repository supporting a subset of named graphs and zero or more named graphs mapped to the default graph."@en ; - doap:description "A gem extending RDF.rb with SPARQL dataset construction semantics."@en ; + doap:homepage ; + doap:license ; + doap:description "An aggregate RDF::Repository supporting a subset of named graphs and zero or more named graphs mapped to the default graph."@en ; + doap:shortdesc "RDF::AggregateRepo extends RDF.rb with SPARQL dataset construction semantics."@en ; doap:created "2013-04-26"^^xsd:date ; doap:programming-language "Ruby" ; - doap:implements ; - doap:category , - ; - doap:download-page ; - doap:mailing-list ; - doap:bug-database ; - doap:blog ; - doap:developer ; - doap:maintainer ; - doap:documenter ; - foaf:maker ; - dc:title "RDF::AggregateRepo"@en ; - dc:description "A gem extending RDF.rb with SPARQL dataset construction semantics."@en ; - dc:date "2013-04-26"^^xsd:date ; - dc:creator ; - dc:isPartOf . + doap:implements ; + doap:category , + ; + doap:download-page <> ; + doap:mailing-list ; + doap:bug-database ; + doap:blog ; + doap:developer ; + doap:maintainer ; + doap:documenter ; + foaf:maker ; + dc:creator ; + dc:isPartOf . diff --git a/lib/rdf/aggregate_repo/merge_graph.rb b/lib/rdf/aggregate_repo/merge_graph.rb index 37e084e..f4c2df3 100644 --- a/lib/rdf/aggregate_repo/merge_graph.rb +++ b/lib/rdf/aggregate_repo/merge_graph.rb @@ -18,7 +18,7 @@ module RDF # name false # end # - # @see http://www.w3.org/TR/rdf11-mt/#dfn-merge + # @see https://www.w3.org/TR/rdf11-mt/#dfn-merge class MergeGraph include RDF::Value include RDF::Countable @@ -40,8 +40,8 @@ class MergeGraph ## # Create a new aggregation instance. # - # @param [RDF::Resource] :graph_name - # @param [RDF::Resource] :name alias for :graph_name + # @param [RDF::Resource] graph_name + # @param [RDF::Resource] name alias for `graph_name` # @yield merger # @yieldparam [RDF::MergeGraph] self # @yieldreturn [void] ignored diff --git a/rdf-aggregate-repo.gemspec b/rdf-aggregate-repo.gemspec index d37b72d..94329ab 100755 --- a/rdf-aggregate-repo.gemspec +++ b/rdf-aggregate-repo.gemspec @@ -6,7 +6,7 @@ Gem::Specification.new do |gem| gem.date = File.mtime('VERSION').strftime('%Y-%m-%d') gem.name = 'rdf-aggregate-repo' - gem.homepage = 'http://ruby-rdf.github.com/rdf-aggregate-repo' + gem.homepage = 'https://github.com/ruby-rdf/rdf-aggregate-repo' gem.license = 'Unlicense' gem.summary = 'An aggregate RDF::Repository supporting a subset of named graphs and zero or more named graphs mapped to the default graph.' gem.description = %(A gem extending RDF.rb with SPARQL dataset construction semantics.) @@ -18,14 +18,14 @@ Gem::Specification.new do |gem| gem.files = %w(AUTHORS README.md UNLICENSE 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' - gem.add_development_dependency 'rdf-spec', '~> 3.1' - gem.add_development_dependency 'rdf-turtle', '~> 3.1' - gem.add_development_dependency 'rspec', '~> 3.9' + gem.add_runtime_dependency 'rdf', '~> 3.2' + gem.add_development_dependency 'rdf-spec', '~> 3.2' + gem.add_development_dependency 'rdf-turtle', '~> 3.2' + gem.add_development_dependency 'rspec', '~> 3.10' gem.add_development_dependency 'rspec-its', '~> 1.3' - gem.add_development_dependency 'yard', '~> 0.9.20' + gem.add_development_dependency 'yard', '~> 0.9' gem.post_install_message = nil end diff --git a/spec/aggregate_repo_spec.rb b/spec/aggregate_repo_spec.rb index 619ec48..b8b7e0a 100644 --- a/spec/aggregate_repo_spec.rb +++ b/spec/aggregate_repo_spec.rb @@ -76,23 +76,23 @@ context "with specific named entities" do let(:repo) {RDF::Repository.new {|r| RDF::Spec.quads.each {|s| r << s}}} - let(:gkellogg) {RDF::Graph(graph_name: "http://greggkellogg.net/foaf#me", data: repo)} - let(:bendiken) {RDF::Graph(graph_name: "http://ar.to/#self", data: repo)} - let(:bhuga) {RDF::Graph(graph_name: "http://bhuga.net/#ben", data: repo)} + let(:gkellogg) {RDF::Graph(graph_name: "https://greggkellogg.net/foaf#me", data: repo)} + let(:bendiken) {RDF::Graph(graph_name: "https://ar.to/#self", data: repo)} + let(:bhuga) {RDF::Graph(graph_name: "https://bhuga.net/#ben", data: repo)} before(:each) do r = repo @dataset = RDF::AggregateRepo.new do source r - default RDF::URI("http://greggkellogg.net/foaf#me") - named RDF::URI("http://ar.to/#self") - named RDF::URI("http://bhuga.net/#ben") + default RDF::URI("https://greggkellogg.net/foaf#me") + named RDF::URI("https://ar.to/#self") + named RDF::URI("https://bhuga.net/#ben") end end subject {@dataset} it {is_expected.not_to be_empty} its(:count) {is_expected.to eql [gkellogg, bendiken, bhuga].map(&:count).reduce(:+)} - its(:graph_names) {is_expected.to eql [RDF::URI("http://ar.to/#self"), RDF::URI("http://bhuga.net/#ben")]} + its(:graph_names) {is_expected.to eql [RDF::URI("https://ar.to/#self"), RDF::URI("https://bhuga.net/#ben")]} describe "#default_graph" do subject {@dataset.default_graph} its(:count) {is_expected.to eql gkellogg.count} diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 8483662..64dadb8 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,5 +1,4 @@ require "bundler/setup" -require 'rdf/aggregate_repo' require 'rdf/spec' require 'rdf/spec/matchers' @@ -11,3 +10,26 @@ ruby: lambda {|version| RUBY_VERSION.to_s !~ /^#{version}/}, } end + +begin + require 'simplecov' + 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, + SimpleCov::Formatter::LcovFormatter + ]) + SimpleCov.start do + add_filter "/spec/" + end +rescue LoadError => e + STDERR.puts "Coverage Skipped: #{e.message}" +end + +require 'rdf/aggregate_repo'