diff --git a/.rubocop.yml b/.rubocop.yml index cca3e40..ad708a2 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -55,3 +55,6 @@ Style/RedundantBegin: Style/RedundantFreeze: Enabled: true + +Style/SingleLineMethods: + Enabled: true diff --git a/lib/rack/attack.rb b/lib/rack/attack.rb index 59f2892..d2571a2 100644 --- a/lib/rack/attack.rb +++ b/lib/rack/attack.rb @@ -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) } || diff --git a/lib/rack/attack/store_proxy/dalli_proxy.rb b/lib/rack/attack/store_proxy/dalli_proxy.rb index fef6179..095bfb6 100644 --- a/lib/rack/attack/store_proxy/dalli_proxy.rb +++ b/lib/rack/attack/store_proxy/dalli_proxy.rb @@ -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