Skip to content

Commit 46e95a4

Browse files
committed
Release 4.1.4
1 parent 5694b00 commit 46e95a4

File tree

5 files changed

+31
-9
lines changed

5 files changed

+31
-9
lines changed

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
# Unreleased
22

3+
# 4.1.4
4+
5+
* Alias `Redis#disconnect` as `#close`. See #901.
6+
* Handle clusters with multiple slot ranges. See #894.
7+
* Fix password authentication to a redis cluster. See #889.
8+
* Handle recursive MOVED responses. See #882.
9+
* Increase buffer size in the ruby connector. See #880.
10+
* Fix thread safety of `Redis.queue`. See #878.
11+
* Deprecate `Redis::Future#==` as it's likely to be a mistake. See #876.
12+
313
# 4.1.3
414

515
* Fix the client hanging forever when connecting with SSL to a non-SSL server. See #835.

lib/redis.rb

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,6 @@
44
require_relative "redis/errors"
55

66
class Redis
7-
8-
def self.deprecate(message, trace = caller[0])
9-
$stderr.puts "\n#{message} (in #{trace})"
10-
end
11-
127
def self.current
138
@current ||= Redis.new
149
end

lib/redis/pipeline.rb

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -140,10 +140,17 @@ def initialize(command, transformation, timeout)
140140
@object = FutureNotReady
141141
end
142142

143-
def ==(*)
144-
message = "The method == and != is deprecated for Redis::Future and will be removed in 4.2.0"
143+
def ==(_other)
144+
message = +"The methods == and != are deprecated for Redis::Future and will be removed in 4.2.0"
145145
message << " - You probably meant to call .value == or .value !="
146-
::Redis.deprecate(message)
146+
message << " (#{::Kernel.caller(1, 1).first})\n"
147+
148+
if defined?(::Warning)
149+
::Warning.warn(message)
150+
else
151+
$stderr.puts(message)
152+
end
153+
147154
super
148155
end
149156

lib/redis/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# frozen_string_literal: true
22
class Redis
3-
VERSION = '4.1.3'
3+
VERSION = '4.1.4'
44
end

test/pipelining_commands_test.rb

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,16 @@ def test_futures_raise_when_command_errors_and_needs_transformation
135135
end
136136
end
137137

138+
def test_futures_warn_when_tested_for_equality
139+
r.pipelined do
140+
@result = r.sadd("foo", 1)
141+
end
142+
143+
assert_output(nil, /deprecated/) do
144+
@result == @result
145+
end
146+
end
147+
138148
def test_futures_can_be_identified
139149
r.pipelined do
140150
@result = r.sadd("foo", 1)

0 commit comments

Comments
 (0)