mirror of
https://github.com/samsonjs/rack-attack.git
synced 2026-04-22 14:05:58 +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
|
module StoreProxy
|
||||||
class RedisStoreProxy < SimpleDelegator
|
class RedisStoreProxy < SimpleDelegator
|
||||||
def initialize(*args)
|
def initialize(*args)
|
||||||
major_version = Redis::VERSION.split('.').first.to_i
|
if Gem::Version.new(Redis::VERSION) < Gem::Version.new("3")
|
||||||
warn 'RackAttack requires Redis gem >= 3.0.0.' if major_version < 3
|
warn 'RackAttack requires Redis gem >= 3.0.0.'
|
||||||
|
end
|
||||||
|
|
||||||
super(*args)
|
super(*args)
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue