Class: Cask::CaskLoader::FromTapLoader Private

Inherits:
FromPathLoader 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.

Direct Known Subclasses

FromNameLoader

Instance Attribute Summary collapse

Attributes inherited from FromPathLoader

#path, #token

Attributes inherited from AbstractContentLoader

#content

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(tapped_token) ⇒ 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.

Parameters:



213
214
215
216
217
# File 'cask/cask_loader.rb', line 213

def initialize(tapped_token)
  tap, token = Tap.with_cask_token(tapped_token)
  cask = CaskLoader.find_cask_in_tap(token, tap)
  super cask
end

Instance Attribute Details

#tapTap (readonly)

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:



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

def tap
  @tap
end

Class Method Details

.try_new(ref, warn: false) ⇒ T.attached_class?

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.

Parameters:

Returns:

  • (T.attached_class, nil)


203
204
205
206
207
208
209
210
# File 'cask/cask_loader.rb', line 203

def self.try_new(ref, warn: false)
  ref = ref.to_s

  return unless (token_tap_type = CaskLoader.tap_cask_token_type(ref, warn:))

  token, tap, = token_tap_type
  new("#{tap}/#{token}")
end

Instance Method Details

#load(config:) ⇒ Cask

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.

Parameters:

Returns:

Raises:



220
221
222
223
224
# File 'cask/cask_loader.rb', line 220

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

  super
end