Fix DoubleNegation.

This commit is contained in:
Markus Reiter 2016-09-20 22:24:31 +02:00
parent 52ff988530
commit 23eac7ab89
6 changed files with 12 additions and 12 deletions

View File

@ -151,13 +151,9 @@ Style/ConstantName:
# Offense count: 10
Style/DoubleNegation:
Exclude:
- 'Homebrew/extend/ARGV.rb'
- 'Homebrew/formula_installer.rb'
- 'Homebrew/os/mac/cctools_keg.rb'
- 'Homebrew/os/mac/ruby_keg.rb'
- 'Homebrew/os/mac/xcode.rb'
- 'Homebrew/requirement.rb'
- 'Homebrew/software_spec.rb'
# Offense count: 1
# Configuration parameters: EnforcedStyle, SupportedStyles.

View File

@ -216,7 +216,7 @@ module HomebrewArgvExtension
end
def build_all_from_source?
!!ENV["HOMEBREW_BUILD_FROM_SOURCE"]
!ENV["HOMEBREW_BUILD_FROM_SOURCE"].nil?
end
# Whether a given formula should be built from source during the current

View File

@ -24,7 +24,9 @@ class FormulaInstaller
private(*names)
names.each do |name|
predicate = "#{name}?"
define_method(predicate) { !!send(name) }
define_method(predicate) do
send(name) ? true : false
end
private(predicate)
end
end
@ -71,7 +73,8 @@ class FormulaInstaller
end
def build_bottle?
!!@build_bottle && !formula.bottle_disabled?
return false unless @build_bottle
!formula.bottle_disabled?
end
def pour_bottle?(install_bottle_options = { warn: false })

View File

@ -175,7 +175,7 @@ module OS
# Returns true even if outdated tools are installed, e.g.
# tools from Xcode 4.x on 10.9
def installed?
!!detect_version
!detect_version.nil?
end
def update_instructions

View File

@ -56,7 +56,7 @@ class Requirement
def satisfied?
result = self.class.satisfy.yielder { |p| instance_eval(&p) }
@satisfied_result = result
!!result
result ? true : false
end
# Overriding #fatal? is deprecated.

View File

@ -65,11 +65,12 @@ class SoftwareSpec
end
def bottle_unneeded?
!!@bottle_disable_reason && @bottle_disable_reason.unneeded?
return false unless @bottle_disable_reason
@bottle_disable_reason.unneeded?
end
def bottle_disabled?
!!@bottle_disable_reason
@bottle_disable_reason ? true : false
end
attr_reader :bottle_disable_reason
@ -318,7 +319,7 @@ class BottleSpecification
end
def tag?(tag)
!!checksum_for(tag)
checksum_for(tag) ? true : false
end
# Checksum methods in the DSL's bottle block optionally take