add Formula#installed_prefixes and Formula#installed_kegs

This commit is contained in:
Xu Cheng 2015-11-29 15:13:56 +08:00
parent b31f84f270
commit 6273d464ee

View File

@ -436,6 +436,18 @@ class Formula
prefix.parent
end
# All of current installed prefix directories.
# @private
def installed_prefixes
rack.directory? ? rack.subdirs : []
end
# All of current installed kegs.
# @private
def installed_kegs
installed_prefixes.map { |dir| Keg.new(dir) }
end
# The directory where the formula's binaries should be installed.
# This is symlinked into `HOMEBREW_PREFIX` after installation or with
# `brew link` for formulae that are not keg-only.