Class: CoreTap Private
- Inherits:
-
AbstractCoreTap
- Object
- Tap
- AbstractCoreTap
- CoreTap
- Defined in:
- tap.rb
Overview
This class is part of a private API. This class may only be used in the Homebrew/brew repository. Third parties should avoid using this class if possible, as it may be removed or changed without warning.
A specialized Tap class for the core formulae.
Constant Summary collapse
- Elem =
This constant is part of a private API. This constant may only be used in the Homebrew/brew repository. Third parties should avoid using this constant if possible, as it may be removed or changed without warning.
type_member(:out) { { fixed: Tap } }
Constants inherited from Tap
Instance Attribute Summary
Attributes inherited from Tap
#full_name, #full_repository, #git_repository, #name, #path, #repository, #user
Instance Method Summary collapse
- #alias_dir ⇒ Pathname private
- #alias_file_to_name(file) ⇒ String private
- #alias_table ⇒ Hash{String => String} private
- #audit_exceptions ⇒ Hash{Symbol => T.untyped} private
- #autobump ⇒ Array<String> private
- #core_tap? ⇒ Boolean private
- #ensure_installed! ⇒ void private
- #formula_dir ⇒ Pathname private
- #formula_files ⇒ Array<Pathname> private
- #formula_files_by_name ⇒ Hash{String => Pathname} private
- #formula_names ⇒ Array<String> private
- #formula_renames ⇒ Hash{String => String} private
- #initialize ⇒ void constructor private
-
#install(quiet: false, clone_target: nil, custom_remote: false, verify: false, force: false) ⇒ void
private
CoreTap never allows shallow clones (on request from GitHub).
- #linuxbrew_core? ⇒ Boolean private
- #new_formula_path(name) ⇒ Pathname private
- #new_formula_subdirectory(name) ⇒ String private
- #remote ⇒ String? private
- #style_exceptions ⇒ Hash{Symbol => T.untyped} private
- #synced_versions_formulae ⇒ Array<Array<String>> private
- #tap_migrations ⇒ Hash{String => T.untyped} private
- #uninstall(manual: false) ⇒ void private
Methods inherited from AbstractCoreTap
#formula_file_to_name, instance, #should_report_analytics?
Methods inherited from Tap
#alias_files, #alias_reverse_table, #aliases, all, #allow_bump?, #allowed_by_env?, allowed_taps, #audit_exception, #cask_dir, #cask_file?, #cask_files, #cask_files_by_name, #cask_renames, #cask_reverse_renames, #cask_tokens, #clear_cache, #command_dir, #command_files, #config, #contents, #core_cask_tap?, core_taps, #custom_remote?, #default_remote, #disabled_new_usr_local_relocation_formulae, each, fetch, #fix_remote_configuration, #forbidden_by_env?, forbidden_taps, #formula_file?, #formula_file_to_name, #formula_reverse_renames, from_path, #git?, #git_branch, #git_head, #git_last_commit, installed, #installed?, #issues_url, #link_completions_and_manpages, #new_cask_path, #official?, #potential_formula_dirs, #prefix_to_versioned_formulae_names, #private?, #relative_cask_path, #remote_repository, #repository_var_suffix, #reverse_tap_migrations_renames, #shallow?, #should_report_analytics?, tap_migration_oldnames, #to_hash, untapped_official_taps, with_cask_token, with_formula_name
Methods included from Enumerable
Methods included from Cachable
Methods included from Utils::Output::Mixin
#odebug, #odeprecated, #odie, #odisabled, #ofail, #oh1, #oh1_title, #ohai, #ohai_title, #onoe, #opoo, #opoo_outside_github_actions, #pretty_duration, #pretty_installed, #pretty_outdated, #pretty_uninstalled
Constructor Details
#initialize ⇒ 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.
1289 1290 1291 |
# File 'tap.rb', line 1289 def initialize super "Homebrew", "core" end |
Instance Method Details
#alias_dir ⇒ Pathname
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.
1371 1372 1373 1374 1375 1376 |
# File 'tap.rb', line 1371 def alias_dir @alias_dir ||= T.let(begin ensure_installed! super end, T.nilable(Pathname)) end |
#alias_file_to_name(file) ⇒ 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.
1437 1438 1439 |
# File 'tap.rb', line 1437 def alias_file_to_name(file) file.basename.to_s end |
#alias_table ⇒ Hash{String => 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.
1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 |
# File 'tap.rb', line 1442 def alias_table @alias_table ||= T.let( if Homebrew::EnvConfig.no_install_from_api? super else Homebrew::API.formula_aliases end, T.nilable(T::Hash[String, String]), ) end |
#audit_exceptions ⇒ Hash{Symbol => T.untyped}
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.
1413 1414 1415 1416 1417 1418 |
# File 'tap.rb', line 1413 def audit_exceptions @audit_exceptions ||= T.let(begin ensure_installed! super end, T.nilable(T::Hash[Symbol, T.untyped])) end |
#autobump ⇒ Array<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.
1405 1406 1407 1408 1409 1410 |
# File 'tap.rb', line 1405 def autobump @autobump ||= T.let(begin ensure_installed! super end, T.nilable(T::Array[String])) end |
#core_tap? ⇒ 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.
1335 1336 1337 |
# File 'tap.rb', line 1335 def core_tap? true end |
#ensure_installed! ⇒ 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.
1294 1295 1296 1297 1298 |
# File 'tap.rb', line 1294 def ensure_installed! return if ENV["HOMEBREW_TESTS"] super end |
#formula_dir ⇒ Pathname
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.
1345 1346 1347 1348 1349 1350 |
# File 'tap.rb', line 1345 def formula_dir @formula_dir ||= T.let(begin ensure_installed! super end, T.nilable(Pathname)) end |
#formula_files ⇒ Array<Pathname>
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.
1454 1455 1456 1457 1458 |
# File 'tap.rb', line 1454 def formula_files return super if Homebrew::EnvConfig.no_install_from_api? formula_files_by_name.values end |
#formula_files_by_name ⇒ Hash{String => Pathname}
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.
1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 |
# File 'tap.rb', line 1468 def formula_files_by_name return super if Homebrew::EnvConfig.no_install_from_api? @formula_files_by_name ||= T.let( begin formula_directory_path = formula_dir.to_s Homebrew::API.formula_names.each_with_object({}) do |name, hash| # If there's more than one item with the same path: use the longer one to prioritise more specific results. existing_path = hash[name] # Pathname equivalent is slow in a tight loop new_path = File.join(formula_directory_path, new_formula_subdirectory(name), "#{name.downcase}.rb") hash[name] = Pathname(new_path) if existing_path.nil? || existing_path.to_s.length < new_path.length end end, T.nilable(T::Hash[String, Pathname]), ) end |
#formula_names ⇒ Array<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.
1461 1462 1463 1464 1465 |
# File 'tap.rb', line 1461 def formula_names return super if Homebrew::EnvConfig.no_install_from_api? Homebrew::API.formula_names end |
#formula_renames ⇒ Hash{String => 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.
1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 |
# File 'tap.rb', line 1379 def formula_renames @formula_renames ||= T.let( if Homebrew::EnvConfig.no_install_from_api? ensure_installed! super else Homebrew::API.formula_renames end, T.nilable(T::Hash[String, String]), ) end |
#install(quiet: false, clone_target: nil, custom_remote: false, verify: false, force: false) ⇒ 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.
CoreTap never allows shallow clones (on request from GitHub).
1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 |
# File 'tap.rb', line 1312 def install(quiet: false, clone_target: nil, custom_remote: false, verify: false, force: 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:, clone_target: remote, custom_remote:, force:) end |
#linuxbrew_core? ⇒ 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.
1340 1341 1342 |
# File 'tap.rb', line 1340 def linuxbrew_core? remote_repository.to_s.end_with?("/linuxbrew-core") || remote_repository == "Linuxbrew/homebrew-core" end |
#new_formula_path(name) ⇒ Pathname
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.
1362 1363 1364 1365 1366 1367 1368 |
# File 'tap.rb', line 1362 def new_formula_path(name) formula_subdir = new_formula_subdirectory(name) return super unless (formula_dir/formula_subdir).directory? formula_dir/formula_subdir/"#{name.downcase}.rb" end |
#new_formula_subdirectory(name) ⇒ 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.
1353 1354 1355 1356 1357 1358 1359 |
# File 'tap.rb', line 1353 def new_formula_subdirectory(name) if name.start_with?("lib") "lib" else name[0].to_s end end |
#remote ⇒ 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.
1301 1302 1303 1304 1305 |
# File 'tap.rb', line 1301 def remote return super if Homebrew::EnvConfig.no_install_from_api? Homebrew::EnvConfig.core_git_remote end |
#style_exceptions ⇒ Hash{Symbol => T.untyped}
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.
1421 1422 1423 1424 1425 1426 |
# File 'tap.rb', line 1421 def style_exceptions @style_exceptions ||= T.let(begin ensure_installed! super end, T.nilable(T::Hash[Symbol, T.untyped])) end |
#synced_versions_formulae ⇒ Array<Array<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.
1429 1430 1431 1432 1433 1434 |
# File 'tap.rb', line 1429 def synced_versions_formulae @synced_versions_formulae ||= T.let(begin ensure_installed! super end, T.nilable(T::Array[T::Array[String]])) end |
#tap_migrations ⇒ Hash{String => T.untyped}
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.
1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 |
# File 'tap.rb', line 1392 def tap_migrations @tap_migrations ||= T.let( if Homebrew::EnvConfig.no_install_from_api? ensure_installed! super else Homebrew::API.formula_tap_migrations end, T.nilable(T::Hash[String, T.untyped]), ) end |
#uninstall(manual: false) ⇒ 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.
1328 1329 1330 1331 1332 |
# File 'tap.rb', line 1328 def uninstall(manual: false) raise "Tap#uninstall is not available for CoreTap" if Homebrew::EnvConfig.no_install_from_api? super end |