Class: CoreCaskTap

Inherits:
AbstractCoreTap show all
Defined in:
tap.rb

Overview

A specialized Tap class for homebrew-cask.

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, Tap::TAP_MIGRATIONS_STALE_SECONDS

Instance Attribute Summary

Attributes inherited from Tap

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

Instance Method Summary collapse

Methods inherited from AbstractCoreTap

#ensure_installed!, ensure_installed!, instance

Methods inherited from Tap

#==, #audit_exception, #audit_exceptions, #cask_dir, cask_files_by_name, #clear_cache, cmd_directories, #command_dir, #command_files, #config, #contents, #custom_remote?, default_cask_tap, #default_remote, each, #ensure_installed!, fetch, #fix_remote_configuration, #formula_dir, #formula_files, formula_files_by_name, #formula_names, #formula_oldnames, #formula_renames, from_path, #git?, #git_branch, #git_head, #git_last_commit, #install, install_default_cask_tap_if_necessary, #installed?, #issues_url, #link_completions_and_manpages, names, #new_formula_path, #official?, #potential_formula_dirs, #private?, #pypi_formula_mappings, #relative_cask_path, #remote, #remote_repo, #repo_var, #shallow?, #style_exceptions, #to_hash, #to_s, #uninstall, untapped_official_taps

Methods included from Cachable

#cache, #clear_cache

Instance Method Details

#cask_filesArray<Pathname>

Returns:

Raises:



1170
1171
1172
1173
1174
# File 'tap.rb', line 1170

def cask_files
  return super if Homebrew::EnvConfig.no_install_from_api? || installed?

  raise TapUnavailableError, name
end

#cask_renamesHash{String => String}

Returns:



1198
1199
1200
1201
1202
1203
1204
# File 'tap.rb', line 1198

def cask_renames
  @cask_renames ||= if Homebrew::EnvConfig.no_install_from_api?
    super
  else
    Homebrew::API::Cask.all_renames
  end
end

#cask_tokensArray<String>

Returns:



1177
1178
1179
1180
1181
# File 'tap.rb', line 1177

def cask_tokens
  return super if Homebrew::EnvConfig.no_install_from_api?

  Homebrew::API::Cask.all_casks.keys
end

#new_cask_path(token) ⇒ Pathname

Parameters:

Returns:



1164
1165
1166
1167
# File 'tap.rb', line 1164

def new_cask_path(token)
  cask_subdir = token[0].to_s
  cask_dir/cask_subdir/"#{token.downcase}.rb"
end

#tap_migrationsHash

Returns:

  • (Hash)


1207
1208
1209
1210
1211
1212
1213
1214
1215
# File 'tap.rb', line 1207

def tap_migrations
  @tap_migrations ||= if Homebrew::EnvConfig.no_install_from_api?
    super
  else
    migrations, = Homebrew::API.fetch_json_api_file "cask_tap_migrations.jws.json",
                                                    stale_seconds: TAP_MIGRATIONS_STALE_SECONDS
    migrations
  end
end