From 18836d93d8f9f99c1e4d4fbaf9843e9f223f1742 Mon Sep 17 00:00:00 2001
From: Jack Nagel <jacknagel@gmail.com>
Date: Wed, 23 Jan 2013 00:26:29 -0600
Subject: [PATCH] uses: utilize modern dependency API

---
 Library/Homebrew/cmd/uses.rb | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/Library/Homebrew/cmd/uses.rb b/Library/Homebrew/cmd/uses.rb
index 4d24266c14..6775a55c0c 100644
--- a/Library/Homebrew/cmd/uses.rb
+++ b/Library/Homebrew/cmd/uses.rb
@@ -12,20 +12,17 @@ module Homebrew extend self
     uses = Formula.select do |f|
       ARGV.formulae.all? do |ff|
         if ARGV.flag? '--recursive'
-          f.recursive_deps.include? ff
+          f.recursive_dependencies.any? { |dep| dep.name == ff.name }
         else
-          f.deps.include? ff
+          f.deps.any? { |dep| dep.name == ff.name }
         end
       end
     end
 
     if ARGV.include? "--installed"
-      uses = uses.select do |f|
-        keg = HOMEBREW_CELLAR/f
-        keg.directory? and not keg.subdirs.empty?
-      end
+      uses = uses.select { |f| Formula.installed.include? f }
     end
 
-    puts_columns uses.map{|f| f.to_s}.sort
+    puts_columns uses.map(&:to_s).sort
   end
 end
-- 
GitLab