Class: Cask::CaskLoader::FromTapLoader

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

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

Returns a new instance of FromTapLoader



130
131
132
133
# File 'brew/Library/Homebrew/cask/cask_loader.rb', line 130

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

Returns:

  • (Boolean)


126
127
128
# File 'brew/Library/Homebrew/cask/cask_loader.rb', line 126

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

Instance Method Details

#loadObject



135
136
137
138
139
# File 'brew/Library/Homebrew/cask/cask_loader.rb', line 135

def load
  tap.install unless tap.installed?

  super
end