diff --git a/Library/.rubocop_todo.yml b/Library/.rubocop_todo.yml index 4be619071c8f7156d87e96ae7906c53221ffa46e..b81d8e0ef0b7b846ee8db3016d3cfe1e1a43c62c 100644 --- a/Library/.rubocop_todo.yml +++ b/Library/.rubocop_todo.yml @@ -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. diff --git a/Library/Homebrew/extend/ARGV.rb b/Library/Homebrew/extend/ARGV.rb index d9f599877171746d37a3ae54329e523bdd376bbd..92b4cb898e61c859cf5aa467bb77b921e14300f8 100644 --- a/Library/Homebrew/extend/ARGV.rb +++ b/Library/Homebrew/extend/ARGV.rb @@ -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 diff --git a/Library/Homebrew/formula_installer.rb b/Library/Homebrew/formula_installer.rb index f64b77026d361036850fb4eb10e667adbdc29f13..3036172180968736710658d01405408ef88a2a5e 100644 --- a/Library/Homebrew/formula_installer.rb +++ b/Library/Homebrew/formula_installer.rb @@ -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 }) diff --git a/Library/Homebrew/os/mac/xcode.rb b/Library/Homebrew/os/mac/xcode.rb index 3aab9bf52388f955021ca51f116e901905a1176b..dac8b8f1eb67d6fd880780b5e0dbedb2a1f487c4 100644 --- a/Library/Homebrew/os/mac/xcode.rb +++ b/Library/Homebrew/os/mac/xcode.rb @@ -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 diff --git a/Library/Homebrew/requirement.rb b/Library/Homebrew/requirement.rb index 7ab3aaeed8a1b5a1401da03e0b7709c873338073..69cdec17fe5400e47ce97c0ada8fd87904b75a8b 100644 --- a/Library/Homebrew/requirement.rb +++ b/Library/Homebrew/requirement.rb @@ -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. diff --git a/Library/Homebrew/software_spec.rb b/Library/Homebrew/software_spec.rb index 8e42e20dac249242ba582415189b8b89127d7004..25373c322cb80c13f44edc8d42545581f15238fb 100644 --- a/Library/Homebrew/software_spec.rb +++ b/Library/Homebrew/software_spec.rb @@ -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