diff --git a/.byebug_history b/.byebug_history deleted file mode 100644 index fc16566..0000000 --- a/.byebug_history +++ /dev/null @@ -1,108 +0,0 @@ -c -subject.query({subject: Cars.car3, predicate: RDF.type, object: Cars.car}) -subject.query({subject: Cars.car3, predicate: RDF.type, object: Cars.car3}) -subject.query({subject: Cars.car3, predicate: RDF.type}).to_a -subject.query({subject: Cars.car2}).to_a -subject.query({subject: Cars.car2, predicate: RDF.type}).to_a -subject.query({subject: Cars.car2, predicate: RDF.type}) -subject.query({subject: Cars.car2, predicate: RDF.type, object: Cars.car3}) -subject.query({subject: Cars.car2, predicate: RDF.type, object: Cars.car}) -Cars.car3.attributes -Cars.car3 -car3.attributes -puts subject.dump(:ttl) -subject.count -subject -c -objects -n -options[:predicate] -n -name -n -s -sts.to_a -sts -n -s -n -s -person.attributes -person -c -p.attributes -n -exit -props -n -s -Person.new(name: "Dick").attributes -friend.attributes -friend -exit -self.class.repository.dump(:ttl) -self.class.repository -self.class.repository.query({subject: subject}).to_a -s -n -s -c -sts.to_a -sts -name -sts.to_a -sts -objects -n -options -s -n -s -n -s -exit -self.class.properties -options -options[:predicate] -n -options -name -s -self.class.properties -sts -n -s -attributes -n -s -attributes -n -s -c -props -self.attributes -self -n -s -c -person.attributes -person -person.name -person.reload -person.reolad -c -person -n -value -n -@attrs[name] -n -s -self.class.properties[name] -self.class.properties -n -name -s -name -n -s diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..0aaedb9 --- /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/.gitignore b/.gitignore index 4ea4363..bdc045c 100644 --- a/.gitignore +++ b/.gitignore @@ -13,3 +13,4 @@ Gemfile.lock bin/ /.bundle/ /releases +/.byebug_history diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 0151a9a..0000000 --- a/.travis.yml +++ /dev/null @@ -1,15 +0,0 @@ -language: ruby -bundler_args: --without debug -script: "bundle exec rake spec" -env: - - CI=true -rvm: - - 2.4 - - 2.5 - - 2.6 - - 2.7 - - jruby -matrix: - allow_failures: - - rvm: jruby -sudo: false diff --git a/.yardopts b/.yardopts index 696a643..818e211 100644 --- a/.yardopts +++ b/.yardopts @@ -9,4 +9,3 @@ AUTHORS UNLICENSE VERSION -CHANGES.md diff --git a/CHANGES.md b/CHANGELOG.md similarity index 97% rename from CHANGES.md rename to CHANGELOG.md index 9aac85d..8d8bb1b 100644 --- a/CHANGES.md +++ b/CHANGELOG.md @@ -1,4 +1,9 @@ -# Changelog for Spira +# Changelog for Spira + +## [Unreleased] +### Changed + +* Spira#using_repository now returns the given repository ## 0.3.0 * General updates to bring up to date. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 18a0ee5..759265b 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/spira/issues) +* create or respond to an issue on the [Github Repository](https://github.com/ruby-rdf/spira/issues) * Fork and clone the repo: `git clone git@github.com:your-username/spira.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/spira/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 3987af8..9abfa52 100644 --- a/Gemfile +++ b/Gemfile @@ -11,15 +11,15 @@ group :development, :test do gem 'rdf-turtle', github: "ruby-rdf/rdf-turtle", branch: "develop" gem 'rdf-vocab', github: "ruby-rdf/rdf-vocab", branch: "develop" gem 'sxp', github: "dryruby/sxp.rb", branch: "develop" - gem 'rake', '~> 10.0' + gem 'rake', '~> 13.0' gem 'redcarpet', '~> 3.2.2' unless RUBY_ENGINE == 'jruby' gem 'byebug', platform: :mri gem 'psych', platforms: [:mri, :rbx] end group :test do - gem 'simplecov', platforms: :mri - gem 'coveralls', '~> 0.8', platforms: :mri + gem 'simplecov', '~> 0.21', platforms: :mri + gem 'simplecov-lcov', '~> 0.8', platforms: :mri gem 'guard' #, '~> 2.13.0' gem 'guard-rspec' #, '~> 3.1.0' gem 'guard-ctags-bundler' #, '~> 1.4.0' diff --git a/README.md b/README.md index 00c6828..2edff59 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,9 @@ -# Spira [![Build Status](https://travis-ci.org/ruby-rdf/spira.png?branch=develop)](http://travis-ci.org/ruby-rdf/spira) [![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) [![Dependency Status](https://gemnasium.com/ruby-rdf/spira.png)](https://gemnasium.com/ruby-rdf/spira) +# Spira + +[![Gem Version](https://badge.fury.io/rb/spira.png)](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) It's time to breathe life into your linked data. @@ -13,10 +18,6 @@ losing access to statement-oriented nature of linked data, if you so choose. It can be used either to access existing RDF data in a resource-oriented way, or to create a new store of RDF data based on simple defaults. -An introductory blog post is at - -A changelog is available in the {file:CHANGES.md} file. - ### Example ```ruby @@ -103,7 +104,7 @@ The easiest way to work with Spira is to install it via Rubygems: $ sudo gem install spira -Downloads will be available on the github project page, as well as on Rubyforge. +Downloads will be available on the github project page. ## Defining Model Classes @@ -225,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 http://rdf.rubyforge.org/RDF/Enumerable.html for more information about #has_predicate? +# See RDF.rb at https://www.rubydoc.info/github/ruby-rdf/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') ``` @@ -391,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`](http://rdf.rubyforge.org/RDF/Literal.html) for more information. +See [`RDF::Literal`](https://www.rubydoc.info/github/ruby-rdf/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. @@ -504,7 +505,10 @@ This repository uses [Git Flow](https://github.com/nvie/gitflow) to mange develo list in the the `README`. Alphabetical order applies. * 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. -[public-rdf-ruby w3c mailing list]: http://lists.w3.org/Archives/Public/public-rdf-ruby/ -[RDF.rb]: http://rubygems.org/gems/rdf +[public-rdf-ruby w3c mailing list]: https://lists.w3.org/Archives/Public/public-rdf-ruby/ +[RDF.rb]: https://rubygems.org/gems/rdf +[PDD]: https://unlicense.org/#unlicensing-contributions diff --git a/Rakefile b/Rakefile index c5e1784..fced2f6 100644 --- a/Rakefile +++ b/Rakefile @@ -74,8 +74,3 @@ EOC writer.flush end end - -desc "Upload docs to rubyforge" -task uploadyardocs: [:yardoc, :addanalytics] do - `rsync -av doc/yard/* bhuga@rubyforge.org:/var/www/gforge-projects/spira` -end diff --git a/UNLICENSE b/UNLICENSE index 68a49da..ff0ecdd 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 94ff29c..944880f 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -3.1.1 +3.2.0 diff --git a/lib/spira.rb b/lib/spira.rb index 1277dc7..9c9bc65 100644 --- a/lib/spira.rb +++ b/lib/spira.rb @@ -9,8 +9,8 @@ # Spira is a framework for building projections of RDF data into Ruby classes. # It is built on top of RDF.rb. # -# @see http://rdf.rubyforge.org -# @see http://github.com/bhuga/spira +# @see https://rubygems.org/gems/rdf +# @see https://github.com/bhuga/spira # @see Spira::Resource module Spira @@ -63,13 +63,14 @@ def clear_repository! # Execute a block on a specific repository # - # @param [RDF::Repository] repository the repository to work on - # @param [Symbol] name the repository name + # @param [RDF::Repository] repo the repository to work on # @yield the block with the instructions while using the repository + # @return [RDF::Repository] the given repository def using_repository(repo) old_repository = Spira.repository Spira.repository = repo yield if block_given? + repo ensure Spira.repository = old_repository end diff --git a/lib/spira/base.rb b/lib/spira/base.rb index 7346752..96e60a9 100644 --- a/lib/spira/base.rb +++ b/lib/spira/base.rb @@ -107,12 +107,16 @@ def id # Initialize a new Spira::Base instance of this resource class using # a new blank node subject. Accepts a hash of arguments for initial # attributes. To use a URI or existing blank node as a subject, use - # {Spira.for} instead. + # the `.for` method on the subclass instead. + # + # @example + # class Person < Spira::Base; end + # bob = Person.for("bob") # # @param [Hash{Symbol => Any}] props Default attributes for this instance # @yield [self] Executes a given block # @yieldparam [self] self The newly created instance - # @see Spira.for + # @see Spira::Persistence::ClassMethods#for # @see RDF::URI#as # @see RDF::Node#as def initialize(props = {}, options = {}) @@ -188,7 +192,7 @@ def inspect # an RDF level, and will work across subclasses as long as the attributes # are the same. # - # @see http://rdf.rubyforge.org/isomorphic/ + # @see https://rubygems.org/gems/rdf-isomorphic/ def ==(other) # TODO: define behavior for equality on subclasses. # TODO: should we compare attributes here? diff --git a/lib/spira/persistence.rb b/lib/spira/persistence.rb index 60abfff..afda836 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 http://rdf.rubyforge.org/RDF/URI.html + # @see https://www.rubydoc.info/github/ruby-rdf/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 http://rdf.rubyforge.org/RDF/URI.html + # @see https://www.rubydoc.info/github/ruby-rdf/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 http://rdf.rubyforge.org/RDF/Enumerable.html + # @see https://www.rubydoc.info/github/ruby-rdf/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 http://rdf.rubyforge.org/RDF/Enumerable.html#count + # @see https://www.rubydoc.info/github/ruby-rdf/rdf/RDF/Enumerable.html#count def count each.count end diff --git a/lib/spira/type.rb b/lib/spira/type.rb index 71e9f62..0d70e61 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 http://rdf.rubyforge.org/RDF/Value.html + # @see https://www.rubydoc.info/github/ruby-rdf/rdf/RDF/Value.html # @see Spira::Resource module Type diff --git a/lib/spira/types/any.rb b/lib/spira/types/any.rb index 6dd4aee..e3c430d 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 http://rdf.rubyforge.org/RDF/Literal.html + # @see https://www.rubydoc.info/github/ruby-rdf/rdf/RDF/Literal.html class Any include Spira::Type diff --git a/lib/spira/types/anyURI.rb b/lib/spira/types/anyURI.rb index be9cf4f..db51b48 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 http://rdf.rubyforge.org/RDF/Literal.html + # @see https://www.rubydoc.info/github/ruby-rdf/rdf/RDF/Literal.html class AnyURI include Spira::Type diff --git a/lib/spira/types/boolean.rb b/lib/spira/types/boolean.rb index c5e3dda..8c855c1 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 http://rdf.rubyforge.org/RDF/Literal.html + # @see https://www.rubydoc.info/github/ruby-rdf/rdf/RDF/Literal.html class Boolean include Spira::Type diff --git a/lib/spira/types/date.rb b/lib/spira/types/date.rb index 57eb79b..6919e65 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 http://rdf.rubyforge.org/RDF/Literal.html + # @see https://www.rubydoc.info/github/ruby-rdf/rdf/RDF/Literal.html class Date include Spira::Type diff --git a/lib/spira/types/dateTime.rb b/lib/spira/types/dateTime.rb index 513f0a2..b7f30e1 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 http://rdf.rubyforge.org/RDF/Literal.html + # @see https://www.rubydoc.info/github/ruby-rdf/rdf/RDF/Literal.html class DateTime include Spira::Type diff --git a/lib/spira/types/decimal.rb b/lib/spira/types/decimal.rb index 8af2aac..60f4fd4 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 http://rdf.rubyforge.org/RDF/Literal.html + # @see https://www.rubydoc.info/github/ruby-rdf/rdf/RDF/Literal.html class Decimal include Spira::Type diff --git a/lib/spira/types/double.rb b/lib/spira/types/double.rb index 45da672..f95db08 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 http://rdf.rubyforge.org/RDF/Literal.html + # @see https://www.rubydoc.info/github/ruby-rdf/rdf/RDF/Literal.html class Double include Spira::Type diff --git a/lib/spira/types/float.rb b/lib/spira/types/float.rb index 57e4661..aa0c69c 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 http://rdf.rubyforge.org/RDF/Literal.html + # @see https://www.rubydoc.info/github/ruby-rdf/rdf/RDF/Literal.html class Float include Spira::Type diff --git a/lib/spira/types/gYear.rb b/lib/spira/types/gYear.rb index 70f9cac..576b8e5 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 http://rdf.rubyforge.org/RDF/Literal.html + # @see https://www.rubydoc.info/github/ruby-rdf/rdf/RDF/Literal.html class GYear include Spira::Type diff --git a/lib/spira/types/int.rb b/lib/spira/types/int.rb index 55bfc8c..2f50f28 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 http://rdf.rubyforge.org/RDF/Literal.html + # @see https://www.rubydoc.info/github/ruby-rdf/rdf/RDF/Literal.html class Int include Spira::Type diff --git a/lib/spira/types/integer.rb b/lib/spira/types/integer.rb index 2e12fb2..ca2ca4c 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 http://rdf.rubyforge.org/RDF/Literal.html + # @see https://www.rubydoc.info/github/ruby-rdf/rdf/RDF/Literal.html class Integer include Spira::Type diff --git a/lib/spira/types/long.rb b/lib/spira/types/long.rb index f97fba1..27e1050 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 http://rdf.rubyforge.org/RDF/Literal.html + # @see https://www.rubydoc.info/github/ruby-rdf/rdf/RDF/Literal.html class Long include Spira::Type diff --git a/lib/spira/types/negativeInteger.rb b/lib/spira/types/negativeInteger.rb index 3870863..b007717 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 http://rdf.rubyforge.org/RDF/Literal.html + # @see https://www.rubydoc.info/github/ruby-rdf/rdf/RDF/Literal.html class NegativeInteger include Spira::Type diff --git a/lib/spira/types/nonNegativeInteger.rb b/lib/spira/types/nonNegativeInteger.rb index 1cb8d55..ec5d728 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 http://rdf.rubyforge.org/RDF/Literal.html + # @see https://www.rubydoc.info/github/ruby-rdf/rdf/RDF/Literal.html class NonNegativeInteger include Spira::Type diff --git a/lib/spira/types/nonPositiveInteger.rb b/lib/spira/types/nonPositiveInteger.rb index fff1eec..c5fd73e 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 http://rdf.rubyforge.org/RDF/Literal.html + # @see https://www.rubydoc.info/github/ruby-rdf/rdf/RDF/Literal.html class NonPositiveInteger include Spira::Type diff --git a/lib/spira/types/positiveInteger.rb b/lib/spira/types/positiveInteger.rb index 3986d72..61ff362 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 http://rdf.rubyforge.org/RDF/Literal.html + # @see https://www.rubydoc.info/github/ruby-rdf/rdf/RDF/Literal.html class PositiveInteger include Spira::Type diff --git a/lib/spira/types/string.rb b/lib/spira/types/string.rb index b246875..f63b52d 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 http://rdf.rubyforge.org/RDF/Literal.html + # @see https://www.rubydoc.info/github/ruby-rdf/rdf/RDF/Literal.html class String include Spira::Type diff --git a/lib/spira/types/time.rb b/lib/spira/types/time.rb index ceef48b..9562b85 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 http://rdf.rubyforge.org/RDF/Literal.html + # @see https://www.rubydoc.info/github/ruby-rdf/rdf/RDF/Literal.html class Time include Spira::Type diff --git a/lib/spira/types/uri.rb b/lib/spira/types/uri.rb index 2cd3a00..5176e9c 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 http://rdf.rubyforge.org/RDF/URI.html + # @see https://www.rubydoc.info/github/ruby-rdf/rdf/RDF/URI.html class URI include Spira::Type diff --git a/spec/repository_spec.rb b/spec/repository_spec.rb index dfba9c4..b8c823e 100644 --- a/spec/repository_spec.rb +++ b/spec/repository_spec.rb @@ -21,6 +21,12 @@ expect(Spira.repository).to eql repo end + it "should return the given repository" do + return_value = Spira.using_repository(new_repo) {} + + expect(return_value).to eql new_repo + end + context "when the block raises an error" do it "should restore the original repository" do begin diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 28b8364..3fef301 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,18 +1,30 @@ +require "bundler/setup" require 'rdf/spec/enumerable' require 'rdf/spec' require 'rdf/isomorphic' require 'rdf/ntriples' require 'rdf/turtle' require 'rdf/vocab' -require 'simplecov' -require 'coveralls' +require 'amazing_print' -SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter.new([ - SimpleCov::Formatter::HTMLFormatter, - Coveralls::SimpleCov::Formatter -]) -SimpleCov.start do - add_filter '/.bundle/' +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 '/.bundle/' + end +rescue LoadError end require 'spira' diff --git a/spira.gemspec b/spira.gemspec index bd00191..b3e6c85 100755 --- a/spira.gemspec +++ b/spira.gemspec @@ -9,7 +9,7 @@ Gem::Specification.new do |gem| gem.date = Time.now.strftime('%Y-%m-%d') gem.name = 'spira' - gem.homepage = 'http://ruby-rdf.github.io/spira/' + gem.homepage = 'https://ruby-rdf.github.io/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.' @@ -18,25 +18,26 @@ Gem::Specification.new do |gem| gem.email = 'blavender@gmail.com' gem.platform = Gem::Platform::RUBY - gem.files = %w(CHANGES.md AUTHORS README.md UNLICENSE VERSION) + Dir.glob('lib/**/*.rb') + gem.files = %w(AUTHORS README.md UNLICENSE VERSION) + Dir.glob('lib/**/*.rb') gem.require_paths = %w(lib) gem.has_yardoc = true if gem.respond_to?(:has_yardoc) - gem.required_ruby_version = '>= 2.4' + gem.required_ruby_version = '>= 2.6' gem.requirements = [] - gem.add_runtime_dependency 'rdf', '~> 3.1' - gem.add_runtime_dependency 'rdf-isomorphic', '~> 3.1' - gem.add_runtime_dependency 'promise', '~> 0.3.0' - gem.add_runtime_dependency 'activemodel', '~> 5.0' - gem.add_runtime_dependency 'activesupport', '~> 5.0' - - gem.add_development_dependency 'rdf-spec', '~> 3.1' - gem.add_development_dependency 'rdf-turtle', '~> 3.1' - gem.add_development_dependency 'rdf-vocab', '~> 3.1' - gem.add_development_dependency 'rspec', '~> 3.9' + gem.add_runtime_dependency 'rdf', '~> 3.2' + gem.add_runtime_dependency 'rdf-isomorphic', '~> 3.2' + 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_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