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`
This commit is contained in:
parent
e9d245cf3a
commit
cf66686a17
12
Library/Contributions/cmd/brew-profile.rb
Executable file
12
Library/Contributions/cmd/brew-profile.rb
Executable file
@ -0,0 +1,12 @@
|
||||
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)
|
||||
Loading…
x
Reference in New Issue
Block a user