Module: Homebrew::Bundle::CargoDumper Private

Defined in:
bundle/cargo_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

.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:



25
26
27
# File 'bundle/cargo_dumper.rb', line 25

def self.dump
  packages.map { |name| "cargo \"#{name}\"" }.join("\n")
end

.packagesArray<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.

Returns:



13
14
15
16
17
18
19
20
21
22
# File 'bundle/cargo_dumper.rb', line 13

def self.packages
  @packages ||= T.let(nil, T.nilable(T::Array[String]))
  @packages ||= if Bundle.cargo_installed?
    require "bundle/cargo_installer"
    cargo = Bundle.which_cargo
    parse_package_list(`#{cargo} install --list`)
  else
    []
  end
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.



8
9
10
# File 'bundle/cargo_dumper.rb', line 8

def self.reset!
  @packages = nil
end