From ae829ed229395159adf6f1f17fb26518ec27fca6 Mon Sep 17 00:00:00 2001 From: Timothee Cour Date: Tue, 7 Feb 2017 23:25:02 -0800 Subject: add brew where command --- Library/Homebrew/cmd/help.rb | 2 +- Library/Homebrew/dev-cmd/where.rb | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 Library/Homebrew/dev-cmd/where.rb (limited to 'Library') diff --git a/Library/Homebrew/cmd/help.rb b/Library/Homebrew/cmd/help.rb index 1378e7b1f..70379314e 100644 --- a/Library/Homebrew/cmd/help.rb +++ b/Library/Homebrew/cmd/help.rb @@ -15,7 +15,7 @@ Troubleshooting: Developers: brew create [URL [--no-fetch]] - brew edit [FORMULA...] + brew (where|edit) [FORMULA...] http://docs.brew.sh/Formula-Cookbook.html Further help: diff --git a/Library/Homebrew/dev-cmd/where.rb b/Library/Homebrew/dev-cmd/where.rb new file mode 100644 index 000000000..63237301b --- /dev/null +++ b/Library/Homebrew/dev-cmd/where.rb @@ -0,0 +1,15 @@ +#: * `where` : +#: echo location of the specified to stdout + +require "formula" + +module Homebrew + module_function + + def where + raise FormulaUnspecifiedError if ARGV.named.empty? + ARGV.resolved_formulae.each do |f| + puts "#{f.path}\n" + end + end +end -- cgit v1.2.3 From ac091437e5b2ae8ca21058cf47184f1788c8d697 Mon Sep 17 00:00:00 2001 From: Timothee Cour Date: Wed, 8 Feb 2017 00:12:50 -0800 Subject: renamed where to formula --- Library/Homebrew/cmd/help.rb | 2 +- Library/Homebrew/dev-cmd/formula.rb | 15 +++++++++++++++ Library/Homebrew/dev-cmd/where.rb | 15 --------------- 3 files changed, 16 insertions(+), 16 deletions(-) create mode 100644 Library/Homebrew/dev-cmd/formula.rb delete mode 100644 Library/Homebrew/dev-cmd/where.rb (limited to 'Library') diff --git a/Library/Homebrew/cmd/help.rb b/Library/Homebrew/cmd/help.rb index 70379314e..669f92ddd 100644 --- a/Library/Homebrew/cmd/help.rb +++ b/Library/Homebrew/cmd/help.rb @@ -15,7 +15,7 @@ Troubleshooting: Developers: brew create [URL [--no-fetch]] - brew (where|edit) [FORMULA...] + brew (formula|edit) [FORMULA...] http://docs.brew.sh/Formula-Cookbook.html Further help: diff --git a/Library/Homebrew/dev-cmd/formula.rb b/Library/Homebrew/dev-cmd/formula.rb new file mode 100644 index 000000000..80008a354 --- /dev/null +++ b/Library/Homebrew/dev-cmd/formula.rb @@ -0,0 +1,15 @@ +#: * `formula` : +#: echo location of the specified to stdout + +require "formula" + +module Homebrew + module_function + + def formula + raise FormulaUnspecifiedError if ARGV.named.empty? + ARGV.resolved_formulae.each do |f| + puts "#{f.path}\n" + end + end +end diff --git a/Library/Homebrew/dev-cmd/where.rb b/Library/Homebrew/dev-cmd/where.rb deleted file mode 100644 index 63237301b..000000000 --- a/Library/Homebrew/dev-cmd/where.rb +++ /dev/null @@ -1,15 +0,0 @@ -#: * `where` : -#: echo location of the specified to stdout - -require "formula" - -module Homebrew - module_function - - def where - raise FormulaUnspecifiedError if ARGV.named.empty? - ARGV.resolved_formulae.each do |f| - puts "#{f.path}\n" - end - end -end -- cgit v1.2.3 From de16dcc1ade56878cae04cf26bdaa465730c28d8 Mon Sep 17 00:00:00 2001 From: Timothee Cour Date: Wed, 8 Feb 2017 00:27:50 -0800 Subject: brew formula not shown in --help to avoid increasing vertical space --- Library/Homebrew/cmd/help.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Library') diff --git a/Library/Homebrew/cmd/help.rb b/Library/Homebrew/cmd/help.rb index 669f92ddd..1378e7b1f 100644 --- a/Library/Homebrew/cmd/help.rb +++ b/Library/Homebrew/cmd/help.rb @@ -15,7 +15,7 @@ Troubleshooting: Developers: brew create [URL [--no-fetch]] - brew (formula|edit) [FORMULA...] + brew edit [FORMULA...] http://docs.brew.sh/Formula-Cookbook.html Further help: -- cgit v1.2.3 From 0d715f90ea0e9b84231ce2221709f2134ee0ae31 Mon Sep 17 00:00:00 2001 From: Timothee Cour Date: Sat, 11 Feb 2017 16:37:41 -0800 Subject: applied changes suggested in PR --- Library/Homebrew/dev-cmd/formula.rb | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'Library') diff --git a/Library/Homebrew/dev-cmd/formula.rb b/Library/Homebrew/dev-cmd/formula.rb index 80008a354..71687dfa7 100644 --- a/Library/Homebrew/dev-cmd/formula.rb +++ b/Library/Homebrew/dev-cmd/formula.rb @@ -1,5 +1,5 @@ -#: * `formula` : -#: echo location of the specified to stdout +#: * `formula` : +#: Display the path where is require "formula" @@ -8,8 +8,6 @@ module Homebrew def formula raise FormulaUnspecifiedError if ARGV.named.empty? - ARGV.resolved_formulae.each do |f| - puts "#{f.path}\n" - end + ARGV.resolved_formulae.each { |f| puts f.path } end end -- cgit v1.2.3 From 588f98cf825be855782ec00272f8d7e691d37c69 Mon Sep 17 00:00:00 2001 From: Timothee Cour Date: Sun, 12 Feb 2017 14:47:05 -0800 Subject: formula:formula_cmd_test --- Library/Homebrew/test/formula_cmd_test.rb | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 Library/Homebrew/test/formula_cmd_test.rb (limited to 'Library') diff --git a/Library/Homebrew/test/formula_cmd_test.rb b/Library/Homebrew/test/formula_cmd_test.rb new file mode 100644 index 000000000..abbe42d98 --- /dev/null +++ b/Library/Homebrew/test/formula_cmd_test.rb @@ -0,0 +1,8 @@ +require "testing_env" + +class IntegrationCommandTestFormula < IntegrationCommandTestCase + def test_formula + formula_file = setup_test_formula "testball" + assert_equal formula_file.to_s, cmd("formula", "testball") + end +end -- cgit v1.2.3