formula: handle unavailable versioned formulae.

If people decide to copy these into their Homebrew/homebrew-core
`Formula` directory then it breaks generating the hash for any
non-versioned formulae.

See https://github.com/Homebrew/homebrew-bundle/issues/351
This commit is contained in:
Mike McQuaid 2018-07-30 09:16:53 +01:00
parent 5d4adead0b
commit e52d6dba79

View File

@ -385,8 +385,12 @@ class Formula
return [] if versioned_formula?
Pathname.glob(path.to_s.gsub(/\.rb$/, "@*.rb")).map do |path|
begin
Formula[path.basename(".rb").to_s]
end.sort
rescue FormulaUnavailableError
nil
end
end.compact.sort
end
# A named Resource for the currently active {SoftwareSpec}.