style: enable Style/SingleLineMethods rubocop

This commit is contained in:
Gonzalo Rodriguez 2019-03-01 21:14:47 -03:00
parent 8e3077c845
commit a0259fb14a
No known key found for this signature in database
GPG key ID: 5DB8B81B049B8AB1
3 changed files with 18 additions and 5 deletions

View file

@ -55,3 +55,6 @@ Style/RedundantBegin:
Style/RedundantFreeze:
Enabled: true
Style/SingleLineMethods:
Enabled: true

View file

@ -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) } ||

View file

@ -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