missing: simplify code a bit
This commit is contained in:
parent
8e3e8e31c2
commit
c88b67f3a8
@ -8,6 +8,8 @@ require "utils/shell"
|
|||||||
module Homebrew
|
module Homebrew
|
||||||
module Diagnostic
|
module Diagnostic
|
||||||
def self.missing_deps(ff, hide = nil)
|
def self.missing_deps(ff, hide = nil)
|
||||||
|
hide ||= []
|
||||||
|
|
||||||
missing = {}
|
missing = {}
|
||||||
ff.each do |f|
|
ff.each do |f|
|
||||||
missing_deps = f.recursive_dependencies do |dependent, dep|
|
missing_deps = f.recursive_dependencies do |dependent, dep|
|
||||||
@ -20,12 +22,8 @@ module Homebrew
|
|||||||
end
|
end
|
||||||
|
|
||||||
missing_deps.map!(&:to_formula)
|
missing_deps.map!(&:to_formula)
|
||||||
if hide
|
missing_deps.reject! do |d|
|
||||||
missing_deps.reject! do |d|
|
!hide.include?(d.name) && d.installed_prefixes.any?
|
||||||
!hide.include?(d.name) && d.installed_prefixes.any?
|
|
||||||
end
|
|
||||||
else
|
|
||||||
missing_deps.reject! { |d| d.installed_prefixes.any? }
|
|
||||||
end
|
end
|
||||||
|
|
||||||
unless missing_deps.empty?
|
unless missing_deps.empty?
|
||||||
|
Loading…
x
Reference in New Issue
Block a user