Class: DependentsMessage

Inherits:
Object show all
Includes:
Utils::Output::Mixin
Defined in:
dependents_message.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

Constructor Details

#initialize(requireds, dependents, named_args: []) ⇒ 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.

Parameters:



16
17
18
19
20
# File 'dependents_message.rb', line 16

def initialize(requireds, dependents, named_args: [])
  @reqs = requireds
  @deps = dependents
  @named_args = named_args
end

Instance Attribute Details

#depsArray<String> (readonly)

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:



13
14
15
# File 'dependents_message.rb', line 13

def deps
  @deps
end

#named_argsArray<String> (readonly)

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:



13
14
15
# File 'dependents_message.rb', line 13

def named_args
  @named_args
end

#reqsArray<String, Keg> (readonly)

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:



10
11
12
# File 'dependents_message.rb', line 10

def reqs
  @reqs
end

Instance Method Details

#outputvoid

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.



23
24
25
26
27
28
29
30
# File 'dependents_message.rb', line 23

def output
  ofail <<~EOS
    Refusing to uninstall #{reqs.to_sentence}
    because #{reqs.one? ? "it" : "they"} #{are_required_by_deps}.
    You can override this and force removal with:
      #{sample_command}
  EOS
end