mirror of
https://github.com/samsonjs/rack-attack.git
synced 2026-03-26 09:35:49 +00:00
Prefer Gem::Version for version comparisons
This commit is contained in:
parent
85c4c085c9
commit
eb07d9789f
1 changed files with 3 additions and 2 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue