Class: Formulary::FromTapLoader Private
- Inherits:
-
FormulaLoader
- Object
- FormulaLoader
- Formulary::FromTapLoader
- 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 tapped formulae.
Direct Known Subclasses
Instance Attribute Summary collapse
- #path ⇒ Pathname readonly private
- #tap ⇒ Tap readonly private
Attributes inherited from FormulaLoader
Class Method Summary collapse
Instance Method Summary collapse
- #get_formula(spec, alias_path: nil, force_bottle: false, flags: [], ignore_errors: false) ⇒ Formula private
- #initialize(name, path, tap:, alias_name: nil) ⇒ void constructor private
- #load_file(flags:, ignore_errors:) ⇒ void private
Methods inherited from FormulaLoader
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
Methods included from Context
current, current=, #debug?, #quiet?, #verbose?, #with_context
Constructor Details
#initialize(name, path, tap:, alias_name: 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.
876 877 878 879 880 881 |
# File 'formulary.rb', line 876 def initialize(name, path, tap:, alias_name: nil) alias_path = tap.alias_dir/alias_name if alias_name super(name, path, alias_path:, tap:) @tap = tap end |
Instance Attribute Details
#path ⇒ Pathname (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.
849 850 851 |
# File 'formulary.rb', line 849 def path @path end |
#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.
846 847 848 |
# File 'formulary.rb', line 846 def tap @tap end |
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.
855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 |
# File 'formulary.rb', line 855 def self.try_new(ref, from: nil, warn: false) ref = ref.to_s return unless (name_tap_type = Formulary.tap_formula_name_type(ref, warn:)) name, tap, type = name_tap_type path = Formulary.find_formula_in_tap(name, tap) if type == :alias # TODO: Simplify this by making `tap_formula_name_type` return the alias name. alias_name = T.must(ref[HOMEBREW_TAP_FORMULA_REGEX, :name]).downcase end if type == :migration && tap.core_tap? && (loader = FromAPILoader.try_new(name)) T.cast(loader, T.attached_class) else new(name, path, tap:, alias_name:) end end |
Instance Method Details
#get_formula(spec, alias_path: nil, force_bottle: false, flags: [], ignore_errors: false) ⇒ 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.
892 893 894 895 896 897 898 899 900 |
# File 'formulary.rb', line 892 def get_formula(spec, alias_path: nil, force_bottle: false, flags: [], ignore_errors: false) super rescue FormulaUnreadableError => e raise TapFormulaUnreadableError.new(tap, name, e.formula_error), "", e.backtrace rescue FormulaClassUnavailableError => e raise TapFormulaClassUnavailableError.new(tap, name, e.path, e.class_name, e.class_list), "", e.backtrace rescue FormulaUnavailableError => e raise TapFormulaUnavailableError.new(tap, name), "", e.backtrace end |
#load_file(flags:, ignore_errors:) ⇒ 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.
This method returns an undefined value.
903 904 905 906 907 908 |
# File 'formulary.rb', line 903 def load_file(flags:, ignore_errors:) super rescue MethodDeprecatedError => e e.issues_url = tap.issues_url || tap.to_s raise end |