Merge pull request #4568 from MikeMcQuaid/versioned-formula-handle-unavailable

formula: handle unavailable versioned formulae.
This commit is contained in:
Mike McQuaid 2018-07-30 09:45:53 +01:00 committed by GitHub
commit adf2dd9e10
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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