Class: Hbc::CaskLoader::FromTapLoader

Inherits:
FromTapPathLoader show all
Defined in:
Library/Homebrew/cask/lib/hbc/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



120
121
122
123
# File 'Library/Homebrew/cask/lib/hbc/cask_loader.rb', line 120

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)


116
117
118
# File 'Library/Homebrew/cask/lib/hbc/cask_loader.rb', line 116

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

Instance Method Details

#loadObject



125
126
127
128
129
# File 'Library/Homebrew/cask/lib/hbc/cask_loader.rb', line 125

def load
  tap.install unless tap.installed?

  super
end