Module: Homebrew::Bundle::WhalebrewDumper Private

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

Class Method Details

.dumpObject

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.



21
22
23
# File 'bundle/whalebrew_dumper.rb', line 21

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

.imagesObject

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.



11
12
13
14
15
16
17
18
19
# File 'bundle/whalebrew_dumper.rb', line 11

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

  # odeprecated "`brew bundle` `whalebrew` support", "using `whalebrew` directly"
  @images ||= `whalebrew list 2>/dev/null`.split("\n")
                                          .reject { |line| line.start_with?("COMMAND ") }
                                          .map { |line| line.split(/\s+/).last }
                                          .uniq
end

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



7
8
9
# File 'bundle/whalebrew_dumper.rb', line 7

def self.reset!
  @images = nil
end