diff options
| author | Mike McQuaid | 2016-09-10 10:24:57 +0100 |
|---|---|---|
| committer | Mike McQuaid | 2016-09-11 17:59:01 +0100 |
| commit | 1174264d47b03bbcdb6900896b2a512c05686549 (patch) | |
| tree | fb38754a906f2140ee3dac1c0ca1961554fcc673 /Library/Homebrew/cmd | |
| parent | 2c5beb0effd113bd0342f052d735d697e3e5af95 (diff) | |
| download | brew-1174264d47b03bbcdb6900896b2a512c05686549.tar.bz2 | |
cmd/uses: fix Rubocop warnings.
Diffstat (limited to 'Library/Homebrew/cmd')
| -rw-r--r-- | Library/Homebrew/cmd/uses.rb | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/Library/Homebrew/cmd/uses.rb b/Library/Homebrew/cmd/uses.rb index ff7f7529e..79b57eb23 100644 --- a/Library/Homebrew/cmd/uses.rb +++ b/Library/Homebrew/cmd/uses.rb @@ -27,7 +27,7 @@ module Homebrew raise FormulaUnspecifiedError if ARGV.named.empty? used_formulae = ARGV.formulae - formulae = (ARGV.include? "--installed") ? Formula.installed : Formula + formulae = ARGV.include?("--installed") ? Formula.installed : Formula recursive = ARGV.flag? "--recursive" includes = [] ignores = [] @@ -65,8 +65,6 @@ module Homebrew Requirement.prune unless includes.include?("build?") end end - deps.any? { |dep| dep.to_formula.full_name == ff.full_name rescue dep.name == ff.name } || - reqs.any? { |req| req.name == ff.name || [ff.name, ff.full_name].include?(req.default_formula) } else deps = f.deps.reject do |dep| ignores.any? { |ignore| dep.send(ignore) } && !includes.any? { |include| dep.send(include) } @@ -74,8 +72,17 @@ module Homebrew reqs = f.requirements.reject do |req| ignores.any? { |ignore| req.send(ignore) } && !includes.any? { |include| req.send(include) } end - deps.any? { |dep| dep.to_formula.full_name == ff.full_name rescue dep.name == ff.name } || - reqs.any? { |req| req.name == ff.name || [ff.name, ff.full_name].include?(req.default_formula) } + end + next true if deps.any? do |dep| + begin + dep.to_formula.full_name == ff.full_name + rescue + dep.name == ff.name + end + end + + reqs.any? do |req| + req.name == ff.name || [ff.name, ff.full_name].include?(req.default_formula) end rescue FormulaUnavailableError # Silently ignore this case as we don't care about things used in |
