diff options
| author | Xu Cheng | 2015-09-12 19:14:38 +0800 | 
|---|---|---|
| committer | Xu Cheng | 2015-09-13 12:58:00 +0800 | 
| commit | 81bd5c40d0719d3d64dc94e163ded2cc2f57b3e6 (patch) | |
| tree | 26ecddae1e69cbe727ac8fc72b62521f7586a436 /Library/Homebrew/formula.rb | |
| parent | 4613c9ecf5fbb0023fe44cde5c1ce1664b602b74 (diff) | |
| download | brew-81bd5c40d0719d3d64dc94e163ded2cc2f57b3e6.tar.bz2 | |
Formula: add tap alias
Closes Homebrew/homebrew#43851.
Signed-off-by: Xu Cheng <xucheng@me.com>
Diffstat (limited to 'Library/Homebrew/formula.rb')
| -rw-r--r-- | Library/Homebrew/formula.rb | 15 | 
1 files changed, 14 insertions, 1 deletions
diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb index 7b3d0062e..a3f63f1bd 100644 --- a/Library/Homebrew/formula.rb +++ b/Library/Homebrew/formula.rb @@ -1011,9 +1011,22 @@ class Formula      end.compact    end +  # an array of all core aliases +  # @private +  def self.core_aliases +    @core_aliases ||= Dir["#{HOMEBREW_LIBRARY}/Aliases/*"].map { |f| File.basename f }.sort +  end + +  # an array of all tap aliases +  # @private +  def self.tap_aliases +    @tap_aliases ||= Tap.flat_map(&:aliases).sort +  end + +  # an array of all aliases    # @private    def self.aliases -    Dir["#{HOMEBREW_LIBRARY}/Aliases/*"].map { |f| File.basename f }.sort +    @aliases ||= (core_aliases + tap_aliases).sort.uniq    end    def self.[](name)  | 
