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/dev-cmd/where.rb | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 Library/Homebrew/dev-cmd/where.rb (limited to 'Library/Homebrew/dev-cmd') 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/dev-cmd/formula.rb | 15 +++++++++++++++ Library/Homebrew/dev-cmd/where.rb | 15 --------------- 2 files changed, 15 insertions(+), 15 deletions(-) create mode 100644 Library/Homebrew/dev-cmd/formula.rb delete mode 100644 Library/Homebrew/dev-cmd/where.rb (limited to 'Library/Homebrew/dev-cmd') 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 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/Homebrew/dev-cmd') 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