Spec-Zone.ru › Homebrew

Class: Formulary::FormulaContentsLoader Private

Inherits:
FormulaLoader
  • Object
  • FormulaLoader
  • Formulary::FormulaContentsLoader
show all
Defined in:
formulary.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.

Load formulae directly from their contents.

Instance Attribute Summary collapse

  • #contents ⇒ String readonly private

    The formula's contents.

Attributes inherited from FormulaLoader

#alias_path, #name, #path, #tap

Instance Method Summary collapse

  • #initialize(name, path, contents, tap: nil) ⇒ void constructor private
  • #klass(flags:, ignore_errors:) ⇒ T.class_of(Formula) private

Methods inherited from FormulaLoader

#get_formula

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

Methods included from Context

current, current=, #debug?, #quiet?, #verbose?, #with_context

Constructor Details

#initialize(name, path, contents, tap: nil) ⇒ 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:

  • name (String)
  • path (Pathname)
  • contents (String)
  • tap (Tap, nil) (defaults to: nil)


894
895
896
897
# File 'formulary.rb', line 894

def initialize(name, path, contents, tap: nil)
  @contents = contents
  super name, path, tap:
end

Instance Attribute Details

#contents ⇒ String (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.

The formula's contents.

Returns:

  • (String)


891
892
893
# File 'formulary.rb', line 891

def contents
  @contents
end

Instance Method Details

#klass(flags:, ignore_errors:) ⇒ T.class_of(Formula)

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:

  • flags (Array<String>)
  • ignore_errors (Boolean)

Returns:

  • (T.class_of(Formula))


900
901
902
903
# File 'formulary.rb', line 900

def klass(flags:, ignore_errors:)
  namespace = "FormulaNamespace#{Digest::MD5.hexdigest(contents.to_s)}"
  Formulary.load_formula(name, path, contents, namespace, flags:, ignore_errors:)
end

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

Spec-Zone.ru

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