aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/tap.rb
diff options
context:
space:
mode:
authorMike McQuaid2017-11-05 15:37:57 +0000
committerMike McQuaid2017-11-05 15:37:57 +0000
commit7a68b4a3f96c0cc76f94de2cd72b463b40be0343 (patch)
tree3a60bab25001d67966c8bf239b2d7a28f72cd1d3 /Library/Homebrew/tap.rb
parentc3006f0f121b44baa7acb5e2a023dfd96e582e7a (diff)
downloadbrew-7a68b4a3f96c0cc76f94de2cd72b463b40be0343.tar.bz2
Refactor command handling code
Don’t rely on having external commands always present in the PATH in order to find them. Instead, provide an accessory method to Tap so they can be added and used when needed. While we’re here, do some general refactoring and cleanup of the command code in these places.
Diffstat (limited to 'Library/Homebrew/tap.rb')
-rw-r--r--Library/Homebrew/tap.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/Library/Homebrew/tap.rb b/Library/Homebrew/tap.rb
index 2d1c47e32..ed93e1266 100644
--- a/Library/Homebrew/tap.rb
+++ b/Library/Homebrew/tap.rb
@@ -503,6 +503,11 @@ class Tap
map(&:name).sort
end
+ # an array of all tap cmd directory {Pathname}s
+ def self.cmd_directories
+ Pathname.glob TAP_DIRECTORY/"*/*/cmd"
+ end
+
# @private
def formula_file_to_name(file)
"#{name}/#{file.basename(".rb")}"