blob: eed04ae0f3c5a5c3bc48e266b213737c4a9cb299 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
require 'formula'
module Homebrew extend self
def deps
if ARGV.include? '--all'
Formula.each do |f|
puts "#{f.name}: #{f.deps*' '}"
end
else
all_deps = ARGV.formulae.map{ |f| ARGV.one? ? f.deps : f.recursive_deps }.intersection
all_deps.sort! unless ARGV.include? "-n"
puts all_deps
end
end
end
class Array
def intersection
a = []
each{ |b| a |= b }
each{ |c| a &= c }
a
end
end
|