Skip to content

Commit fd6483f

Browse files
committed
Finish 3.2.0
2 parents acf4ad5 + 921e8cd commit fd6483f

38 files changed

+157
-206
lines changed

.byebug_history

Lines changed: 0 additions & 108 deletions
This file was deleted.

.github/workflows/ci.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# This workflow runs continuous CI across different versions of ruby on all branches and pull requests to develop.
2+
3+
name: CI
4+
on:
5+
push:
6+
branches: [ '**' ]
7+
pull_request:
8+
branches: [ develop ]
9+
workflow_dispatch:
10+
11+
jobs:
12+
tests:
13+
name: Ruby ${{ matrix.ruby }}
14+
if: "contains(github.event.commits[0].message, '[ci skip]') == false"
15+
runs-on: ubuntu-latest
16+
env:
17+
CI: true
18+
ALLOW_FAILURES: ${{ endsWith(matrix.ruby, 'head') }}
19+
strategy:
20+
fail-fast: false
21+
matrix:
22+
ruby:
23+
- 2.6
24+
- 2.7
25+
- 3.0
26+
- 3.1
27+
- ruby-head
28+
- jruby
29+
steps:
30+
- name: Clone repository
31+
uses: actions/checkout@v2
32+
- name: Set up Ruby
33+
uses: ruby/setup-ruby@v1
34+
with:
35+
ruby-version: ${{ matrix.ruby }}
36+
- name: Install dependencies
37+
run: bundle install --jobs 4 --retry 3
38+
- name: Run tests
39+
run: ruby --version; bundle exec rspec spec || $ALLOW_FAILURES
40+
- name: Coveralls GitHub Action
41+
uses: coverallsapp/[email protected]
42+
if: "matrix.ruby == '3.0'"
43+
with:
44+
github-token: ${{ secrets.GITHUB_TOKEN }}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,4 @@ Gemfile.lock
1313
bin/
1414
/.bundle/
1515
/releases
16+
/.byebug_history

.travis.yml

Lines changed: 0 additions & 15 deletions
This file was deleted.

.yardopts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,3 @@
99
AUTHORS
1010
UNLICENSE
1111
VERSION
12-
CHANGES.md

CHANGES.md renamed to CHANGELOG.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1-
# Changelog for Spira <http://github.com/rdf-ruby/spira>
1+
# Changelog for Spira <https://github.com/rdf-ruby/spira>
2+
3+
## [Unreleased]
4+
### Changed
5+
6+
* Spira#using_repository now returns the given repository
27

38
## 0.3.0
49
* General updates to bring up to date.

CONTRIBUTING.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Community contributions are essential for keeping Ruby RDF great. We want to kee
66

77
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.
88

9-
* create or respond to an issue on the [Github Repository](http://github.com/ruby-rdf/spira/issues)
9+
* create or respond to an issue on the [Github Repository](https://github.com/ruby-rdf/spira/issues)
1010
* Fork and clone the repo:
1111
`git clone [email protected]:your-username/spira.git`
1212
* Install bundle:
@@ -28,9 +28,11 @@ This repository uses [Git Flow](https://github.com/nvie/gitflow) to manage devel
2828
enough, be assured we will eventually add you in there.
2929
* Do note that in order for us to merge any non-trivial changes (as a rule
3030
of thumb, additions larger than about 15 lines of code), we need an
31-
explicit [public domain dedication][PDD] on record from you.
31+
explicit [public domain dedication][PDD] on record from you,
32+
which you will be asked to agree to on the first commit to a repo within the organization.
33+
Note that the agreement applies to all repos in the [Ruby RDF](https://github.com/ruby-rdf/) organization.
3234

33-
[YARD]: http://yardoc.org/
34-
[YARD-GS]: http://rubydoc.info/docs/yard/file/docs/GettingStarted.md
35-
[PDD]: http://lists.w3.org/Archives/Public/public-rdf-ruby/2010May/0013.html
36-
[pr]: https://github.com/ruby-rdf/spira/compare/
35+
[YARD]: https://yardoc.org/
36+
[YARD-GS]: https://rubydoc.info/docs/yard/file/docs/GettingStarted.md
37+
[PDD]: https://unlicense.org/#unlicensing-contributions
38+
[pr]: https://github.com/ruby-rdf/rdf/compare/

Gemfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,15 @@ group :development, :test do
1111
gem 'rdf-turtle', github: "ruby-rdf/rdf-turtle", branch: "develop"
1212
gem 'rdf-vocab', github: "ruby-rdf/rdf-vocab", branch: "develop"
1313
gem 'sxp', github: "dryruby/sxp.rb", branch: "develop"
14-
gem 'rake', '~> 10.0'
14+
gem 'rake', '~> 13.0'
1515
gem 'redcarpet', '~> 3.2.2' unless RUBY_ENGINE == 'jruby'
1616
gem 'byebug', platform: :mri
1717
gem 'psych', platforms: [:mri, :rbx]
1818
end
1919

2020
group :test do
21-
gem 'simplecov', platforms: :mri
22-
gem 'coveralls', '~> 0.8', platforms: :mri
21+
gem 'simplecov', '~> 0.21', platforms: :mri
22+
gem 'simplecov-lcov', '~> 0.8', platforms: :mri
2323
gem 'guard' #, '~> 2.13.0'
2424
gem 'guard-rspec' #, '~> 3.1.0'
2525
gem 'guard-ctags-bundler' #, '~> 1.4.0'

README.md

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1-
# 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)
1+
# Spira
2+
3+
[![Gem Version](https://badge.fury.io/rb/spira.png)](https://badge.fury.io/rb/spira)
4+
[![Build Status](https://github.com/ruby-rdf/spira/workflows/CI/badge.svg?branch=develop)](https://github.com/ruby-rdf/spira/actions?query=workflow%3ACI)
5+
[![Coverage Status](https://coveralls.io/repos/ruby-rdf/spira/badge.png?branch=develop)](https://coveralls.io/r/ruby-rdf/spira)
6+
[![Code Climate](https://codeclimate.com/github/ruby-rdf/spira.png)](https://codeclimate.com/github/ruby-rdf/spira)
27

38
It's time to breathe life into your linked data.
49

@@ -13,10 +18,6 @@ losing access to statement-oriented nature of linked data, if you so choose.
1318
It can be used either to access existing RDF data in a resource-oriented way,
1419
or to create a new store of RDF data based on simple defaults.
1520

16-
An introductory blog post is at <http://blog.datagraph.org/2010/05/spira>
17-
18-
A changelog is available in the {file:CHANGES.md} file.
19-
2021
### Example
2122

2223
```ruby
@@ -103,7 +104,7 @@ The easiest way to work with Spira is to install it via Rubygems:
103104

104105
$ sudo gem install spira
105106

106-
Downloads will be available on the github project page, as well as on Rubyforge.
107+
Downloads will be available on the github project page.
107108

108109
## Defining Model Classes
109110

@@ -225,7 +226,7 @@ end
225226
Spira.repository = RDF::Repository.new
226227

227228
rolling_stones = Album.for RDF::URI.new('http://example.org/cds/rolling-stones-hits')
228-
# See RDF.rb at http://rdf.rubyforge.org/RDF/Enumerable.html for more information about #has_predicate?
229+
# See RDF.rb at https://www.rubydoc.info/github/ruby-rdf/rdf/RDF/Enumerable.html for more information about #has_predicate?
229230
rolling_stones.has_predicate?(RDF.type) #=> true
230231
Album.type #=> RDF::URI('http://example.org/types/album')
231232
```
@@ -391,7 +392,7 @@ are implemented:
391392

392393
The default type for a Spira property is `Spira::Types::Any`, which uses
393394
`RDF::Literal`'s automatic boxing/unboxing of XSD types as best it can.
394-
See [`RDF::Literal`](http://rdf.rubyforge.org/RDF/Literal.html) for more information.
395+
See [`RDF::Literal`](https://www.rubydoc.info/github/ruby-rdf/rdf/RDF/Literal.html) for more information.
395396

396397
You can implement your own types as well. Your class' serialize method should
397398
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
504505
list in the the `README`. Alphabetical order applies.
505506
* Do note that in order for us to merge any non-trivial changes (as a rule
506507
of thumb, additions larger than about 15 lines of code), we need an
507-
explicit [public domain dedication][PDD] on record from you.
508+
explicit [public domain dedication][PDD] on record from you,
509+
which you will be asked to agree to on the first commit to a repo within the organization.
510+
Note that the agreement applies to all repos in the [Ruby RDF](https://github.com/ruby-rdf/) organization.
508511

509-
[public-rdf-ruby w3c mailing list]: http://lists.w3.org/Archives/Public/public-rdf-ruby/
510-
[RDF.rb]: http://rubygems.org/gems/rdf
512+
[public-rdf-ruby w3c mailing list]: https://lists.w3.org/Archives/Public/public-rdf-ruby/
513+
[RDF.rb]: https://rubygems.org/gems/rdf
514+
[PDD]: https://unlicense.org/#unlicensing-contributions

Rakefile

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,3 @@ EOC
7474
writer.flush
7575
end
7676
end
77-
78-
desc "Upload docs to rubyforge"
79-
task uploadyardocs: [:yardoc, :addanalytics] do
80-
`rsync -av doc/yard/* [email protected]:/var/www/gforge-projects/spira`
81-
end

UNLICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,4 @@ OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
2121
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
2222
OTHER DEALINGS IN THE SOFTWARE.
2323

24-
For more information, please refer to <http://unlicense.org/>
24+
For more information, please refer to <https:///unlicense.org/>

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.1.1
1+
3.2.0

lib/spira.rb

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
# Spira is a framework for building projections of RDF data into Ruby classes.
1010
# It is built on top of RDF.rb.
1111
#
12-
# @see http://rdf.rubyforge.org
13-
# @see http://github.com/bhuga/spira
12+
# @see https://rubygems.org/gems/rdf
13+
# @see https://github.com/bhuga/spira
1414
# @see Spira::Resource
1515

1616
module Spira
@@ -63,13 +63,14 @@ def clear_repository!
6363

6464
# Execute a block on a specific repository
6565
#
66-
# @param [RDF::Repository] repository the repository to work on
67-
# @param [Symbol] name the repository name
66+
# @param [RDF::Repository] repo the repository to work on
6867
# @yield the block with the instructions while using the repository
68+
# @return [RDF::Repository] the given repository
6969
def using_repository(repo)
7070
old_repository = Spira.repository
7171
Spira.repository = repo
7272
yield if block_given?
73+
repo
7374
ensure
7475
Spira.repository = old_repository
7576
end

lib/spira/base.rb

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,12 +107,16 @@ def id
107107
# Initialize a new Spira::Base instance of this resource class using
108108
# a new blank node subject. Accepts a hash of arguments for initial
109109
# attributes. To use a URI or existing blank node as a subject, use
110-
# {Spira.for} instead.
110+
# the `.for` method on the subclass instead.
111+
#
112+
# @example
113+
# class Person < Spira::Base; end
114+
# bob = Person.for("bob")
111115
#
112116
# @param [Hash{Symbol => Any}] props Default attributes for this instance
113117
# @yield [self] Executes a given block
114118
# @yieldparam [self] self The newly created instance
115-
# @see Spira.for
119+
# @see Spira::Persistence::ClassMethods#for
116120
# @see RDF::URI#as
117121
# @see RDF::Node#as
118122
def initialize(props = {}, options = {})
@@ -188,7 +192,7 @@ def inspect
188192
# an RDF level, and will work across subclasses as long as the attributes
189193
# are the same.
190194
#
191-
# @see http://rdf.rubyforge.org/isomorphic/
195+
# @see https://rubygems.org/gems/rdf-isomorphic/
192196
def ==(other)
193197
# TODO: define behavior for equality on subclasses.
194198
# TODO: should we compare attributes here?

0 commit comments

Comments
 (0)