mirror of
https://github.com/samsonjs/rack-attack.git
synced 2026-03-25 09:25:49 +00:00
style: enable Style/SingleLineMethods rubocop
This commit is contained in:
parent
8e3077c845
commit
a0259fb14a
3 changed files with 18 additions and 5 deletions
|
|
@ -55,3 +55,6 @@ Style/RedundantBegin:
|
|||
|
||||
Style/RedundantFreeze:
|
||||
Enabled: true
|
||||
|
||||
Style/SingleLineMethods:
|
||||
Enabled: true
|
||||
|
|
|
|||
|
|
@ -67,13 +67,21 @@ class Rack::Attack
|
|||
self.tracks[name] = Track.new(name, options, block)
|
||||
end
|
||||
|
||||
def safelists; @safelists ||= {}; end
|
||||
def safelists;
|
||||
@safelists ||= {};
|
||||
end
|
||||
|
||||
def blocklists; @blocklists ||= {}; end
|
||||
def blocklists;
|
||||
@blocklists ||= {};
|
||||
end
|
||||
|
||||
def throttles; @throttles ||= {}; end
|
||||
def throttles;
|
||||
@throttles ||= {};
|
||||
end
|
||||
|
||||
def tracks; @tracks ||= {}; end
|
||||
def tracks;
|
||||
@tracks ||= {};
|
||||
end
|
||||
|
||||
def safelisted?(request)
|
||||
anonymous_safelists.any? { |safelist| safelist.matched_by?(request) } ||
|
||||
|
|
|
|||
|
|
@ -60,7 +60,9 @@ module Rack
|
|||
def stub_with_if_missing
|
||||
unless __getobj__.respond_to?(:with)
|
||||
class << self
|
||||
def with; yield __getobj__; end
|
||||
def with;
|
||||
yield __getobj__;
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Reference in a new issue