Skip to content

Commit fcb97fc

Browse files
committed
Finish 0.6.0
2 parents b1b1578 + c7d9a98 commit fcb97fc

29 files changed

+135
-135
lines changed

.travis.yml

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,23 @@
11
language: ruby
2-
bundler_args: --without debug
32
script: "bundle exec rspec spec"
43
# Handle git submodules yourself
54
git:
65
submodules: false
76
# Use sed to replace the SSH URL with the public URL, then initialize submodules
87
before_install:
9-
- sed -i 's/[email protected]:/https:\/\/github.com\//' .gitmodules
10-
- git submodule update --init --recursive
8+
- sed -i 's/[email protected]:/https:\/\/github.com\//' .gitmodules
9+
- git submodule update --init --recursive
1110
env:
1211
- CI=true
1312
rvm:
14-
- 2.2
15-
- 2.3
1613
- 2.4
17-
- jruby-9
18-
- rbx-3
14+
- 2.5
15+
- 2.6
16+
- 2.7
17+
- jruby
1918
cache: bundler
2019
sudo: false
2120
matrix:
2221
allow_failures:
23-
- rvm: jruby-9
24-
- rvm: rbx-3
22+
- rvm: jruby
2523
dist: trusty

Gemfile

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7,24 +7,21 @@ gem 'json-ld', git: "https://github.com/ruby-rdf/json-ld", br
77
gem 'json-ld-preloaded',git: "https://github.com/ruby-rdf/json-ld-preloaded", branch: "develop"
88

99
group :development, :test do
10-
gem 'ebnf', git: "https://github.com/gkellogg/ebnf", branch: "develop"
11-
#gem 'linkeddata', git: "https://github.com/ruby-rdf/linkeddata", branch: "develop"
12-
gem 'rdf-isomorphic', git: "https://github.com/ruby-rdf/rdf-isomorphic", branch: "develop"
13-
gem 'rdf-turtle', git: "https://github.com/ruby-rdf/rdf-turtle", branch: "develop"
14-
gem 'rdf-xsd', git: "https://github.com/ruby-rdf/rdf-xsd", branch: "develop"
15-
gem 'rdf-spec', git: "https://github.com/ruby-rdf/rdf-spec", branch: "develop"
16-
gem 'sparql', git: "https://github.com/ruby-rdf/sparql", branch: "develop"
17-
gem 'sxp', git: "https://github.com/dryruby/sxp.rb", branch: "develop"
18-
gem 'simplecov', require: false
19-
gem 'coveralls', require: false
10+
gem 'ebnf', git: "https://github.com/dryruby/ebnf", branch: "develop"
11+
#gem 'linkeddata', git: "https://github.com/ruby-rdf/linkeddata", branch: "develop"
12+
gem 'rdf-aggregate-repo', git: "https://github.com/ruby-rdf/rdf-aggregate-repo", branch: "develop"
13+
gem 'rdf-rdfa', git: "https://github.com/ruby-rdf/rdf-rdfa", branch: "develop"
14+
gem 'rdf-isomorphic', git: "https://github.com/ruby-rdf/rdf-isomorphic", branch: "develop"
15+
gem 'rdf-turtle', git: "https://github.com/ruby-rdf/rdf-turtle", branch: "develop"
16+
gem 'rdf-xsd', git: "https://github.com/ruby-rdf/rdf-xsd", branch: "develop"
17+
gem 'rdf-spec', git: "https://github.com/ruby-rdf/rdf-spec", branch: "develop"
18+
gem 'sparql', git: "https://github.com/ruby-rdf/sparql", branch: "develop"
19+
gem 'sxp', git: "https://github.com/dryruby/sxp.rb", branch: "develop"
20+
gem 'simplecov', platforms: :mri
21+
gem 'coveralls', '~> 0.8', platforms: :mri
2022
gem 'earl-report'
2123
end
2224

2325
group :debug do
2426
gem "byebug", platform: :mri
2527
end
26-
27-
platforms :rbx do
28-
gem 'rubysl', '~> 2.0'
29-
gem 'rubinius', '~> 2.0'
30-
end

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ This is a pure-Ruby library for working with the [Shape Expressions Language][Sh
88
[![Build Status](https://travis-ci.org/ruby-rdf/shex.png?branch=master)](http://travis-ci.org/ruby-rdf/shex)
99
[![Coverage Status](https://coveralls.io/repos/ruby-rdf/shex/badge.svg)](https://coveralls.io/r/ruby-rdf/shex)
1010
[![Join the chat at https://gitter.im/ruby-rdf/rdf](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/ruby-rdf/rdf?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
11+
[![DOI](https://zenodo.org/badge/74419330.svg)](https://zenodo.org/badge/latestdoi/74419330)
1112

1213
## Features
1314

@@ -192,8 +193,8 @@ The result of parsing either ShExC or ShExJ is the creation of a set of executab
192193

193194
## Dependencies
194195

195-
* [Ruby](http://ruby-lang.org/) (>= 2.2.2)
196-
* [RDF.rb](http://rubygems.org/gems/rdf) (~> 2.2)
196+
* [Ruby](http://ruby-lang.org/) (>= 2.4)
197+
* [RDF.rb](http://rubygems.org/gems/rdf) (~> 3.1)
197198

198199
## Installation
199200

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.5.2
1+
0.6.0

lib/shex.rb

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,13 @@ module ShEx
3333
# @raise (see ShEx::Parser#parse)
3434
def self.parse(expression, format: 'shexc', **options)
3535
case format.to_s
36-
when 'shexc' then Parser.new(expression, options).parse
36+
when 'shexc' then Parser.new(expression, **options).parse
3737
when 'shexj'
3838
expression = expression.read if expression.respond_to?(:read)
39-
Algebra.from_shexj(JSON.parse(expression), options)
39+
Algebra.from_shexj(JSON.parse(expression), **options)
4040
when 'sxp'
4141
expression = expression.read if expression.respond_to?(:read)
42-
Algebra.from_sxp(expression, options)
42+
Algebra.from_sxp(expression, **options)
4343
else raise "Unknown expression format: #{format.inspect}"
4444
end
4545
end
@@ -56,8 +56,8 @@ def self.parse(expression, format: 'shexc', **options)
5656
# @return (see ShEx::Parser#parse)
5757
# @raise (see ShEx::Parser#parse)
5858
def self.open(filename, format: 'shexc', **options, &block)
59-
RDF::Util::File.open_file(filename, options) do |file|
60-
self.parse(file, options.merge(format: format))
59+
RDF::Util::File.open_file(filename, **options) do |file|
60+
self.parse(file, format: format, **options)
6161
end
6262
end
6363

@@ -73,10 +73,10 @@ def self.open(filename, format: 'shexc', **options, &block)
7373
# @return (see ShEx::Algebra::Schema#execute)
7474
# @raise (see ShEx::Algebra::Schema#execute)
7575
def self.execute(expression, queryable, map, format: 'shexc', **options)
76-
shex = self.parse(expression, options.merge(format: format))
76+
shex = self.parse(expression, format: format, **options)
7777
queryable = queryable || RDF::Graph.new
7878

79-
shex.execute(queryable, map, options)
79+
shex.execute(queryable, map, **options)
8080
end
8181

8282
##
@@ -91,10 +91,10 @@ def self.execute(expression, queryable, map, format: 'shexc', **options)
9191
# @return (see ShEx::Algebra::Schema#satisfies?)
9292
# @raise (see ShEx::Algebra::Schema#satisfies?)
9393
def self.satisfies?(expression, queryable, map, format: 'shexc', **options)
94-
shex = self.parse(expression, options.merge(format: format))
94+
shex = self.parse(expression, format: format, **options)
9595
queryable = queryable || RDF::Graph.new
9696

97-
shex.satisfies?(queryable, map, options)
97+
shex.satisfies?(queryable, map, **options)
9898
end
9999

100100
##
@@ -116,7 +116,7 @@ class Error < StandardError
116116
# @param [String, #to_s] message
117117
# @param [Hash{Symbol => Object}] options
118118
# @option options [Integer] :code (422)
119-
def initialize(message, options = {})
119+
def initialize(message, **options)
120120
@code = options.fetch(:status_code, 422)
121121
super(message.to_s)
122122
end

lib/shex/algebra.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ module Algebra
5050
# @option options [RDF::URI] :base
5151
# @option options [Hash{String => RDF::URI}] :prefixes
5252
# @return [Operator]
53-
def self.from_shexj(operator, options = {})
53+
def self.from_shexj(operator, **options)
5454
raise ArgumentError unless operator.is_a?(Hash)
5555
klass = case operator['type']
5656
when 'Annotation' then Annotation
@@ -76,7 +76,7 @@ def self.from_shexj(operator, options = {})
7676
else raise ArgumentError, "unknown type #{operator['type'].inspect}"
7777
end
7878

79-
klass.from_shexj(operator, options)
79+
klass.from_shexj(operator, **options)
8080
end
8181
end
8282
end

lib/shex/algebra/and.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ def initialize(*args, **options)
1919
# Creates an operator instance from a parsed ShExJ representation
2020
# @param (see Operator#from_shexj)
2121
# @return [Operator]
22-
def self.from_shexj(operator, options = {})
22+
def self.from_shexj(operator, **options)
2323
raise ArgumentError unless operator.is_a?(Hash) && operator['type'] == 'ShapeAnd'
2424
raise ArgumentError, "missing shapeExprs in #{operator.inspect}" unless operator.has_key?('shapeExprs')
2525
super

lib/shex/algebra/annotation.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ class Annotation < Operator
77
# Creates an operator instance from a parsed ShExJ representation
88
# @param (see Operator#from_shexj)
99
# @return [Operator]
10-
def self.from_shexj(operator, options = {})
10+
def self.from_shexj(operator, **options)
1111
raise ArgumentError unless operator.is_a?(Hash) && operator['type'] == "Annotation"
1212
raise ArgumentError, "missing predicate in #{operator.inspect}" unless operator.has_key?('predicate')
1313
raise ArgumentError, "missing object in #{operator.inspect}" unless operator.has_key?('object')

lib/shex/algebra/each_of.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ class EachOf < Operator
88
# Creates an operator instance from a parsed ShExJ representation
99
# @param (see Operator#from_shexj)
1010
# @return [Operator]
11-
def self.from_shexj(operator, options = {})
11+
def self.from_shexj(operator, **options)
1212
raise ArgumentError unless operator.is_a?(Hash) && operator['type'] == 'EachOf'
1313
raise ArgumentError, "missing expressions in #{operator.inspect}" unless operator.has_key?('expressions')
1414
super

lib/shex/algebra/node_constraint.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ class NodeConstraint < Operator
99
# Creates an operator instance from a parsed ShExJ representation
1010
# @param (see Operator#from_shexj)
1111
# @return [Operator]
12-
def self.from_shexj(operator, options = {})
12+
def self.from_shexj(operator, **options)
1313
raise ArgumentError unless operator.is_a?(Hash) && operator['type'] == 'NodeConstraint'
1414
super
1515
end

0 commit comments

Comments
 (0)