style: limit line length to 120 columns

This commit is contained in:
Gonzalo Rodriguez 2019-08-02 10:51:53 -03:00
parent 9a042ad19a
commit f5a352b8f9
No known key found for this signature in database
GPG key ID: 5DB8B81B049B8AB1
6 changed files with 26 additions and 5 deletions

View file

@ -26,6 +26,9 @@ Naming:
Exclude:
- "lib/rack/attack/path_normalizer.rb"
Metrics/LineLength:
Max: 120
Performance:
Enabled: true

View file

@ -73,7 +73,10 @@ module Rack
def enforce_store_method_presence!(method_name)
if !store.respond_to?(method_name)
raise Rack::Attack::MisconfiguredStoreError, "Configured store #{store.class.name} doesn't respond to ##{method_name} method"
raise(
Rack::Attack::MisconfiguredStoreError,
"Configured store #{store.class.name} doesn't respond to ##{method_name} method"
)
end
end
end

View file

@ -7,7 +7,9 @@ module Rack
module StoreProxy
class ActiveSupportRedisStoreProxy < SimpleDelegator
def self.handle?(store)
defined?(::Redis) && defined?(::ActiveSupport::Cache::RedisStore) && store.is_a?(::ActiveSupport::Cache::RedisStore)
defined?(::Redis) &&
defined?(::ActiveSupport::Cache::RedisStore) &&
store.is_a?(::ActiveSupport::Cache::RedisStore)
end
def increment(name, amount = 1, options = {})

View file

@ -7,7 +7,9 @@ module Rack
module StoreProxy
class MemCacheStoreProxy < SimpleDelegator
def self.handle?(store)
defined?(::Dalli) && defined?(::ActiveSupport::Cache::MemCacheStore) && store.is_a?(::ActiveSupport::Cache::MemCacheStore)
defined?(::Dalli) &&
defined?(::ActiveSupport::Cache::MemCacheStore) &&
store.is_a?(::ActiveSupport::Cache::MemCacheStore)
end
def write(name, value, options = {})

View file

@ -2,7 +2,13 @@
require_relative "../../spec_helper"
if defined?(::ConnectionPool) && defined?(::Redis) && Gem::Version.new(::Redis::VERSION) >= Gem::Version.new("4") && defined?(::ActiveSupport::Cache::RedisCacheStore)
should_run =
defined?(::ConnectionPool) &&
defined?(::Redis) &&
Gem::Version.new(::Redis::VERSION) >= Gem::Version.new("4") &&
defined?(::ActiveSupport::Cache::RedisCacheStore)
if should_run
require_relative "../../support/cache_store_helper"
require "timecop"

View file

@ -2,7 +2,12 @@
require_relative "../../spec_helper"
if defined?(::Redis) && Gem::Version.new(::Redis::VERSION) >= Gem::Version.new("4") && defined?(::ActiveSupport::Cache::RedisCacheStore)
should_run =
defined?(::Redis) &&
Gem::Version.new(::Redis::VERSION) >= Gem::Version.new("4") &&
defined?(::ActiveSupport::Cache::RedisCacheStore)
if should_run
require_relative "../../support/cache_store_helper"
require "timecop"