Skip to content

Commit 152253f

Browse files
committed
♻️ fix for pr comment
1 parent 5f2201a commit 152253f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lib/redis/namespace.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ def initialize(namespace, options = {})
241241
@deprecations = !!options.fetch(:deprecations) do
242242
ENV['REDIS_NAMESPACE_DEPRECATIONS']
243243
end
244-
@is_client_respond = @redis.respond_to?(:_client)
244+
@has_new_client_method = @redis.respond_to?(:_client)
245245
end
246246

247247
def deprecations?
@@ -253,13 +253,13 @@ def warning?
253253
end
254254

255255
def client
256-
warn("The `client` method broken changed by redis-rb 4.0.0, so we should use `_client` method." +
257-
"`client` method in redis-namespace will remove 2.0 (at #{call_site})") if @is_client_respond
256+
warn("The client method is deprecated as of redis-rb 4.0.0, please use the new _client" +
257+
"method instead. Support for the old method will be removed in redis-namespace 2.0.") if @has_new_client_method
258258
_client
259259
end
260260

261261
def _client
262-
@is_client_respond ? @redis._client : @redis.client # for redis-4.0.0
262+
@has_new_client_method ? @redis._client : @redis.client # for redis-4.0.0
263263
end
264264

265265
# Ruby defines a now deprecated type method so we need to override it here

0 commit comments

Comments
 (0)