aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula/couchdb-lucene.rb
diff options
context:
space:
mode:
authorJack Nagel2011-12-30 23:56:52 -0600
committerJack Nagel2012-02-03 19:50:58 -0600
commitb5a5217ba3117dfbfcad63532c2054d83d3249c0 (patch)
tree1cb6f20dbb550463da7ccc1ad012afea251c0a32 /Library/Formula/couchdb-lucene.rb
parent95e379faf1de79a46bd49dcf890b8053afde58b8 (diff)
downloadhomebrew-b5a5217ba3117dfbfcad63532c2054d83d3249c0.tar.bz2
Add and use plist helper methods
These will be used to unify the label namespaces in embedded plists, i.e. 'homebrew.mxcl.<formula>'. plist_path returns the full path to a plist file located at the top level of the keg; plist_path.basename can be used if just the filename is needed. c.f. #9346. Signed-off-by: Jack Nagel <jacknagel@gmail.com>
Diffstat (limited to 'Library/Formula/couchdb-lucene.rb')
-rw-r--r--Library/Formula/couchdb-lucene.rb12
1 files changed, 6 insertions, 6 deletions
diff --git a/Library/Formula/couchdb-lucene.rb b/Library/Formula/couchdb-lucene.rb
index 7b4d71dd8..c31088ee3 100644
--- a/Library/Formula/couchdb-lucene.rb
+++ b/Library/Formula/couchdb-lucene.rb
@@ -15,16 +15,16 @@ class CouchdbLucene < Formula
system "mv couchdb-lucene-#{version}/* #{prefix}"
(etc + "couchdb/local.d/couchdb-lucene.ini").write ini_file
- (prefix+"couchdb-lucene.plist").write plist_file
- (prefix+"couchdb-lucene.plist").chmod 0644
+ plist_path.write startup_plist
+ plist_path.chmod 0644
end
def caveats; <<-EOS.undent
You can enable couchdb-lucene to automatically load on login with:
mkdir -p ~/Library/LaunchAgents
- cp "#{prefix}/couchdb-lucene.plist" ~/Library/LaunchAgents/
- launchctl load -w ~/Library/LaunchAgents/couchdb-lucene.plist
+ cp "#{plist_path}" ~/Library/LaunchAgents/
+ launchctl load -w ~/Library/LaunchAgents/#{plist_path.basename}
Or start it manually with:
#{bin}/run
@@ -44,7 +44,7 @@ _fti = {couch_httpd_external, handle_external_req, <<"fti">>}
EOS
end
- def plist_file
+ def startup_plist
return <<-EOS
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN"
@@ -52,7 +52,7 @@ EOS
<plist version="1.0">
<dict>
<key>Label</key>
- <string>couchdb-lucene</string>
+ <string>#{plist_name}</string>
<key>EnvironmentVariables</key>
<dict>
<key>HOME</key>