Skip to content

Commit

Permalink
Finish 3.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
gkellogg committed Dec 16, 2019
2 parents 3d6b913 + e7660ee commit e75bf0c
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 49 deletions.
12 changes: 5 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
language: ruby
bundler_args: --without debug
script: "bundle exec rspec spec"
env:
- CI=true
rvm:
- 2.2
- 2.3
- 2.4
- jruby-9
- rbx-3
- 2.5
- 2.6
- 2.7
- jruby
cache: bundler
sudo: false
matrix:
allow_failures:
- rvm: jruby-9
- rvm: rbx-3
- rvm: jruby
dist: trusty
8 changes: 1 addition & 7 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ gem "rdf", github: "ruby-rdf/rdf", branch: "develop"
gem "rdf-spec", github: "ruby-rdf/rdf-spec", branch: "develop"
gem 'rdf-isomorphic', github: "ruby-rdf/rdf-isomorphic", branch: "develop"
gem "rdf-turtle", github: "ruby-rdf/rdf-turtle", branch: "develop"
gem 'ebnf', github: "gkellogg/ebnf", branch: "develop"
gem 'ebnf', github: "dryruby/ebnf", branch: "develop"
gem 'sxp', github: "dryruby/sxp.rb", branch: "develop"

group :debug do
Expand All @@ -18,9 +18,3 @@ end
group :test do
gem "rake"
end

platforms :rbx do
gem 'rubysl', '~> 2.0'
gem 'rubinius', '~> 2.0'
end

4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ Maps named graphs from one or more `RDF::Queryable` instances into a single data

## Dependencies

* [Ruby](http://ruby-lang.org/) (>= 2.2.2)
* [RDF.rb][] (>= 2.0)
* [Ruby](http://ruby-lang.org/) (>= 2.4)
* [RDF.rb][] (~> 3.1)

## Mailing List

Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.2.1
3.1.0
14 changes: 7 additions & 7 deletions lib/rdf/aggregate_repo.rb
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class AggregateRepo < RDF::Dataset
##
# Create a new aggregation instance.
#
# @overload initialize(queryable = [], options = {})
# @overload initialize(queryable = [], **options)
# @param [Array<RDF::Queryable>] queryable ([])
# @param [Hash{Symbol => Object}] options ({})
# @yield aggregation
Expand Down Expand Up @@ -297,26 +297,26 @@ def default_graph
# @yieldreturn [void] ignored
# @return [void] ignored
# @see RDF::Queryable#query_pattern
def query_pattern(pattern, options = {}, &block)
return enum_for(:query_pattern, pattern, options) unless block_given?
def query_pattern(pattern, **options, &block)
return enum_for(:query_pattern, pattern, **options) unless block_given?
case pattern.graph_name
when nil
# Query against all graphs
each_graph {|graph| graph.send(:query_pattern, pattern, options, &block)}
each_graph {|graph| graph.send(:query_pattern, pattern, **options, &block)}
when FalseClass
# Query against default graph only
default_graph.send(:query_pattern, pattern, options, &block)
default_graph.send(:query_pattern, pattern, **options, &block)
when RDF::Query::Variable
# Query against all named graphs
each_graph do |graph|
source = sources.reverse.detect {|s| s.has_graph?(graph.graph_name)}
RDF::Graph.new(graph_name: graph.graph_name, data: source).send(:query_pattern, pattern, options, &block)
RDF::Graph.new(graph_name: graph.graph_name, data: source).send(:query_pattern, pattern, **options, &block)
end
else
# Query against a specific graph
if @named_graphs.include?(pattern.graph_name)
source = sources.reverse.detect {|s| s.has_graph?(pattern.graph_name)}
RDF::Graph.new(graph_name: pattern.graph_name, data: source).send(:query_pattern, pattern, options, &block)
RDF::Graph.new(graph_name: pattern.graph_name, data: source).send(:query_pattern, pattern, **options, &block)
end
end
end
Expand Down
22 changes: 10 additions & 12 deletions lib/rdf/aggregate_repo/merge_graph.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,16 +40,14 @@ class MergeGraph
##
# Create a new aggregation instance.
#
# @overload initialize(queryable = [], options = {})
# @param [Hash{Symbol => Object}] options ({})
# @option options [RDF::Resource] :graph_name
# @option options [RDF::Resource] :name alias for :graph_name
# @yield merger
# @yieldparam [RDF::MergeGraph] self
# @yieldreturn [void] ignored
def initialize(options = {}, &block)
# @param [RDF::Resource] :graph_name
# @param [RDF::Resource] :name alias for :graph_name
# @yield merger
# @yieldparam [RDF::MergeGraph] self
# @yieldreturn [void] ignored
def initialize(graph_name: nil, name: nil, &block)
@sources = []
@graph_name = options[:graph_name] || options[:name]
@graph_name = graph_name || name

if block_given?
case block.arity
Expand Down Expand Up @@ -186,12 +184,12 @@ def each_graph(&block)
##
# @private
# @see RDF::Queryable#query_pattern
def query_pattern(pattern, options = {}, &block)
return enum_for(:query_pattern, pattern, options) unless block_given?
def query_pattern(pattern, **options, &block)
return enum_for(:query_pattern, pattern, **options) unless block_given?
pattern = pattern.dup
sources.each do |(source, gn)|
pattern.graph_name = gn
source.send(:query_pattern, pattern, options, &block)
source.send(:query_pattern, pattern, **options, &block)
end
end
end
Expand Down
20 changes: 7 additions & 13 deletions rdf-aggregate-repo.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -17,21 +17,15 @@ Gem::Specification.new do |gem|
gem.platform = Gem::Platform::RUBY
gem.files = %w(AUTHORS README.md UNLICENSE VERSION etc/doap.ttl) + Dir.glob('lib/**/*.rb')
gem.require_paths = %w(lib)
gem.extensions = %w()
gem.test_files = %w()
gem.has_rdoc = false

gem.required_ruby_version = '>= 2.2.2'
gem.required_ruby_version = '>= 2.4'
gem.requirements = []
#gem.add_runtime_dependency 'rdf', '~> 3.0'
#gem.add_development_dependency 'rdf-spec', '~> 3.0'
#gem.add_development_dependency 'rdf-turtle', '~> 3.0'
gem.add_runtime_dependency 'rdf', '>= 2.2', '< 4.0'
gem.add_development_dependency 'rdf-spec', '>= 2.2', '< 4.0'
gem.add_development_dependency 'rdf-turtle', '>= 2.2', '< 4.0'
gem.add_development_dependency 'rspec', '~> 3.7'
gem.add_development_dependency 'rspec-its', '~> 1.2'
gem.add_development_dependency 'yard', '~> 0.9'
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_development_dependency 'rspec-its', '~> 1.3'
gem.add_development_dependency 'yard', '~> 0.9.20'

gem.post_install_message = nil
end

0 comments on commit e75bf0c

Please sign in to comment.