Skip to content
Snippets Groups Projects
Commit 23eac7ab authored by Markus Reiter's avatar Markus Reiter
Browse files

Fix DoubleNegation.

parent 52ff9885
No related branches found
No related tags found
No related merge requests found
......@@ -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.
......
......@@ -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
......
......@@ -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 })
......
......@@ -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
......
......@@ -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.
......
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment