Module: Homebrew::Diagnostic Private

Defined in:
diagnostic.rb,
extend/os/mac/diagnostic.rb,
extend/os/linux/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, Volumes

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.



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

def self.checks(type, fatal: true)
  @checks ||= Checks.new
  failed = false
  @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(ff, 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.



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

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

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