Module: Homebrew::Bundle::TapInstaller Private

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

.install!(name, preinstall: true, verbose: false, force: false, clone_target: nil, **_options) ⇒ Boolean

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:

  • name (String)
  • preinstall (Boolean) (defaults to: true)
  • verbose (Boolean) (defaults to: false)
  • force (Boolean) (defaults to: false)
  • clone_target (String, nil) (defaults to: nil)
  • _options (T.anything)

Returns:

  • (Boolean)


27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# File 'bundle/tap_installer.rb', line 27

def self.install!(name, preinstall: true, verbose: false, force: false, clone_target: nil, **_options)
  return true unless preinstall

  puts "Installing #{name} tap. It is not currently installed." if verbose
  args = []
  official_tap = name.downcase.start_with? "homebrew/"
  args << "--force" if force || (official_tap && Homebrew::EnvConfig.developer?)

  success = if clone_target
    Bundle.brew("tap", name, clone_target, *args, verbose:)
  else
    Bundle.brew("tap", name, *args, verbose:)
  end

  unless success
    require "bundle/skipper"
    Homebrew::Bundle::Skipper.tap_failed!(name)
    return false
  end

  installed_taps << name
  true
end

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



52
53
54
55
# File 'bundle/tap_installer.rb', line 52

def self.installed_taps
  require "bundle/tap_dumper"
  @installed_taps ||= T.let(Homebrew::Bundle::TapDumper.tap_names, T.nilable(T::Array[String]))
end

.preinstall!(name, verbose: false, **_options) ⇒ Boolean

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:

  • name (String)
  • verbose (Boolean) (defaults to: false)
  • _options (T.anything)

Returns:

  • (Boolean)


8
9
10
11
12
13
14
15
# File 'bundle/tap_installer.rb', line 8

def self.preinstall!(name, verbose: false, **_options)
  if installed_taps.include? name
    puts "Skipping install of #{name} tap. It is already installed." if verbose
    return false
  end

  true
end