aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/dev-cmd/prof.rb
blob: c7121f6e851aa2f7a51c8fb764e654d33db9b9cc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#:  * `prof` [<ruby options>]:
#:    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