Module: Homebrew::Bundle::WhalebrewDumper Private

Extended by:
Utils::Output::Mixin
Defined in:
bundle/whalebrew_dumper.rb

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.

Class 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

Class Method Details

.dumpString

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:



31
32
33
# File 'bundle/whalebrew_dumper.rb', line 31

def self.dump
  images.map { |image| "whalebrew \"#{image}\"" }.join("\n")
end

.imagesArray<String, nil>

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:



17
18
19
20
21
22
23
24
25
26
27
28
# File 'bundle/whalebrew_dumper.rb', line 17

def self.images
  return [] unless Bundle.whalebrew_installed?

  odisabled "`brew bundle` `whalebrew` support", "using `whalebrew` directly"
  @images ||= T.let(
    `whalebrew list 2>/dev/null`.split("\n")
                                .reject { |line| line.start_with?("COMMAND ") }
                                .filter_map { |line| line.split(/\s+/).last }
                                .uniq,
    T.nilable(T::Array[String]),
  )
end

.reset!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.



12
13
14
# File 'bundle/whalebrew_dumper.rb', line 12

def self.reset!
  @images = T.let(nil, T.nilable(T::Array[String]))
end