mirror of
https://github.com/samsonjs/rack-attack.git
synced 2026-03-25 09:25:49 +00:00
style: enable Style/ParallelAssignment cop checks
This commit is contained in:
parent
9d2e66e4eb
commit
c0328707b1
4 changed files with 11 additions and 3 deletions
|
|
@ -67,6 +67,9 @@ Style/HashSyntax:
|
|||
Style/OptionalArguments:
|
||||
Enabled: true
|
||||
|
||||
Style/ParallelAssignment:
|
||||
Enabled: true
|
||||
|
||||
Style/RaiseArgs:
|
||||
Enabled: true
|
||||
|
||||
|
|
|
|||
|
|
@ -119,7 +119,10 @@ module Rack
|
|||
end
|
||||
|
||||
def clear_configuration
|
||||
@safelists, @blocklists, @throttles, @tracks = {}, {}, {}, {}
|
||||
@safelists = {}
|
||||
@blocklists = {}
|
||||
@throttles = {}
|
||||
@tracks = {}
|
||||
self.anonymous_blocklists = []
|
||||
self.anonymous_safelists = []
|
||||
end
|
||||
|
|
|
|||
|
|
@ -5,7 +5,8 @@ module Rack
|
|||
class Check
|
||||
attr_reader :name, :block, :type
|
||||
def initialize(name, options = {}, &block)
|
||||
@name, @block = name, block
|
||||
@name = name
|
||||
@block = block
|
||||
@type = options.fetch(:type, nil)
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -7,7 +7,8 @@ module Rack
|
|||
|
||||
attr_reader :name, :limit, :period, :block, :type
|
||||
def initialize(name, options, &block)
|
||||
@name, @block = name, block
|
||||
@name = name
|
||||
@block = block
|
||||
MANDATORY_OPTIONS.each do |opt|
|
||||
raise ArgumentError, "Must pass #{opt.inspect} option" unless options[opt]
|
||||
end
|
||||
|
|
|
|||
Loading…
Reference in a new issue