class Metabase < Formula desc "Business intelligence report server" homepage "https://www.metabase.com/" url "https://downloads.metabase.com/v0.30.4/metabase.jar" sha256 "9a79d17d93753296c7933ddf47f0142672072349584a8d9b6f1ca37476a17e57" head do url "https://github.com/metabase/metabase.git" depends_on "leiningen" => :build depends_on "node" => :build depends_on "yarn" => :build end bottle :unneeded depends_on :java => "1.8" def install if build.head? system "./bin/build" libexec.install "target/uberjar/metabase.jar" else libexec.install "metabase.jar" end (bin/"metabase").write <<~EOS #!/bin/bash export JAVA_HOME="$(#{Language::Java.java_home_cmd("1.8")})" exec java -jar "#{libexec}/metabase.jar" "$@" EOS end plist_options :startup => true, :manual => "metabase" def plist; <<~EOS 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