From 0b0c5aeb76fe7e8a0b50476110ba340a76f1a1d3 Mon Sep 17 00:00:00 2001 From: Nicolas Leger Date: Mon, 19 Feb 2018 17:01:02 +0100 Subject: [PATCH 1/3] [CI] Test against Ruby 2.4 and 2.5 --- .travis.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.travis.yml b/.travis.yml index 5e7df530..8756753b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,6 +7,8 @@ rvm: - 2.1 - 2.2 - 2.3 + - 2.4 + - 2.5 - jruby-9.1.5.0 before_install: - gem update --system From bd7be41f63f1b51fea28dcbbaaf8e1f3519460d4 Mon Sep 17 00:00:00 2001 From: Nicolas Leger Date: Mon, 19 Feb 2018 21:15:14 +0100 Subject: [PATCH 2/3] Fix Ruby 2.4 and 2.5 compatibility removing slice --- lib/riak/map_reduce.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/riak/map_reduce.rb b/lib/riak/map_reduce.rb index 7ee1d03f..0d6cea9e 100644 --- a/lib/riak/map_reduce.rb +++ b/lib/riak/map_reduce.rb @@ -203,9 +203,11 @@ def reduce(*params) # @see Phase#initialize def link(*params) options = params.extract_options! - walk_spec_options = options.slice!(:type, :function, :language, :arg) unless params.first + phase_options_keys = [:type, :function, :language, :arg] + walk_spec_options = options.reject { |key| phase_options_keys.include? key } unless params.first walk_spec = WalkSpec.normalize(params.shift || walk_spec_options).first - @query << Phase.new({:type => :link, :function => walk_spec}.merge(options)) + phase_options = walk_spec_options ? options.slice(*phase_options_keys) : options + @query << Phase.new({:type => :link, :function => walk_spec}.merge(phase_options)) self end From 96534f4ed7a74e75562700641e3308ad7992edb3 Mon Sep 17 00:00:00 2001 From: Nicolas Leger Date: Tue, 20 Feb 2018 11:39:21 +0100 Subject: [PATCH 3/3] Run Bignum check before Fixnum because now Integer since Ruby >= 2.4 --- lib/riak/client/beefcake/ts_cell_codec.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/riak/client/beefcake/ts_cell_codec.rb b/lib/riak/client/beefcake/ts_cell_codec.rb index 45082d0f..07d51956 100644 --- a/lib/riak/client/beefcake/ts_cell_codec.rb +++ b/lib/riak/client/beefcake/ts_cell_codec.rb @@ -34,10 +34,10 @@ def cell_for(measure) TsCell.new case measure when String { varchar_value: measure } - when Fixnum - { sint64_value: measure } when Bignum { sint64_value: check_bignum_range(measure) } + when Fixnum + { sint64_value: measure } when Float { double_value: measure } when BigDecimal