Formula: handle bad tap runtime dependencies.
Also add some better exceptions for the cases that `nil`s end up getting passed around incorrectly.
This commit is contained in:
parent
a674a972a5
commit
6b817f775f
@ -10,6 +10,8 @@ class Dependency
|
||||
DEFAULT_ENV_PROC = proc {}
|
||||
|
||||
def initialize(name, tags = [], env_proc = DEFAULT_ENV_PROC, option_names = [name])
|
||||
raise ArgumentError, "Dependency must have a name!" unless name
|
||||
|
||||
@name = name
|
||||
@tags = tags
|
||||
@env_proc = env_proc
|
||||
|
||||
@ -1522,7 +1522,10 @@ class Formula
|
||||
if read_from_tab &&
|
||||
(keg = opt_or_installed_prefix_keg) &&
|
||||
(tab_deps = keg.runtime_dependencies)
|
||||
return tab_deps.map { |d| Dependency.new d["full_name"] }.compact
|
||||
return tab_deps.map do |d|
|
||||
next unless d["full_name"]
|
||||
Dependency.new d["full_name"]
|
||||
end.compact
|
||||
end
|
||||
|
||||
declared_runtime_dependencies | undeclared_runtime_dependencies
|
||||
|
||||
@ -277,6 +277,7 @@ module Formulary
|
||||
# * a formula URL
|
||||
# * a local bottle reference
|
||||
def self.factory(ref, spec = :stable, alias_path: nil, from: nil)
|
||||
raise ArgumentError, "Formulae must have a ref!" unless ref
|
||||
loader_for(ref, from: from).get_formula(spec, alias_path: alias_path)
|
||||
end
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user