diff --git a/Formula/webdis.rb b/Formula/webdis.rb index 967851a415..91a1ef2cae 100644 --- a/Formula/webdis.rb +++ b/Formula/webdis.rb @@ -18,7 +18,11 @@ class Webdis < Formula system "make" bin.install "webdis" - inreplace "webdis.prod.json", "/var/log/webdis.log", "#{var}/log/webdis.log" + inreplace "webdis.prod.json" do |s| + s.gsub! "/var/log/webdis.log", "#{var}/log/webdis.log" + s.gsub! /daemonize":\s*true/, "daemonize\":\tfalse" + end + etc.install "webdis.json", "webdis.prod.json" end @@ -26,6 +30,34 @@ class Webdis < Formula (var/"log").mkpath end + plist_options :manual => "webdis #{HOMEBREW_PREFIX}/etc/webdis.json" + + def plist; <<-EOS.undent + + + + + Label + #{plist_name} + ProgramArguments + + #{opt_bin}/webdis + #{etc}/webdis.prod.json + + RunAtLoad + + KeepAlive + + SuccessfulExit + + + WorkingDirectory + #{var} + + + EOS + end + test do begin server = fork do