2011-07-28 23:15:56 +00:00
|
|
|
require 'formula'
|
|
|
|
|
|
|
|
class SeleniumServerStandalone < Formula
|
2012-04-04 16:06:56 +00:00
|
|
|
url 'http://selenium.googlecode.com/files/selenium-server-standalone-2.20.0.jar'
|
2011-07-28 23:15:56 +00:00
|
|
|
homepage 'http://seleniumhq.org/'
|
2012-04-04 16:06:56 +00:00
|
|
|
sha1 '8d387cdd61e3df9134e59eec6867a0f6a7e1933d'
|
2011-07-28 23:15:56 +00:00
|
|
|
|
|
|
|
def install
|
2012-04-04 16:06:56 +00:00
|
|
|
prefix.install "selenium-server-standalone-#{version}.jar"
|
2011-07-28 23:15:56 +00:00
|
|
|
plist_path.write startup_plist
|
|
|
|
plist_path.chmod 0644
|
|
|
|
end
|
|
|
|
|
|
|
|
def caveats; <<-EOS
|
|
|
|
You can enable selenium-server to automatically load on login with:
|
|
|
|
|
|
|
|
mkdir -p ~/Library/LaunchAgents
|
|
|
|
cp "#{plist_path}" ~/Library/LaunchAgents/
|
|
|
|
launchctl load -w ~/Library/LaunchAgents/#{plist_path.basename}
|
|
|
|
|
2012-02-04 14:57:53 +00:00
|
|
|
If this is an upgrade and you already have the #{plist_path.basename} loaded:
|
2011-07-28 23:15:56 +00:00
|
|
|
launchctl unload -w ~/Library/LaunchAgents/#{plist_path.basename}
|
|
|
|
cp #{plist_path} ~/Library/LaunchAgents/
|
|
|
|
launchctl load -w ~/Library/LaunchAgents/#{plist_path.basename}
|
|
|
|
|
|
|
|
Or start it manually with:
|
2012-04-04 16:06:56 +00:00
|
|
|
java -jar #{prefix}/selenium-server-standalone-#{version}.jar -p 4444
|
2011-07-28 23:15:56 +00:00
|
|
|
EOS
|
|
|
|
end
|
|
|
|
|
|
|
|
def startup_plist
|
|
|
|
return <<-EOS
|
|
|
|
<?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>#{plist_name}</string>
|
|
|
|
<key>RunAtLoad</key>
|
|
|
|
<true/>
|
|
|
|
<key>KeepAlive</key>
|
|
|
|
<false/>
|
|
|
|
<key>ProgramArguments</key>
|
|
|
|
<array>
|
|
|
|
<string>/usr/bin/java</string>
|
|
|
|
<string>-jar</string>
|
2012-04-04 16:06:56 +00:00
|
|
|
<string>#{prefix}/selenium-server-standalone-#{version}.jar</string>
|
2011-07-28 23:15:56 +00:00
|
|
|
<string>-port</string>
|
|
|
|
<string>4444</string>
|
|
|
|
</array>
|
|
|
|
<key>ServiceDescription</key>
|
|
|
|
<string>Selenium Server</string>
|
|
|
|
<key>StandardErrorPath</key>
|
|
|
|
<string>/var/log/selenium/selenium-error.log</string>
|
|
|
|
<key>StandardOutPath</key>
|
|
|
|
<string>/var/log/selenium/selenium-output.log</string>
|
|
|
|
</dict>
|
|
|
|
</plist>
|
|
|
|
EOS
|
|
|
|
end
|
|
|
|
end
|