chore: Fix RuboCop Style/IfInsideElse (#915)

This commit is contained in:
htwroclau 2019-03-04 02:38:56 +09:00 committed by Olle Jonsson
parent 1c0f43b9fd
commit 1fe9763c19
2 changed files with 3 additions and 8 deletions

View File

@ -1,6 +1,6 @@
# This configuration was generated by # This configuration was generated by
# `rubocop --auto-gen-config` # `rubocop --auto-gen-config`
# on 2019-03-03 12:56:55 +0100 using RuboCop version 0.65.0. # on 2019-03-04 02:27:02 +0900 using RuboCop version 0.65.0.
# The point is for the user to remove these configuration records # The point is for the user to remove these configuration records
# one by one as the offenses are removed from the code base. # one by one as the offenses are removed from the code base.
# Note that changes in the inspected code, or installation of new # Note that changes in the inspected code, or installation of new
@ -99,11 +99,6 @@ Style/GuardClause:
- 'lib/faraday/request/url_encoded.rb' - 'lib/faraday/request/url_encoded.rb'
- 'lib/faraday/utils/headers.rb' - 'lib/faraday/utils/headers.rb'
# Offense count: 1
Style/IfInsideElse:
Exclude:
- 'spec/support/helper_methods.rb'
# Offense count: 24 # Offense count: 24
# Cop supports --auto-correct. # Cop supports --auto-correct.
Style/IfUnlessModifier: Style/IfUnlessModifier:

View File

@ -14,8 +14,8 @@ module Faraday
def on_feature(name, &block) def on_feature(name, &block)
if @features.nil? if @features.nil?
superclass.on_feature(name, &block) if superclass.respond_to?(:on_feature) superclass.on_feature(name, &block) if superclass.respond_to?(:on_feature)
else elsif block_given? && @features.include?(name)
yield if block_given? && @features.include?(name) yield
end end
end end