Module: Homebrew::Diagnostic Private

Extended by:
Utils::Output::Mixin
Defined in:
diagnostic.rb,
diagnostic/finding.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, Finding

Class Method Summary collapse

Methods included from Utils::Output::Mixin

issue_reporting_message, odebug, odeprecated, odie, odisabled, ofail, oh1, oh1_title, ohai, ohai_title, onoe, opoo, opoo_once, opoo_outside_github_actions, opoo_without_github_actions_annotation, pretty_cannot_install, pretty_deprecated, pretty_disabled, pretty_duration, pretty_install_status, pretty_installed, pretty_uninstalled, pretty_unmarked, pretty_upgradable, pretty_warning

Class Method Details

.checks(type, fatal: true) ⇒ void

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.

This method returns an undefined value.

Parameters:

  • type (Symbol)
  • fatal (Boolean) (defaults to: true)


42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# File 'diagnostic.rb', line 42

def self.checks(type, fatal: true)
  checks = Checks.new
  failed = T.let(false, T::Boolean)
  checks.public_send(type).each do |check|
    Array(checks.public_send(check)).each do |finding|
      support_tiers << finding.tier
      if fatal
        failed = true
        ofail finding.to_s
      else
        opoo finding.to_s
      end
    end
  end
  exit 1 if failed && fatal
end

.report_support_tier ⇒ void

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.

This method returns an undefined value.



33
34
35
36
37
# File 'diagnostic.rb', line 33

def self.report_support_tier
  message = Finding.support_tier_message(tier: Finding.support_tier(support_tiers))
  support_tiers.clear
  $stderr.puts "\n", message if message
end

.support_tiers ⇒ Array<Integer, Symbol>

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.

Returns:



28
29
30
# File 'diagnostic.rb', line 28

def self.support_tiers
  @support_tiers ||= T.let([], T.nilable(T::Array[T.any(Integer, Symbol)]))
end