Class: CoreTap

Inherits:
Tap
  • Object
show all
Extended by:
T::Sig
Defined in:
tap.rb

Overview

A specialized Tap class for the core formulae.

Constant Summary

Constants inherited from Tap

Tap::HOMEBREW_TAP_AUDIT_EXCEPTIONS_DIR, Tap::HOMEBREW_TAP_FORMULA_RENAMES_FILE, Tap::HOMEBREW_TAP_JSON_FILES, Tap::HOMEBREW_TAP_MIGRATIONS_FILE, Tap::HOMEBREW_TAP_PYPI_FORMULA_MAPPINGS, Tap::HOMEBREW_TAP_STYLE_EXCEPTIONS_DIR, Tap::TAP_DIRECTORY

Instance Attribute Summary

Attributes inherited from Tap

#full_name, #name, #path, #repo, #user

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Tap

#==, #audit_exception, #cask_dir, #cask_files, #cask_tokens, #clear_cache, cmd_directories, #command_dir, #command_files, #config, #contents, #custom_remote?, default_cask_tap, #default_remote, each, fetch, #fix_remote_configuration, #formula_files, #formula_names, from_path, #git?, #git_branch, #git_head, #git_last_commit, install_default_cask_tap_if_necessary, #installed?, #issues_url, #link_completions_and_manpages, names, #official?, #potential_formula_dirs, #private?, #remote, #remote_repo, #repo_var, #shallow?, #to_hash, #to_s, untapped_official_taps

Methods included from Cachable

#cache, #clear_cache

Class Method Details

.ensure_installed!Object



773
774
775
776
777
778
# File 'tap.rb', line 773

def self.ensure_installed!
  return if instance.installed?
  return if Homebrew::EnvConfig.install_from_api?

  safe_system HOMEBREW_BREW_FILE, "tap", instance.name
end

.instanceObject



769
770
771
# File 'tap.rb', line 769

def self.instance
  @instance ||= new
end

Instance Method Details

#install(quiet: false, clone_target: nil, force_auto_update: nil, custom_remote: false) ⇒ Object

CoreTap never allows shallow clones (on request from GitHub).



781
782
783
784
785
786
787
788
789
790
791
792
793
# File 'tap.rb', line 781

def install(quiet: false, clone_target: nil, force_auto_update: nil, custom_remote: false)
  remote = Homebrew::EnvConfig.core_git_remote # set by HOMEBREW_CORE_GIT_REMOTE
  requested_remote = clone_target || remote

  # The remote will changed again on `brew update` since remotes for Homebrew/core are mismatched
  raise TapCoreRemoteMismatchError.new(name, remote, requested_remote) if requested_remote != remote

  if remote != default_remote
    $stderr.puts "HOMEBREW_CORE_GIT_REMOTE set: using #{remote} for Homebrew/core Git remote."
  end

  super(quiet: quiet, clone_target: remote, force_auto_update: force_auto_update, custom_remote: custom_remote)
end