diff options
| author | Jack Nagel | 2012-08-07 14:22:20 -0500 |
|---|---|---|
| committer | Jack Nagel | 2012-08-07 14:24:54 -0500 |
| commit | 4f809d0311ab6ca8da897d2a9830b9ecbf262d60 (patch) | |
| tree | 2af41b3b084a29cfb954763e22493239940331c3 /Library/Homebrew | |
| parent | 82d3890495a13d488dc2a024f69979d914b6bf6d (diff) | |
| download | brew-4f809d0311ab6ca8da897d2a9830b9ecbf262d60.tar.bz2 | |
Simplify printing conflicts in `brew info`
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
Diffstat (limited to 'Library/Homebrew')
| -rw-r--r-- | Library/Homebrew/cmd/info.rb | 5 | ||||
| -rw-r--r-- | Library/Homebrew/formula.rb | 4 |
2 files changed, 5 insertions, 4 deletions
diff --git a/Library/Homebrew/cmd/info.rb b/Library/Homebrew/cmd/info.rb index c263d3929..265abbec9 100644 --- a/Library/Homebrew/cmd/info.rb +++ b/Library/Homebrew/cmd/info.rb @@ -68,10 +68,7 @@ module Homebrew extend self end puts "Depends on: #{f.deps*', '}" unless f.deps.empty? - conflicts = [] - f.requirements.each do |dep| - conflicts << dep.formula if dep.is_a? ConflictRequirement - end + conflicts = f.conflicts.map { |c| c.formula } puts "Conflicts with: #{conflicts*', '}" unless conflicts.empty? if f.rack.directory? diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb index fb0855a17..d78ded9b0 100644 --- a/Library/Homebrew/formula.rb +++ b/Library/Homebrew/formula.rb @@ -425,6 +425,10 @@ class Formula def deps; self.class.dependencies.deps; end def requirements; self.class.dependencies.requirements; end + def conflicts + requirements.select { |r| r.is_a? ConflictRequirement } + end + # deps are in an installable order # which means if a depends on b then b will be ordered before a in this list def recursive_deps |
