class Metabase < Formula desc "Business intelligence report server" homepage "http://www.metabase.com/" url "http://downloads.metabase.com/v0.24.0/metabase.jar" version "0.24.0" sha256 "d177c655bc6526f81fa54edf17fdbdf3dab1811aea05d8d291cdd7fc9aaabacc" head do url "https://github.com/metabase/metabase.git" depends_on "node" => :build depends_on "leiningen" => :build end bottle :unneeded depends_on :java => "1.7+" def install if build.head? ENV.prepend_path "PATH", "#{Formula["node"].opt_libexec}/npm/bin" system "./bin/build" libexec.install "target/uberjar/metabase.jar" else libexec.install "metabase.jar" end bin.write_jar_script libexec/"metabase.jar", "metabase" end plist_options :startup => true, :manual => "metabase" def plist; <<-EOS.undent KeepAlive Label #{plist_name} ProgramArguments #{opt_bin}/metabase RunAtLoad WorkingDirectory #{var}/metabase StandardOutPath #{var}/metabase/server.log StandardErrorPath /dev/null EOS end test do system bin/"metabase", "migrate", "up" end end