Module: Homebrew::Diagnostic Private
- Extended by:
- Utils::Output::Mixin
- 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
- .checks(type, fatal: true) ⇒ void private
- .missing_deps(formulae, hide = [], &_block) ⇒ Hash{String => Array<String>} private
Methods included from Utils::Output::Mixin
odebug, odeprecated, odie, odisabled, ofail, oh1, oh1_title, ohai, ohai_title, onoe, opoo, opoo_outside_github_actions, pretty_duration, pretty_installed, pretty_outdated, pretty_uninstalled
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.
40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 |
# File 'diagnostic.rb', line 40 def self.checks(type, fatal: true) @checks ||= T.let(Checks.new, T.nilable(Checks)) 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 = [], &_block) ⇒ Hash{String => Array<String>}
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.
27 28 29 30 31 32 33 34 35 36 37 |
# File 'diagnostic.rb', line 27 def self.missing_deps(formulae, hide = [], &_block) missing = {} formulae.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 |