Spec-Zone.ru › Homebrew

Class: Cask::CaskLoader::NullLoader Private

Inherits:
FromPathLoader
  • Object
  • AbstractContentLoader
  • FromPathLoader
  • Cask::CaskLoader::NullLoader
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.

Pseudo-loader which raises an error when trying to load the corresponding cask.

Instance Attribute Summary

Attributes inherited from FromPathLoader

#path, #token

Attributes inherited from AbstractContentLoader

#content, #tap

Class Method Summary collapse

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

Instance Method Summary collapse

  • #initialize(ref) ⇒ void constructor private
  • #load(config:) ⇒ Cask private

Methods inherited from FromPathLoader

invalid_path?

Methods included from Utils::Output::Mixin

#issue_reporting_message, #odebug, #odeprecated, #odie, #odisabled, #ofail, #oh1, #oh1_title, #ohai, #ohai_title, #onoe, #opoo, #opoo_outside_github_actions, #opoo_without_github_actions_annotation, #pretty_deprecated, #pretty_disabled, #pretty_duration, #pretty_install_status, #pretty_installed, #pretty_uninstalled, #pretty_upgradable, #pretty_warning

Constructor Details

#initialize(ref) ⇒ 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:

  • ref (String, Pathname)


643
644
645
646
# File 'cask/cask_loader.rb', line 643

def initialize(ref)
  token = File.basename(ref, ".rb")
  super CaskLoader.default_path(token)
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:

  • ref (String, Pathname, Cask, URI::Generic)
  • warn (Boolean) (defaults to: false)

Returns:

  • (T.attached_class, nil)


635
636
637
638
639
640
# File 'cask/cask_loader.rb', line 635

def self.try_new(ref, warn: false)
  return if ref.is_a?(Cask)
  return if ref.is_a?(URI::Generic)

  new(ref)
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:

  • config (Config, nil)

Returns:

  • (Cask)

Raises:

  • (CaskUnavailableError)


649
650
651
# File 'cask/cask_loader.rb', line 649

def load(config:)
  raise CaskUnavailableError.new(token, "No Cask with this name exists.")
end

© 2009–present Homebrew contributors
Licensed under the BSD 2-Clause License.
https://docs.brew.sh/rubydoc/Cask/CaskLoader/NullLoader.html

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API