Tap: add alias method

This commit is contained in:
Xu Cheng 2015-09-12 18:21:22 +08:00
parent 7ea8a23eeb
commit 4613c9ecf5

View File

@ -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?)