Class: CoreCaskTap Private
- Inherits:
-
AbstractCoreTap
- Object
- Tap
- AbstractCoreTap
- CoreCaskTap
- Defined in:
- tap/core_cask_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 homebrew-cask.
Constant Summary collapse
- Cache =
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 { { fixed: T::Hash[T.any(String, Symbol), T.untyped] } }
- 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
- #cask_files ⇒ Array<Pathname> private
- #cask_files_by_name ⇒ Hash{String => Pathname} private
- #cask_renames ⇒ Hash{String => String} private
- #cask_tokens ⇒ Array<String> private
- #core_cask_tap? ⇒ Boolean private
- #initialize ⇒ void constructor private
- #new_cask_path(token) ⇒ Pathname private
- #new_cask_subdirectory(token) ⇒ String private
- #tap_migrations ⇒ Hash{String => T.untyped} private
Methods inherited from AbstractCoreTap
#ensure_installed!, #formula_file_to_name, instance, #should_report_analytics?
Methods inherited from Tap
#alias_dir, #alias_file_to_name, #alias_files, #alias_reverse_table, #alias_table, #aliases, all, #allow_bump?, #allowed_by_env?, allowed_taps, #audit_exception, #audit_exceptions, #autobump, #cask_dir, #cask_file?, #cask_reverse_renames, #clear_cache, #command_dir, #command_files, #config, #contents, #core_tap?, core_taps, #custom_remote?, #default_remote, #disabled_new_usr_local_relocation_formulae, each, #ensure_installed!, fetch, #fix_remote_configuration, #forbidden_by_env?, forbidden_taps, #formula_dir, #formula_file?, #formula_file_to_name, #formula_files, #formula_files_by_name, #formula_names, #formula_renames, #formula_reverse_renames, from_path, #git?, #git_branch, #git_head, #git_last_commit, #install, installed, #installed?, #issues_url, #link_completions_and_manpages, #new_formula_path, #official?, #potential_formula_dirs, #prefix_to_versioned_formulae_names, #private?, #relative_cask_path, #remote, #remote_repository, #repository_var_suffix, #reverse_tap_migrations_renames, #shallow?, #should_report_analytics?, #style_exceptions, #synced_versions_formulae, tap_migration_oldnames, #to_hash, #uninstall, untapped_official_taps, with_cask_token, with_formula_name
Methods included from Enumerable
Methods included from Cachable
Methods included from Utils::Output::Mixin
#issue_reporting_message, #odebug, #odeprecated, #odie, #odisabled, #ofail, #oh1, #oh1_title, #ohai, #ohai_title, #onoe, #opoo, #opoo_outside_github_actions, #pretty_deprecated, #pretty_disabled, #pretty_duration, #pretty_install_status, #pretty_installed, #pretty_outdated, #pretty_uninstalled, #pretty_upgradable
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.
12 13 14 |
# File 'tap/core_cask_tap.rb', line 12 def initialize super "Homebrew", "cask" end |
Instance Method Details
#cask_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.
36 37 38 39 40 |
# File 'tap/core_cask_tap.rb', line 36 def cask_files return super if Homebrew::EnvConfig.no_install_from_api? cask_files_by_name.values end |
#cask_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.
50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 |
# File 'tap/core_cask_tap.rb', line 50 def cask_files_by_name return super if Homebrew::EnvConfig.no_install_from_api? @cask_files_by_name ||= T.let( begin cask_directory_path = cask_dir.to_s Homebrew::API.cask_tokens.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(cask_directory_path, new_cask_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 |
#cask_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.
69 70 71 72 73 74 75 76 77 78 |
# File 'tap/core_cask_tap.rb', line 69 def cask_renames @cask_renames ||= T.let( if Homebrew::EnvConfig.no_install_from_api? super else Homebrew::API.cask_renames end, T.nilable(T::Hash[String, String]), ) end |
#cask_tokens ⇒ 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.
43 44 45 46 47 |
# File 'tap/core_cask_tap.rb', line 43 def cask_tokens return super if Homebrew::EnvConfig.no_install_from_api? Homebrew::API.cask_tokens end |
#core_cask_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.
17 18 19 |
# File 'tap/core_cask_tap.rb', line 17 def core_cask_tap? true end |
#new_cask_path(token) ⇒ 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.
31 32 33 |
# File 'tap/core_cask_tap.rb', line 31 def new_cask_path(token) cask_dir/new_cask_subdirectory(token)/"#{token.downcase}.rb" end |
#new_cask_subdirectory(token) ⇒ 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.
22 23 24 25 26 27 28 |
# File 'tap/core_cask_tap.rb', line 22 def new_cask_subdirectory(token) if token.start_with?("font-") "font/font-#{token.delete_prefix("font-")[0]}" else token[0].to_s end 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.
81 82 83 84 85 86 87 88 89 90 |
# File 'tap/core_cask_tap.rb', line 81 def tap_migrations @tap_migrations ||= T.let( if Homebrew::EnvConfig.no_install_from_api? super else Homebrew::API.cask_tap_migrations end, T.nilable(T::Hash[String, T.untyped]), ) end |