Class: CoreTap

Inherits:
Tap show all
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_CASK_RENAMES_FILE, 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, #git_repo, #name, #path, #repo, #user

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Tap

#==, #audit_exception, #cask_dir, #cask_files, cask_files_by_name, #cask_renames, #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_files_by_name, 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_repo, #repo_var, #shallow?, #to_hash, #to_s, untapped_official_taps, #versioned_formula_files

Methods included from Cachable

#cache, #clear_cache

Class Method Details

.ensure_installed!void

This method returns an undefined value.



876
877
878
879
880
881
882
883
884
885
# File 'tap.rb', line 876

def self.ensure_installed!
  return if instance.installed?
  return unless Homebrew::EnvConfig.no_install_from_api?
  return if Homebrew::EnvConfig.automatically_set_no_install_from_api?

  # Tests override homebrew-core locations and we don't want to auto-tap in them.
  return if ENV["HOMEBREW_TESTS"]

  instance.install
end

.instanceCoreTap

Returns:



871
872
873
# File 'tap.rb', line 871

def self.instance
  @instance ||= new
end

Instance Method Details

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

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



895
896
897
898
899
900
901
902
903
904
905
906
907
# File 'tap.rb', line 895

def install(quiet: false, clone_target: nil, force_auto_update: nil, custom_remote: false, verify: 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} as the Homebrew/homebrew-core Git remote."
  end

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

#remoteString

Returns:



888
889
890
891
892
# File 'tap.rb', line 888

def remote
  super if Homebrew::EnvConfig.no_install_from_api?

  Homebrew::EnvConfig.core_git_remote
end