aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorAdam Vandenberg2014-03-05 20:51:37 -0800
committerAdam Vandenberg2014-03-07 07:08:52 -0800
commit5cb3b25d4306625d69ce4072fffb3d6cc8f32cab (patch)
treef854fbd9a12659f2984e9055dc3357f6adcae66e /Library
parentcb047a223b03ba068d94112cc8f07828826b9d59 (diff)
downloadbrew-5cb3b25d4306625d69ce4072fffb3d6cc8f32cab.tar.bz2
document formula path helpers
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/formula.rb10
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