Skip to content

Commit 797e9cb

Browse files
committed
Updates for 3.1 release and Ruby 2.7 calling sequences.
1 parent 33ed3ac commit 797e9cb

4 files changed

Lines changed: 18 additions & 25 deletions

File tree

.travis.yml

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,18 @@
11
language: ruby
2-
bundler_args: --without debug
32
script: "bundle exec rspec spec"
4-
before_install:
5-
- 'gem update --system --conservative || (gem i "rubygems-update:~>2.7" --no-document && update_rubygems)'
6-
- 'gem update bundler --conservative'
73
env:
84
- CI=true
95
services:
106
- mongodb
117
rvm:
12-
- 2.2
13-
- 2.3
148
- 2.4
159
- 2.5
1610
- 2.6
17-
- jruby-9
18-
- rbx-3
11+
- 2.7
12+
- jruby
1913
cache: bundler
2014
sudo: false
2115
matrix:
2216
allow_failures:
23-
- rvm: jruby-9
24-
- rvm: rbx-3
17+
- rvm: jruby
2518
dist: trusty

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.2.1
1+
3.1.0

lib/rdf/mongo.rb

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -118,13 +118,13 @@ class Repository < ::RDF::Repository
118118
##
119119
# Initializes this repository instance.
120120
#
121-
# @overload initialize(options = {}, &block)
121+
# @overload initialize(**options, &block)
122122
# @param [Hash{Symbol => Object}] options
123123
# @option options [String, #to_s] :title (nil)
124124
# @option options [URI, #to_s] :uri (nil)
125125
# URI in the form `mongodb://host:port/db`. The URI should also identify the collection use, but appending a `collection` path component such as `mongodb://host:port/db/collection`, this ensures that the collection will be maintained if cloned. See [Mongo::Client options](https://docs.mongodb.org/ecosystem/tutorial/ruby-driver-tutorial-2-0/#uri-options-conversions) for more information on Mongo URIs.
126126
#
127-
# @overload initialize(options = {}, &block)
127+
# @overload initialize(**options, &block)
128128
# @param [Hash{Symbol => Object}] options
129129
# See [Mongo::Client options](https://docs.mongodb.org/ecosystem/tutorial/ruby-driver-tutorial-2-0/#uri-options-conversions) for more information on Mongo Client options.
130130
# @option options [String, #to_s] :title (nil)
@@ -136,7 +136,7 @@ class Repository < ::RDF::Repository
136136
#
137137
# @yield [repository]
138138
# @yieldparam [Repository] repository
139-
def initialize(options = {}, &block)
139+
def initialize(**options, &block)
140140
collection = nil
141141
if options[:uri]
142142
options = options.dup
@@ -145,14 +145,14 @@ def initialize(options = {}, &block)
145145
collection = coll || options.delete(:collection)
146146
db ||= "quadb"
147147
uri.path = "/#{db}" if coll
148-
@client = ::Mongo::Client.new(uri.to_s, options)
148+
@client = ::Mongo::Client.new(uri.to_s, **options)
149149
else
150150
warn "[DEPRECATION] RDF::Mongo::Repository#initialize expects a uri argument. Called from #{Gem.location_of_caller.join(':')}" unless options.empty?
151151
options[:database] ||= options.delete(:db) # 1.x compat
152152
options[:database] ||= 'quadb'
153153
hosts = Array(options[:host] || 'localhost')
154154
hosts.map! {|h| "#{h}:#{options[:port]}"} if options[:port]
155-
@client = ::Mongo::Client.new(hosts, options)
155+
@client = ::Mongo::Client.new(hosts, **options)
156156
end
157157

158158
@collection = @client[options.delete(:collection) || 'quads']
@@ -258,8 +258,8 @@ def has_graph?(value)
258258
# @private
259259
# @see RDF::Queryable#query_pattern
260260
# @see RDF::Query::Pattern
261-
def query_pattern(pattern, options = {}, &block)
262-
return enum_for(:query_pattern, pattern, options) unless block_given?
261+
def query_pattern(pattern, **options, &block)
262+
return enum_for(:query_pattern, pattern, **options) unless block_given?
263263
@nodes = {} # reset cache. FIXME this should probably be in Node.intern
264264

265265
# A pattern graph_name of `false` is used to indicate the default graph

rdf-mongo.gemspec

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,15 @@ Gem::Specification.new do |gem|
2525
gem.require_paths = %w(lib)
2626
gem.test_files = Dir.glob('spec/*.spec')
2727

28-
gem.required_ruby_version = '>= 2.2.2'
28+
gem.required_ruby_version = '>= 2.4'
2929
gem.requirements = []
30-
gem.add_runtime_dependency 'rdf', '>= 3.0'
31-
gem.add_runtime_dependency 'mongo', '~> 2.4'
30+
gem.add_runtime_dependency 'rdf', '>= 3.1'
31+
gem.add_runtime_dependency 'mongo', '~> 2.11'
3232

33-
gem.add_development_dependency 'rdf-spec', '>= 3.0'
34-
gem.add_development_dependency 'rspec', '~> 3.7'
35-
gem.add_development_dependency 'rspec-its', '~> 1.2'
36-
gem.add_development_dependency 'yard', '~> 0.9.12'
33+
gem.add_development_dependency 'rdf-spec', '>= 3.1'
34+
gem.add_development_dependency 'rspec', '~> 3.9'
35+
gem.add_development_dependency 'rspec-its', '~> 1.3'
36+
gem.add_development_dependency 'yard', '~> 0.9.20'
3737

3838
gem.post_install_message = "Have fun! :)"
3939
end

0 commit comments

Comments
 (0)