From 6302da37f66fe9bb04e95fe67e8529fe0086187d Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Tue, 27 Feb 2018 12:07:30 +0000 Subject: Add prof and ruby commands. These are imported from Homebrew/homebrew-dev-tools and are both used by maintainers so may be useful for contributors too. --- Library/Homebrew/dev-cmd/prof.rb | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100755 Library/Homebrew/dev-cmd/prof.rb (limited to 'Library/Homebrew/dev-cmd/prof.rb') diff --git a/Library/Homebrew/dev-cmd/prof.rb b/Library/Homebrew/dev-cmd/prof.rb new file mode 100755 index 000000000..c7121f6e8 --- /dev/null +++ b/Library/Homebrew/dev-cmd/prof.rb @@ -0,0 +1,15 @@ +#: * `prof` []: +#: Run Homebrew with the Ruby profiler. +#: For example: +# brew prof readall + +module Homebrew + module_function + + def prof + Homebrew.install_gem_setup_path! "ruby-prof" + FileUtils.mkdir_p "prof" + brew_rb = (HOMEBREW_LIBRARY_PATH/"brew.rb").resolved_path + exec "ruby-prof", "--printer=multi", "--file=prof", brew_rb, "--", *ARGV + end +end -- cgit v1.2.3