diff options
Diffstat (limited to 'Library/Homebrew/dev-cmd')
| -rwxr-xr-x | Library/Homebrew/dev-cmd/prof.rb | 15 | ||||
| -rwxr-xr-x | Library/Homebrew/dev-cmd/ruby.rb | 13 |
2 files changed, 28 insertions, 0 deletions
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` [<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 diff --git a/Library/Homebrew/dev-cmd/ruby.rb b/Library/Homebrew/dev-cmd/ruby.rb new file mode 100755 index 000000000..2df212301 --- /dev/null +++ b/Library/Homebrew/dev-cmd/ruby.rb @@ -0,0 +1,13 @@ +#: * `ruby` [<ruby options>]: +#: Run a Ruby instance with Homebrew's libraries loaded. +#: For example: +# brew ruby -e "puts :gcc.f.deps" +# brew ruby script.rb + +module Homebrew + module_function + + def ruby + exec ENV["HOMEBREW_RUBY_PATH"], "-I#{HOMEBREW_LIBRARY_PATH}", "-rglobal", "-rcmd/irb", *ARGV + end +end |
