style: avoid multiline ternary operator

This commit is contained in:
Gonzalo Rodriguez 2020-04-25 15:42:30 -03:00
parent 8ededbc738
commit 53c1d93fd1
No known key found for this signature in database
GPG key ID: 5DB8B81B049B8AB1
2 changed files with 16 additions and 4 deletions

View file

@ -68,6 +68,12 @@ Style/FrozenStringLiteralComment:
Style/HashSyntax:
Enabled: true
Style/MultilineTernaryOperator:
Enabled: true
Style/NestedTernaryOperator:
Enabled: true
Style/OptionalArguments:
Enabled: true

View file

@ -110,12 +110,18 @@ module Rack
@app.call(env)
elsif configuration.blocklisted?(request)
# Deprecated: Keeping blocklisted_response for backwards compatibility
configuration.blocklisted_response ? configuration.blocklisted_response.call(env) :
configuration.blocklisted_callback.call(request)
if configuration.blocklisted_response
configuration.blocklisted_response.call(env)
else
configuration.blocklisted_callback.call(request)
end
elsif configuration.throttled?(request)
# Deprecated: Keeping throttled_response for backwards compatibility
configuration.throttled_response ? configuration.throttled_response.call(env) :
configuration.throttled_callback.call(request)
if configuration.throttled_response
configuration.throttled_response.call(env)
else
configuration.throttled_callback.call(request)
end
else
configuration.tracked?(request)
@app.call(env)