From 9ee2d4e98df56fb0dc16cdbbf9b594215ec18933 Mon Sep 17 00:00:00 2001 From: Gregg Kellogg Date: Thu, 28 May 2020 16:29:53 -0700 Subject: [PATCH 01/11] Use HTTPS URLs where possible. --- CHANGES.md | 2 +- CONTRIBUTING.md | 8 ++++---- README.md | 14 ++++++-------- Rakefile | 5 ----- UNLICENSE | 2 +- lib/spira.rb | 7 +++---- lib/spira/base.rb | 2 +- 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 | 2 +- 29 files changed, 42 insertions(+), 50 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 9aac85d..69995ed 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,4 +1,4 @@ -# Changelog for Spira +# Changelog for Spira ## 0.3.0 * General updates to bring up to date. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 18a0ee5..b02bc79 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: @@ -30,7 +30,7 @@ This repository uses [Git Flow](https://github.com/nvie/gitflow) to manage devel of thumb, additions larger than about 15 lines of code), we need an explicit [public domain dedication][PDD] on record from you. -[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://lists.w3.org/Archives/Public/public-rdf-ruby/2010May/0013.html [pr]: https://github.com/ruby-rdf/spira/compare/ diff --git a/README.md b/README.md index 00c6828..add4e6d 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# 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 [![Build Status](https://travis-ci.org/ruby-rdf/spira.png?branch=develop)](https://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) It's time to breathe life into your linked data. @@ -13,8 +13,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 @@ -103,7 +101,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 +223,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 +389,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. @@ -506,5 +504,5 @@ This repository uses [Git Flow](https://github.com/nvie/gitflow) to mange develo of thumb, additions larger than about 15 lines of code), we need an explicit [public domain dedication][PDD] on record from you. -[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 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/lib/spira.rb b/lib/spira.rb index 1277dc7..2f624e9 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,8 +63,7 @@ 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 def using_repository(repo) old_repository = Spira.repository diff --git a/lib/spira/base.rb b/lib/spira/base.rb index 7346752..fb2a25c 100644 --- a/lib/spira/base.rb +++ b/lib/spira/base.rb @@ -188,7 +188,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/spira.gemspec b/spira.gemspec index bd00191..8bdfb38 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.' From d65079878677352394d2b4b0a3e2be532a5c2719 Mon Sep 17 00:00:00 2001 From: Gregg Kellogg Date: Sun, 25 Oct 2020 16:50:34 -0700 Subject: [PATCH 02/11] Update PDD info in the README. --- CONTRIBUTING.md | 8 +++++--- README.md | 12 ++++++++++-- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index b02bc79..759265b 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/spira/compare/ +[PDD]: https://unlicense.org/#unlicensing-contributions +[pr]: https://github.com/ruby-rdf/rdf/compare/ diff --git a/README.md b/README.md index add4e6d..1048e06 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,9 @@ -# Spira [![Build Status](https://travis-ci.org/ruby-rdf/spira.png?branch=develop)](https://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://travis-ci.org/ruby-rdf/spira.png?branch=develop)](https://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) It's time to breathe life into your linked data. @@ -502,7 +507,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]: https://lists.w3.org/Archives/Public/public-rdf-ruby/ [RDF.rb]: https://rubygems.org/gems/rdf +[PDD]: https://unlicense.org/#unlicensing-contributions From cac4ece352275cb32fd003237cfabaf2c65d31ef Mon Sep 17 00:00:00 2001 From: Gregg Kellogg Date: Mon, 21 Dec 2020 14:25:47 -0800 Subject: [PATCH 03/11] CI on GitHub. --- .github/workflows/ci.yml | 39 +++++++++++++++++++++++++++++++++++++++ README.md | 2 +- spec/spec_helper.rb | 20 ++++++++++++-------- spira.gemspec | 6 +++--- 4 files changed, 55 insertions(+), 12 deletions(-) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..8d5176a --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,39 @@ +# 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 + 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 + diff --git a/README.md b/README.md index 1048e06..a79e2ec 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # Spira [![Gem Version](https://badge.fury.io/rb/spira.png)](https://badge.fury.io/rb/spira) -[![Build Status](https://travis-ci.org/ruby-rdf/spira.png?branch=develop)](https://travis-ci.org/ruby-rdf/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) diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 28b8364..bb4aa74 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -4,15 +4,19 @@ require 'rdf/ntriples' require 'rdf/turtle' require 'rdf/vocab' -require 'simplecov' -require 'coveralls' -SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter.new([ - SimpleCov::Formatter::HTMLFormatter, - Coveralls::SimpleCov::Formatter -]) -SimpleCov.start do - add_filter '/.bundle/' +begin + require 'simplecov' + require 'coveralls' + + SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter.new([ + SimpleCov::Formatter::HTMLFormatter, + Coveralls::SimpleCov::Formatter + ]) + SimpleCov.start do + add_filter '/.bundle/' + end +rescue LoadError end require 'spira' diff --git a/spira.gemspec b/spira.gemspec index 8bdfb38..e001925 100755 --- a/spira.gemspec +++ b/spira.gemspec @@ -27,16 +27,16 @@ Gem::Specification.new do |gem| 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 'promise', '~> 0.3' 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_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 From 41089fb7fa342d1ed1f9277d67980e07c751a026 Mon Sep 17 00:00:00 2001 From: Gregg Kellogg Date: Wed, 11 Aug 2021 13:49:58 -0700 Subject: [PATCH 04/11] Update CI for coveralls. --- .github/workflows/ci.yml | 10 +++++++--- .travis.yml | 15 --------------- Gemfile | 4 ++-- spec/spec_helper.rb | 10 ++++++++-- 4 files changed, 17 insertions(+), 22 deletions(-) delete mode 100644 .travis.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8d5176a..a725c23 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,11 +15,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 @@ -35,5 +35,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 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/Gemfile b/Gemfile index 3987af8..4744899 100644 --- a/Gemfile +++ b/Gemfile @@ -18,8 +18,8 @@ group :development, :test do 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/spec/spec_helper.rb b/spec/spec_helper.rb index bb4aa74..3b2b88a 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -7,11 +7,17 @@ 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 '/.bundle/' From 039a2870acf70c1e51d83112c4c76c36c6fb6fc5 Mon Sep 17 00:00:00 2001 From: Gregg Kellogg Date: Wed, 11 Aug 2021 14:20:34 -0700 Subject: [PATCH 05/11] Pin version if i18n gem to 1.7.1 due to activesupport 5 incompatibility. --- .byebug_history | 108 -------------------------------------------- .gitignore | 1 + spec/spec_helper.rb | 1 + spira.gemspec | 1 + 4 files changed, 3 insertions(+), 108 deletions(-) delete mode 100644 .byebug_history 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/.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/spec/spec_helper.rb b/spec/spec_helper.rb index 3b2b88a..8f56fd6 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -4,6 +4,7 @@ require 'rdf/ntriples' require 'rdf/turtle' require 'rdf/vocab' +require 'amazing_print' begin require 'simplecov' diff --git a/spira.gemspec b/spira.gemspec index e001925..a3c2df2 100755 --- a/spira.gemspec +++ b/spira.gemspec @@ -30,6 +30,7 @@ Gem::Specification.new do |gem| gem.add_runtime_dependency 'promise', '~> 0.3' gem.add_runtime_dependency 'activemodel', '~> 5.0' gem.add_runtime_dependency 'activesupport', '~> 5.0' + gem.add_runtime_dependency 'i18n', '~> 1.7.1' # 1.8 incompatibility with later active support gem.add_development_dependency 'rdf-spec', '~> 3.1' gem.add_development_dependency 'rdf-turtle', '~> 3.1' From c2f0deebaaebf5d88489c58210b14e6414cf1943 Mon Sep 17 00:00:00 2001 From: Gregg Kellogg Date: Tue, 26 Oct 2021 12:16:48 -0700 Subject: [PATCH 06/11] Update CI. --- .github/workflows/ci.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a725c23..5f45ff1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,6 +23,7 @@ jobs: - 2.5 - 2.6 - 2.7 + - 3.0 - ruby-head - jruby steps: @@ -35,7 +36,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 90695c3b8b5eedd01242aa3a263701c81d7c3bb2 Mon Sep 17 00:00:00 2001 From: Aymeric Brisse Date: Thu, 2 Dec 2021 17:06:45 +0100 Subject: [PATCH 07/11] Spira#using_repository now returns the given repository --- CHANGES.md | 5 +++++ lib/spira.rb | 2 ++ spec/repository_spec.rb | 6 ++++++ 3 files changed, 13 insertions(+) diff --git a/CHANGES.md b/CHANGES.md index 69995ed..8d8bb1b 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,4 +1,9 @@ # 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/lib/spira.rb b/lib/spira.rb index 2f624e9..9c9bc65 100644 --- a/lib/spira.rb +++ b/lib/spira.rb @@ -65,10 +65,12 @@ def clear_repository! # # @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/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 From 4cf4397e9fe77a586d9374db9be0d0815ea12bb7 Mon Sep 17 00:00:00 2001 From: Aymeric Brisse Date: Thu, 2 Dec 2021 17:17:36 +0100 Subject: [PATCH 08/11] Chore: Rename file CHANGES to CHANGELOG --- CHANGES.md => CHANGELOG.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename CHANGES.md => CHANGELOG.md (100%) diff --git a/CHANGES.md b/CHANGELOG.md similarity index 100% rename from CHANGES.md rename to CHANGELOG.md From 2cbd657ee75615ec0f33401b75f82b2976ff8ca2 Mon Sep 17 00:00:00 2001 From: Gregg Kellogg Date: Mon, 13 Dec 2021 12:45:44 -0800 Subject: [PATCH 09/11] Update documentation, dependencies, and version sync for 3.2. --- .github/workflows/ci.yml | 1 - VERSION | 2 +- spec/spec_helper.rb | 1 + spira.gemspec | 18 +++++++++--------- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5f45ff1..970180d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -20,7 +20,6 @@ jobs: fail-fast: false matrix: ruby: - - 2.5 - 2.6 - 2.7 - 3.0 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/spec/spec_helper.rb b/spec/spec_helper.rb index 8f56fd6..3fef301 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,3 +1,4 @@ +require "bundler/setup" require 'rdf/spec/enumerable' require 'rdf/spec' require 'rdf/isomorphic' diff --git a/spira.gemspec b/spira.gemspec index a3c2df2..bf1e551 100755 --- a/spira.gemspec +++ b/spira.gemspec @@ -22,19 +22,19 @@ 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.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 'rdf', '~> 3.2' + gem.add_runtime_dependency 'rdf-isomorphic', '~> 3.2' gem.add_runtime_dependency 'promise', '~> 0.3' - gem.add_runtime_dependency 'activemodel', '~> 5.0' - gem.add_runtime_dependency 'activesupport', '~> 5.0' - gem.add_runtime_dependency 'i18n', '~> 1.7.1' # 1.8 incompatibility with later active support + 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.1' - gem.add_development_dependency 'rdf-turtle', '~> 3.1' - gem.add_development_dependency 'rdf-vocab', '~> 3.1' + 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' From 0b3d62c8e8a758f741c77a0d9ec1eef36fbcddef Mon Sep 17 00:00:00 2001 From: Gregg Kellogg Date: Sun, 26 Dec 2021 22:47:28 -0800 Subject: [PATCH 10/11] 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 970180d..0aaedb9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,6 +23,7 @@ jobs: - 2.6 - 2.7 - 3.0 + - 3.1 - ruby-head - jruby steps: From 921e8cdeb0f02c665a6fa9af680b2ae5a005df64 Mon Sep 17 00:00:00 2001 From: Gregg Kellogg Date: Wed, 29 Dec 2021 12:46:43 -0800 Subject: [PATCH 11/11] Improve yard documentation. --- .yardopts | 1 - Gemfile | 2 +- README.md | 2 -- lib/spira/base.rb | 8 ++++++-- spira.gemspec | 2 +- 5 files changed, 8 insertions(+), 7 deletions(-) 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/Gemfile b/Gemfile index 4744899..9abfa52 100644 --- a/Gemfile +++ b/Gemfile @@ -11,7 +11,7 @@ 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] diff --git a/README.md b/README.md index a79e2ec..2edff59 100644 --- a/README.md +++ b/README.md @@ -18,8 +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. -A changelog is available in the {file:CHANGES.md} file. - ### Example ```ruby diff --git a/lib/spira/base.rb b/lib/spira/base.rb index fb2a25c..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 = {}) diff --git a/spira.gemspec b/spira.gemspec index bf1e551..b3e6c85 100755 --- a/spira.gemspec +++ b/spira.gemspec @@ -18,7 +18,7 @@ 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)