brew/Library/Contributions/cmd/brew-profile.rb
Jack Nagel cf66686a17 Add brew-profile to contrib
This command loads all formulae and dumps an HTML profile report to
stdout. So e.g. `brew profile >/tmp/report.html`
2013-06-15 16:41:14 -05:00

13 lines
261 B
Ruby
Executable File

begin
require 'rubygems'
require 'ruby-prof'
rescue LoadError
abort 'This command requires the ruby-prof gem'
end
require 'formula'
RubyProf.start
Formula.names.each { |n| Formula.factory(n) }
RubyProf::GraphHtmlPrinter.new(RubyProf.stop).print(STDOUT)