mirror of
https://github.com/samsonjs/rack-attack.git
synced 2026-04-27 15:07:41 +00:00
Fixes warning instead of hiding it
Warning was: 'warning: instance variable @data not initialized'
This commit is contained in:
parent
e8102910bf
commit
218a320a3d
2 changed files with 4 additions and 2 deletions
1
Rakefile
1
Rakefile
|
|
@ -10,7 +10,6 @@ namespace :test do
|
||||||
|
|
||||||
Rake::TestTask.new(:integration) do |t|
|
Rake::TestTask.new(:integration) do |t|
|
||||||
t.pattern = "spec/integration/*_spec.rb"
|
t.pattern = "spec/integration/*_spec.rb"
|
||||||
t.warning = false
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,10 @@ module Rack
|
||||||
# We also want to use the underlying Dalli client instead of ::ActiveSupport::Cache::MemCacheStore,
|
# We also want to use the underlying Dalli client instead of ::ActiveSupport::Cache::MemCacheStore,
|
||||||
# and the MemCache client if using Rails 3.x
|
# and the MemCache client if using Rails 3.x
|
||||||
|
|
||||||
|
if store.instance_variable_defined?(:@data)
|
||||||
client = store.instance_variable_get(:@data)
|
client = store.instance_variable_get(:@data)
|
||||||
|
end
|
||||||
|
|
||||||
if ACTIVE_SUPPORT_WRAPPER_CLASSES.include?(store.class.to_s) && ACTIVE_SUPPORT_CLIENTS.include?(client.class.to_s)
|
if ACTIVE_SUPPORT_WRAPPER_CLASSES.include?(store.class.to_s) && ACTIVE_SUPPORT_CLIENTS.include?(client.class.to_s)
|
||||||
client
|
client
|
||||||
else
|
else
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue