aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorXu Cheng2015-11-29 15:13:56 +0800
committerXu Cheng2015-11-29 20:24:30 +0800
commit6273d464ee463819fcf6055070b7ae549aed6472 (patch)
treeb934790301d2b5cc02bab8ac26f94a23e643a9c9 /Library
parentb31f84f2700dedd9482abbc7f1cf04c4a3196417 (diff)
downloadbrew-6273d464ee463819fcf6055070b7ae549aed6472.tar.bz2
add Formula#installed_prefixes and Formula#installed_kegs
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/formula.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb
index 67f2f9f93..b65600893 100644
--- a/Library/Homebrew/formula.rb
+++ b/Library/Homebrew/formula.rb
@@ -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.