Class: Formulary::FromKegLoader Private
- Inherits:
-
FormulaLoader
- Object
- FormulaLoader
- Formulary::FromKegLoader
- 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.
Loads a formula from a formula file in a keg.
Instance Attribute Summary
Attributes inherited from FormulaLoader
#alias_path, #name, #path, #tap
Class Method Summary collapse
Methods inherited from FormulaLoader
#get_formula, #initialize, #klass
Methods included from Utils::Output::Mixin
#issue_reporting_message, #odebug, #odeprecated, #odie, #odisabled, #ofail, #oh1, #oh1_title, #ohai, #ohai_title, #onoe, #opoo, #opoo_once, #opoo_outside_github_actions, #opoo_without_github_actions_annotation, #pretty_cannot_install, #pretty_deprecated, #pretty_disabled, #pretty_duration, #pretty_install_status, #pretty_installed, #pretty_uninstalled, #pretty_unmarked, #pretty_upgradable, #pretty_warning
Methods included from Context
current, current=, #debug?, #deferred_environment_expansion?, #quiet?, #verbose?, #with_context
Constructor Details
This class inherits a constructor from Formulary::FormulaLoader
Class Method Details
.try_new(ref, from: nil, 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.
838 839 840 841 842 843 844 845 846 847 848 849 |
# File 'formulary.rb', line 838 def self.try_new(ref, from: nil, warn: false) ref = ref.to_s keg_directory = HOMEBREW_PREFIX/"opt/#{ref}" return unless keg_directory.directory? keg = Keg.new(keg_directory) return if ref != keg.name return unless (keg_formula = keg_directory/".brew/#{keg.name}.rb").file? new(keg.name, keg_formula, tap: keg.tab.tap) end |