Skip to content

Avoid Fixnum deprecation warning on Ruby trunk #660

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 20, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions lib/redis/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -451,12 +451,12 @@ def _parse_options(options)
case options[:tcp_keepalive]
when Hash
[:time, :intvl, :probes].each do |key|
unless options[:tcp_keepalive][key].is_a?(Fixnum)
raise "Expected the #{key.inspect} key in :tcp_keepalive to be a Fixnum"
unless options[:tcp_keepalive][key].is_a?(Integer)
raise "Expected the #{key.inspect} key in :tcp_keepalive to be an Integer"
end
end

when Fixnum
when Integer
if options[:tcp_keepalive] >= 60
options[:tcp_keepalive] = {:time => options[:tcp_keepalive] - 20, :intvl => 10, :probes => 2}

Expand Down
2 changes: 1 addition & 1 deletion test/remote_server_control_commands_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ def test_object
assert_equal 1, r.object(:refcount, "list")
encoding = r.object(:encoding, "list")
assert "ziplist" == encoding || "quicklist" == encoding, "Wrong encoding for list"
assert r.object(:idletime, "list").kind_of?(Fixnum)
assert r.object(:idletime, "list").kind_of?(Integer)
end

def test_sync
Expand Down