diff options
Diffstat (limited to 'Library/Homebrew/compat')
| -rw-r--r-- | Library/Homebrew/compat/compatibility.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/Library/Homebrew/compat/compatibility.rb b/Library/Homebrew/compat/compatibility.rb index f0d6ab0b1..67f540844 100644 --- a/Library/Homebrew/compat/compatibility.rb +++ b/Library/Homebrew/compat/compatibility.rb @@ -99,6 +99,21 @@ class Formula val.nil? ? @bottle_sha1 : @bottle_sha1 = val end end + + # These methods return lists of Formula objects. + # They are eprecated in favor of Dependency::expand_dependencies + # and Formula#recursive_dependencies, which return lists of + # Dependency objects instead. + def self.expand_deps f + f.deps.map do |dep| + f_dep = Formula.factory dep.to_s + expand_deps(f_dep) << f_dep + end + end + + def recursive_deps + Formula.expand_deps(self).flatten.uniq + end end class UnidentifiedFormula < Formula |
