Class: Cask::CaskLoader::FromTapLoader Private

Inherits:
FromTapPathLoader show all
Defined in:
Library/Homebrew/cask/cask_loader.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

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. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of FromTapLoader.


151
152
153
154
# File 'Library/Homebrew/cask/cask_loader.rb', line 151

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. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns:

  • (Boolean)

147
148
149
# File 'Library/Homebrew/cask/cask_loader.rb', line 147

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. You should avoid using this method if possible, as it may be removed or be changed in the future.


156
157
158
159
160
# File 'Library/Homebrew/cask/cask_loader.rb', line 156

def load(config:)
  tap.install unless tap.installed?

  super
end