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 FromPathLoader

#path, #token

Attributes inherited from AbstractContentLoader

#content, #tap

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.



190
191
192
193
194
195
# File 'cask/cask_loader.rb', line 190

def initialize(tapped_name)
  user, repo, token = tapped_name.split("/", 3)
  tap = Tap.fetch(user, repo)
  cask = CaskLoader.find_cask_in_tap(token, tap)
  super cask
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)


186
187
188
# File 'cask/cask_loader.rb', line 186

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.



197
198
199
200
201
# File 'cask/cask_loader.rb', line 197

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

  super
end