aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJack Nagel2013-06-15 16:39:46 -0500
committerJack Nagel2013-06-15 16:41:14 -0500
commitcf66686a17617e6b9235f8aa655d6f8d3c846abf (patch)
tree0e06285c8f062791b5f78231b9ae2c3bcfe91ecd
parente9d245cf3a6e1ce783931e8e339c11fb0f3757d5 (diff)
downloadbrew-cf66686a17617e6b9235f8aa655d6f8d3c846abf.tar.bz2
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`
-rwxr-xr-xLibrary/Contributions/cmd/brew-profile.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/Library/Contributions/cmd/brew-profile.rb b/Library/Contributions/cmd/brew-profile.rb
new file mode 100755
index 000000000..dfcc2c607
--- /dev/null
+++ b/Library/Contributions/cmd/brew-profile.rb
@@ -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)