Module: Homebrew::Diagnostic Private

Defined in:
diagnostic.rb

Overview

This module is part of a private API. This module may only be used in the Homebrew/brew repository. Third parties should avoid using this module if possible, as it may be removed or changed without warning.

Module containing diagnostic checks.

Defined Under Namespace

Classes: Checks

Class Method Summary collapse

Class Method Details

.checks(type, fatal: true) ⇒ Object

This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.



31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# File 'diagnostic.rb', line 31

def self.checks(type, fatal: true)
  @checks ||= Checks.new
  failed = T.let(false, T::Boolean)
  @checks.public_send(type).each do |check|
    out = @checks.public_send(check)
    next if out.nil?

    if fatal
      failed ||= true
      ofail out
    else
      opoo out
    end
  end
  exit 1 if failed && fatal
end

.missing_deps(formulae, hide = nil) ⇒ Object

This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.



19
20
21
22
23
24
25
26
27
28
29
# File 'diagnostic.rb', line 19

def self.missing_deps(formulae, hide = nil)
  missing = {}
  formulae.each do |f|
    missing_dependencies = f.missing_dependencies(hide:)
    next if missing_dependencies.empty?

    yield f.full_name, missing_dependencies if block_given?
    missing[f.full_name] = missing_dependencies
  end
  missing
end