2013-09-11 03:31:10 +00:00
|
|
|
require 'formula'
|
|
|
|
|
|
|
|
class Slimerjs < Formula
|
|
|
|
homepage 'http://www.slimerjs.org'
|
2014-01-07 00:57:38 +00:00
|
|
|
url "http://download.slimerjs.org/v0.9/0.9.0/slimerjs-0.9.0.zip"
|
|
|
|
sha1 "c78cf0961eba2421abfdf5c99d28f6fe8dba7cc8"
|
2013-09-17 15:47:24 +00:00
|
|
|
|
|
|
|
head 'https://github.com/laurentj/slimerjs.git'
|
2013-09-11 03:31:10 +00:00
|
|
|
|
2014-01-07 00:57:38 +00:00
|
|
|
if MacOS.version > :snow_leopard
|
|
|
|
option "without-xulrunner", "Build without xulrunner (requires a installed Firefox)"
|
|
|
|
depends_on "xulrunner" => :recommended
|
2013-11-26 13:05:54 +00:00
|
|
|
end
|
|
|
|
|
2013-09-11 03:31:10 +00:00
|
|
|
def install
|
2013-11-26 13:05:54 +00:00
|
|
|
unless build.stable?
|
2014-01-07 00:57:38 +00:00
|
|
|
cd "src"
|
|
|
|
system "zip", "-r", "omni.ja", "chrome/", "components/", "modules/",
|
|
|
|
"defaults/", "chrome.manifest", "-x@package_exclude.lst"
|
2013-09-17 15:47:24 +00:00
|
|
|
end
|
2014-01-07 00:57:38 +00:00
|
|
|
libexec.install ["application.ini", "omni.ja", "slimerjs", "slimerjs.py"]
|
|
|
|
bin.install_symlink libexec/"slimerjs"
|
2013-09-11 03:31:10 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
def caveats; <<-EOS.undent
|
2014-01-07 00:57:38 +00:00
|
|
|
You can set the environment variable SLIMERJSLAUNCHER to a installation of
|
|
|
|
Mozilla Firefox (or Mozilla XULRunner) to use this version with SlimerJS instead
|
|
|
|
of the one installed by Homebrew (this is required if build without xulrunner).
|
2013-09-11 03:31:10 +00:00
|
|
|
For a standard Mozilla Firefox installation this would be:
|
2013-11-26 13:05:54 +00:00
|
|
|
|
2013-09-11 03:31:10 +00:00
|
|
|
export SLIMERJSLAUNCHER=/Applications/Firefox.app/Contents/MacOS/firefox
|
2013-11-26 13:05:54 +00:00
|
|
|
|
|
|
|
Note: If you use SlimerJS with an unstable version of Mozilla Firefox/XULRunner
|
2014-01-07 00:57:38 +00:00
|
|
|
(>27.*) you may have to change the [Gecko]MaxVersion in:
|
2013-11-26 13:05:54 +00:00
|
|
|
#{libexec}/application.ini
|
2013-09-11 03:31:10 +00:00
|
|
|
EOS
|
|
|
|
end
|
2014-01-07 00:57:38 +00:00
|
|
|
|
|
|
|
test do
|
|
|
|
system "#{bin}/slimerjs", "-v"
|
|
|
|
curl "-O", "https://raw.github.com/laurentj/slimerjs/ec1e53a/examples/phantomjs/loadspeed.js"
|
|
|
|
system "#{bin}/slimerjs", "loadspeed.js", "www.google.com"
|
|
|
|
end
|
2013-09-11 03:31:10 +00:00
|
|
|
end
|