Prefer Gem::Version for version comparisons

This commit is contained in:
Gonzalo Rodriguez 2018-06-29 15:27:36 -03:00
parent 85c4c085c9
commit eb07d9789f
No known key found for this signature in database
GPG key ID: 5DB8B81B049B8AB1

View file

@ -7,8 +7,9 @@ module Rack
module StoreProxy
class RedisStoreProxy < SimpleDelegator
def initialize(*args)
major_version = Redis::VERSION.split('.').first.to_i
warn 'RackAttack requires Redis gem >= 3.0.0.' if major_version < 3
if Gem::Version.new(Redis::VERSION) < Gem::Version.new("3")
warn 'RackAttack requires Redis gem >= 3.0.0.'
end
super(*args)
end