From 4613c9ecf5fbb0023fe44cde5c1ce1664b602b74 Mon Sep 17 00:00:00 2001 From: Xu Cheng Date: Sat, 12 Sep 2015 18:21:22 +0800 Subject: [PATCH] Tap: add alias method --- Library/Homebrew/tap.rb | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Library/Homebrew/tap.rb b/Library/Homebrew/tap.rb index 9d92dbe96d..841c888af2 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?)