a3b97d8729
Closes Homebrew/homebrew#38841. Signed-off-by: Xu Cheng <xucheng@me.com>
46 lines
1.3 KiB
Ruby
46 lines
1.3 KiB
Ruby
class Chromedriver < Formula
|
|
homepage "https://sites.google.com/a/chromium.org/chromedriver/"
|
|
url "https://chromedriver.storage.googleapis.com/2.15/chromedriver_mac32.zip"
|
|
sha256 "37f7ed1cb1bbafd2139486f44c81ebe0b1561c594d2ad2004bd66c3b07453427"
|
|
version "2.15"
|
|
|
|
def install
|
|
bin.install "chromedriver"
|
|
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>Label</key>
|
|
<string>homebrew.mxcl.chromedriver</string>
|
|
<key>RunAtLoad</key>
|
|
<true/>
|
|
<key>KeepAlive</key>
|
|
<false/>
|
|
<key>ProgramArguments</key>
|
|
<array>
|
|
<string>#{opt_bin}/chromedriver</string>
|
|
</array>
|
|
<key>ServiceDescription</key>
|
|
<string>Chrome Driver</string>
|
|
<key>StandardErrorPath</key>
|
|
<string>#{var}/log/chromedriver-error.log</string>
|
|
<key>StandardOutPath</key>
|
|
<string>#{var}/log/chromedriver-output.log</string>
|
|
</dict>
|
|
</plist>
|
|
EOS
|
|
end
|
|
|
|
test do
|
|
driver = fork do
|
|
system bin/"chromedriver",
|
|
"--port=9999", "--log-path=#{testpath}/cd.log"
|
|
end
|
|
sleep 5
|
|
Process.kill("TERM", driver)
|
|
File.exist? testpath/"cd.log"
|
|
end
|
|
end
|