diff options
| author | Adam Vandenberg | 2014-03-05 20:51:37 -0800 |
|---|---|---|
| committer | Adam Vandenberg | 2014-03-07 07:08:52 -0800 |
| commit | e8b4a7880534aa85992428f91c6daaf9b21b244b (patch) | |
| tree | 3fbc288803e63383e74864cb1b16416b05c5c936 /Library | |
| parent | a35ca5343a7a809c6d7ff855d6170d664fe5219a (diff) | |
| download | homebrew-e8b4a7880534aa85992428f91c6daaf9b21b244b.tar.bz2 | |
document formula path helpers
Diffstat (limited to 'Library')
| -rw-r--r-- | Library/Homebrew/formula.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb index e11aa0019..43a67079d 100644 --- a/Library/Homebrew/formula.rb +++ b/Library/Homebrew/formula.rb @@ -163,9 +163,13 @@ class Formula Keg.new(installed_prefix).version end + # The directory in the cellar that the formula is installed to. + # This directory contains the formula's name and version. def prefix(v=pkg_version) Pathname.new("#{HOMEBREW_CELLAR}/#{name}/#{v}") end + # The parent of the prefix; the named directory in the cellar containing all + # installed versions of this software def rack; prefix.parent end def bin; prefix+'bin' end @@ -210,6 +214,12 @@ class Formula def plist_manual; self.class.plist_manual end def plist_startup; self.class.plist_startup end + # A stable path for this formula, when installed. Contains the formula name + # but no version number. Only the active version will be linked here if + # multiple versions are installed. + # + # This is the prefered way to refer a formula in plists or from another + # formula, as the path is stable even when the software is updated. def opt_prefix Pathname.new("#{HOMEBREW_PREFIX}/opt/#{name}") end |
