Class: Formulary::FormulaLoader Private

Inherits:
Object
  • Object
show all
Includes:
Context
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.

A FormulaLoader returns instances of formulae. Subclasses implement loaders for particular sources of formulae.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Context

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

Constructor Details

#initialize(name, path, alias_path: nil, 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:



502
503
504
505
506
507
# File 'formulary.rb', line 502

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

Instance Attribute Details

#alias_pathPathname? (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 name used to install the formula.

Returns:



495
496
497
# File 'formulary.rb', line 495

def alias_path
  @alias_path
end

#nameString (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 name.

Returns:



487
488
489
# File 'formulary.rb', line 487

def name
  @name
end

#pathPathname (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 file's path.

Returns:



491
492
493
# File 'formulary.rb', line 491

def path
  @path
end

#tapTap? (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 tap (nil if it should be implicitly determined).

Returns:



499
500
501
# File 'formulary.rb', line 499

def tap
  @tap
end

Instance Method Details

#get_formula(spec, alias_path: nil, force_bottle: false, flags: [], ignore_errors: false) ⇒ Object

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.

Gets the formula instance. alias_path can be overridden here in case an alias was used to refer to a formula that was loaded in another way.



512
513
514
515
516
# File 'formulary.rb', line 512

def get_formula(spec, alias_path: nil, force_bottle: false, flags: [], ignore_errors: false)
  alias_path ||= self.alias_path
  klass(flags:, ignore_errors:)
    .new(name, path, spec, alias_path:, tap:, force_bottle:)
end

#klass(flags:, ignore_errors:) ⇒ Object

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.



518
519
520
521
# File 'formulary.rb', line 518

def klass(flags:, ignore_errors:)
  load_file(flags:, ignore_errors:) unless Formulary.formula_class_defined_from_path?(path)
  Formulary.formula_class_get_from_path(path)
end