Class: Cask::CaskLoader::FromTapLoader Private

Inherits:
FromTapPathLoader show all
Defined in:
cask/cask_loader.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.

Loads a cask from a specific tap.

Instance Attribute Summary

Attributes inherited from FromTapPathLoader

#tap

Attributes inherited from FromPathLoader

#path, #token

Attributes inherited from FromContentLoader

#content

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(tapped_name) ⇒ FromTapLoader

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.

Returns a new instance of FromTapLoader.



154
155
156
157
# File 'cask/cask_loader.rb', line 154

def initialize(tapped_name)
  user, repo, token = tapped_name.split("/", 3)
  super Tap.fetch(user, repo).cask_dir/"#{token}.rb"
end

Class Method Details

.can_load?(ref) ⇒ 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.

Returns:

  • (Boolean)


150
151
152
# File 'cask/cask_loader.rb', line 150

def self.can_load?(ref)
  ref.to_s.match?(HOMEBREW_TAP_CASK_REGEX)
end

Instance Method Details

#load(config:) ⇒ Object

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.



159
160
161
162
163
# File 'cask/cask_loader.rb', line 159

def load(config:)
  raise TapCaskUnavailableError.new(tap, token) unless tap.installed?

  super
end