diff options
| author | Markus Reiter | 2016-09-20 22:24:31 +0200 |
|---|---|---|
| committer | Markus Reiter | 2016-09-23 15:30:06 +0200 |
| commit | 23eac7ab897818689eeff6a810354d85543ad2bb (patch) | |
| tree | 7638ad6bf1a937c76e68af7ebea473a40e958784 /Library | |
| parent | 52ff98853068c03b3bfa777932da1da69e35e583 (diff) | |
| download | brew-23eac7ab897818689eeff6a810354d85543ad2bb.tar.bz2 | |
Fix DoubleNegation.
Diffstat (limited to 'Library')
| -rw-r--r-- | Library/.rubocop_todo.yml | 4 | ||||
| -rw-r--r-- | Library/Homebrew/extend/ARGV.rb | 2 | ||||
| -rw-r--r-- | Library/Homebrew/formula_installer.rb | 7 | ||||
| -rw-r--r-- | Library/Homebrew/os/mac/xcode.rb | 2 | ||||
| -rw-r--r-- | Library/Homebrew/requirement.rb | 2 | ||||
| -rw-r--r-- | Library/Homebrew/software_spec.rb | 7 |
6 files changed, 12 insertions, 12 deletions
diff --git a/Library/.rubocop_todo.yml b/Library/.rubocop_todo.yml index 4be619071..b81d8e0ef 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 d9f599877..92b4cb898 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 f64b77026..303617218 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 3aab9bf52..dac8b8f1e 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 7ab3aaeed..69cdec17f 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 8e42e20da..25373c322 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 |
