style: update to latest rubocop

This commit is contained in:
Gonzalo Rodriguez 2019-08-02 17:04:52 -03:00
parent 8fafa7602b
commit 0ce6befd68
No known key found for this signature in database
GPG key ID: 5DB8B81B049B8AB1
4 changed files with 10 additions and 6 deletions

View file

@ -1,3 +1,6 @@
require:
- rubocop-performance
inherit_mode:
merge:
- Exclude

View file

@ -67,7 +67,7 @@ module Rack
end
def safelists
@safelists ||= {}
@safelists ||= {}
end
def blocklists
@ -75,11 +75,11 @@ module Rack
end
def throttles
@throttles ||= {}
@throttles ||= {}
end
def tracks
@tracks ||= {}
@tracks ||= {}
end
def safelisted?(request)
@ -136,7 +136,7 @@ module Rack
# Set defaults
@anonymous_blocklists = []
@anonymous_safelists = []
@notifier = ActiveSupport::Notifications if defined?(ActiveSupport::Notifications)
@notifier = ActiveSupport::Notifications if defined?(ActiveSupport::Notifications)
@blocklisted_response = lambda { |_env| [403, { 'Content-Type' => 'text/plain' }, ["Forbidden\n"]] }
@throttled_response = lambda do |env|
retry_after = (env['rack.attack.match_data'] || {})[:period]

View file

@ -12,7 +12,7 @@ module Rack
MANDATORY_OPTIONS.each do |opt|
raise ArgumentError, "Must pass #{opt.inspect} option" unless options[opt]
end
@limit = options[:limit]
@limit = options[:limit]
@period = options[:period].respond_to?(:call) ? options[:period] : options[:period].to_i
@type = options.fetch(:type, :throttle)
end

View file

@ -37,7 +37,8 @@ Gem::Specification.new do |s|
s.add_development_dependency "minitest-stub-const", "~> 0.6"
s.add_development_dependency 'rack-test', "~> 1.0"
s.add_development_dependency 'rake', "~> 12.3"
s.add_development_dependency "rubocop", "0.67.2"
s.add_development_dependency "rubocop", "0.74.0"
s.add_development_dependency "rubocop-performance", "~> 1.4.1"
s.add_development_dependency "timecop", "~> 0.9.1"
# byebug only works with MRI