Merge pull request #3845 from MikeMcQuaid/master

Add prof and ruby commands.
This commit is contained in:
Mike McQuaid 2018-02-27 13:05:06 +00:00 committed by GitHub
commit 96cafb4124
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 44 additions and 0 deletions

View File

@ -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

View File

@ -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

View File

@ -782,6 +782,10 @@ With `--verbose` or `-v`, many commands print extra debugging information. Note
Additionally, the date used in new manpages will match those in the existing Additionally, the date used in new manpages will match those in the existing
manpages (to allow comparison without factoring in the date). manpages (to allow comparison without factoring in the date).
* `prof` [`ruby options`]:
Run Homebrew with the Ruby profiler.
For example:
* `pull` [`--bottle`] [`--bump`] [`--clean`] [`--ignore-whitespace`] [`--resolve`] [`--branch-okay`] [`--no-pbcopy`] [`--no-publish`] [`--warn-on-publish-failure`] [`--bintray-org=``bintray-org`] [`--test-bot-user=``test-bot-user`] `patch-source` [`patch-source`]: * `pull` [`--bottle`] [`--bump`] [`--clean`] [`--ignore-whitespace`] [`--resolve`] [`--branch-okay`] [`--no-pbcopy`] [`--no-publish`] [`--warn-on-publish-failure`] [`--bintray-org=``bintray-org`] [`--test-bot-user=``test-bot-user`] `patch-source` [`patch-source`]:
Gets a patch from a GitHub commit or pull request and applies it to Homebrew. Gets a patch from a GitHub commit or pull request and applies it to Homebrew.
@ -839,6 +843,10 @@ With `--verbose` or `-v`, many commands print extra debugging information. Note
If `--markdown` is passed, output as a Markdown list. If `--markdown` is passed, output as a Markdown list.
* `ruby` [`ruby options`]:
Run a Ruby instance with Homebrew's libraries loaded.
For example:
* `tap-new` `user``/``repo`: * `tap-new` `user``/``repo`:
Generate the template files for a new tap. Generate the template files for a new tap.

View File

@ -801,6 +801,10 @@ Generate Homebrew\'s manpages\.
If \fB\-\-fail\-if\-changed\fR is passed, the command will return a failing status code if changes are detected in the manpage outputs\. This can be used for CI to be notified when the manpages are out of date\. Additionally, the date used in new manpages will match those in the existing manpages (to allow comparison without factoring in the date)\. If \fB\-\-fail\-if\-changed\fR is passed, the command will return a failing status code if changes are detected in the manpage outputs\. This can be used for CI to be notified when the manpages are out of date\. Additionally, the date used in new manpages will match those in the existing manpages (to allow comparison without factoring in the date)\.
. .
.TP .TP
\fBprof\fR [\fIruby options\fR]
Run Homebrew with the Ruby profiler\. For example:
.
.TP
\fBpull\fR [\fB\-\-bottle\fR] [\fB\-\-bump\fR] [\fB\-\-clean\fR] [\fB\-\-ignore\-whitespace\fR] [\fB\-\-resolve\fR] [\fB\-\-branch\-okay\fR] [\fB\-\-no\-pbcopy\fR] [\fB\-\-no\-publish\fR] [\fB\-\-warn\-on\-publish\-failure\fR] [\fB\-\-bintray\-org=\fR\fIbintray\-org\fR] [\fB\-\-test\-bot\-user=\fR\fItest\-bot\-user\fR] \fIpatch\-source\fR [\fIpatch\-source\fR]: \fBpull\fR [\fB\-\-bottle\fR] [\fB\-\-bump\fR] [\fB\-\-clean\fR] [\fB\-\-ignore\-whitespace\fR] [\fB\-\-resolve\fR] [\fB\-\-branch\-okay\fR] [\fB\-\-no\-pbcopy\fR] [\fB\-\-no\-publish\fR] [\fB\-\-warn\-on\-publish\-failure\fR] [\fB\-\-bintray\-org=\fR\fIbintray\-org\fR] [\fB\-\-test\-bot\-user=\fR\fItest\-bot\-user\fR] \fIpatch\-source\fR [\fIpatch\-source\fR]:
. .
.IP .IP
@ -862,6 +866,10 @@ Output the merged pull requests on Homebrew/brew between two Git refs\. If no \f
If \fB\-\-markdown\fR is passed, output as a Markdown list\. If \fB\-\-markdown\fR is passed, output as a Markdown list\.
. .
.TP .TP
\fBruby\fR [\fIruby options\fR]
Run a Ruby instance with Homebrew\'s libraries loaded\. For example:
.
.TP
\fBtap\-new\fR \fIuser\fR\fB/\fR\fIrepo\fR \fBtap\-new\fR \fIuser\fR\fB/\fR\fIrepo\fR
Generate the template files for a new tap\. Generate the template files for a new tap\.
. .