aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorXu Cheng2015-09-12 18:21:22 +0800
committerXu Cheng2015-09-13 12:58:00 +0800
commit4613c9ecf5fbb0023fe44cde5c1ce1664b602b74 (patch)
tree5439d11eb08f4218b4c89c42e0c1ee245033c3ff /Library
parent7ea8a23eeb340b5d265f588b8a7c73af14d35514 (diff)
downloadbrew-4613c9ecf5fbb0023fe44cde5c1ce1664b602b74.tar.bz2
Tap: add alias method
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/tap.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/Library/Homebrew/tap.rb b/Library/Homebrew/tap.rb
index 9d92dbe96..841c888af 100644
--- a/Library/Homebrew/tap.rb
+++ b/Library/Homebrew/tap.rb
@@ -96,6 +96,18 @@ class Tap
formula_files.map { |f| "#{name}/#{f.basename(".rb")}" }
end
+ # an array of all alias files of this {Tap}.
+ # @private
+ def alias_files
+ Pathname.glob("#{path}/Aliases/*").select(&:file?)
+ end
+
+ # an array of all aliases of this {Tap}.
+ # @private
+ def aliases
+ alias_files.map { |f| f.basename.to_s }
+ end
+
# an array of all commands files of this {Tap}.
def command_files
Pathname.glob("#{path}/cmd/brew-*").select(&:executable?)