Skip to content
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

Deprecate == and != from Redis::Future #876

Merged
merged 2 commits into from Sep 19, 2019
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions lib/redis.rb
Expand Up @@ -5,6 +5,10 @@

class Redis

def self.deprecate(message, trace = caller[0])
$stderr.puts "\n#{message} (in #{trace})"
end

def self.current
@current ||= Redis.new
end
Expand Down
7 changes: 7 additions & 0 deletions lib/redis/pipeline.rb
Expand Up @@ -139,6 +139,13 @@ def initialize(command, transformation, timeout)
@object = FutureNotReady
end

def ==(*)
message = "The method == and != is deprecated for Redis::Future and will be removed in 4.2.0"
message << " - You probably meant to call .value == or .value !="
::Redis.deprecate(message)
super
end

def inspect
"<Redis::Future #{@command.inspect}>"
end
Expand Down