class Questdb < Formula desc "Time Series Database" homepage "https://www.questdb.org" url "https://www.questdb.org/download/questdb-1.0.2-bin.tar.gz" sha256 "7521d2cf7c61f26181503342b076fe9ea4d2fafa221655d4c35e195cb0c2d3f4" bottle :unneeded depends_on :java => "1.7+" def install rm_rf "questdb.exe" libexec.install Dir["*"] bin.install_symlink "#{libexec}/questdb.sh" => "questdb" end plist_options :manual => "questdb start" def plist; <<-EOS.undent KeepAlive SuccessfulExit Label #{plist_name} ProgramArguments #{opt_bin}/questdb start -d var/"questdb" -n RunAtLoad WorkingDirectory #{var}/questdb StandardErrorPath #{var}/log/questdb.log StandardOutPath #{var}/log/questdb.log SoftResourceLimits NumberOfFiles 1024 EOS end test do mkdir_p testpath/"data" begin fork do exec "#{bin}/questdb start -d #{testpath}/data" end sleep 2 output = shell_output("curl -Is localhost:9000/js?q=x") sleep 1 assert_match /questDB/, output ensure system "#{bin}/questdb", "stop" end end end