Class: Cask::CaskLoader::FromTapLoader Private
- Inherits:
-
FromPathLoader
- Object
- AbstractContentLoader
- FromPathLoader
- Cask::CaskLoader::FromTapLoader
- 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
Instance Attribute Summary collapse
- #tap ⇒ Tap readonly private
Attributes inherited from FromPathLoader
Attributes inherited from AbstractContentLoader
Class Method Summary collapse
Instance Method Summary collapse
- #initialize(tapped_token) ⇒ void constructor private
- #load(config:) ⇒ Cask private
Methods inherited from FromPathLoader
Methods included from Utils::Output::Mixin
#odebug, #odeprecated, #odie, #odisabled, #ofail, #oh1, #oh1_title, #ohai, #ohai_title, #onoe, #opoo, #opoo_outside_github_actions, #pretty_duration, #pretty_installed, #pretty_outdated, #pretty_uninstalled
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.
257 258 259 260 261 |
# File 'cask/cask_loader.rb', line 257 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
#tap ⇒ Tap (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.
235 236 237 |
# File 'cask/cask_loader.rb', line 235 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.
242 243 244 245 246 247 248 249 250 251 252 253 254 |
# File 'cask/cask_loader.rb', line 242 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, type = token_tap_type if type == :migration && tap.core_cask_tap? && (loader = FromAPILoader.try_new(token)) loader else new("#{tap}/#{token}") end 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.
264 265 266 267 268 |
# File 'cask/cask_loader.rb', line 264 def load(config:) raise TapCaskUnavailableError.new(tap, token) unless T.must(tap).installed? super end |