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_renames, #formula_reverse_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, #reverse_cask_renames, reverse_tap_migrations_renames, #shallow?, #style_exceptions, #to_hash, #to_s, #uninstall, untapped_official_taps

Methods included from Cachable

#cache, #clear_cache

Methods included from Enumerable

#compact_blank, #exclude?

Instance Method Details

#cask_filesArray<Pathname>

Returns:



1214
1215
1216
1217
1218
# File 'tap.rb', line 1214

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

  cask_files_by_name.values
end

#cask_renamesHash{String => String}

Returns:



1242
1243
1244
1245
1246
1247
1248
# File 'tap.rb', line 1242

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:



1221
1222
1223
1224
1225
# File 'tap.rb', line 1221

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:



1208
1209
1210
1211
# File 'tap.rb', line 1208

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

#tap_migrationsHash

Returns:



1251
1252
1253
1254
1255
1256
1257
1258
1259
# File 'tap.rb', line 1251

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