diff options
| author | Chris Dillon | 2015-03-30 16:07:36 -0700 |
|---|---|---|
| committer | Xu Cheng | 2015-04-09 20:25:59 +0800 |
| commit | 761cef832ed215d30758181616a2a2e771f23f9d (patch) | |
| tree | e5261e341fb7b88be253d75c382501d2b41f687e /Library | |
| parent | 3d7f703e702f6e71202df5070477f3fa6cb0f520 (diff) | |
| download | homebrew-761cef832ed215d30758181616a2a2e771f23f9d.tar.bz2 | |
riemann: modernize, add plist and test
Closes #38276.
Signed-off-by: Xu Cheng <xucheng@me.com>
Diffstat (limited to 'Library')
| -rw-r--r-- | Library/Formula/riemann.rb | 48 |
1 files changed, 36 insertions, 12 deletions
diff --git a/Library/Formula/riemann.rb b/Library/Formula/riemann.rb index d47205866..089938e57 100644 --- a/Library/Formula/riemann.rb +++ b/Library/Formula/riemann.rb @@ -1,9 +1,7 @@ -require 'formula' - class Riemann < Formula - homepage 'http://riemann.io' - url 'http://aphyr.com/riemann/riemann-0.2.8.tar.bz2' - sha1 'f77769345691f7276a58feb6be4ba3857753cf86' + homepage "http://riemann.io" + url "http://aphyr.com/riemann/riemann-0.2.8.tar.bz2" + sha256 "f5bb666acb878e144471f8c6d7f622193840d127aea96924fd8575e1fb6c57dc" def shim_script <<-EOS.undent @@ -19,16 +17,12 @@ class Riemann < Formula end def install - if (etc/'riemann.config').exist? - (prefix/'etc').install 'etc/riemann.config' => 'riemann.config.guide' - else - etc.install 'etc/riemann.config' - end + etc.install "etc/riemann.config" => "riemann.config.guide" # Install jars in libexec to avoid conflicts - libexec.install Dir['*'] + libexec.install Dir["*"] - (bin+'riemann').write shim_script + (bin+"riemann").write shim_script end def caveats; <<-EOS.undent @@ -38,4 +32,34 @@ class Riemann < Formula riemann-dash EOS end + + def plist; <<-EOS.undent + <?xml version="1.0" encoding="UTF-8"?> + <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" + "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> + <plist version="1.0"> + <dict> + <key>KeepAlive</key> + <true/> + <key>Label</key> + <string>#{plist_name}</string> + <key>ProgramArguments</key> + <array> + <string>#{opt_bin}/riemann</string> + <string>#{etc}/riemann.config</string> + </array> + <key>RunAtLoad</key> + <true/> + <key>StandardErrorPath</key> + <string>#{var}/log/riemann.log</string> + <key>StandardOutPath</key> + <string>#{var}/log/riemann.log</string> + </dict> + </plist> + EOS + end + + test do + system "#{bin}/riemann", "-help", "0" + end end |
