2011-01-25 22:39:18 +00:00
|
|
|
require 'formula'
|
|
|
|
|
2012-04-01 20:03:21 +00:00
|
|
|
class NeedsSnowLeopardOrNewer < Requirement
|
|
|
|
def satisfied?
|
|
|
|
MacOS.snow_leopard?
|
|
|
|
end
|
|
|
|
|
|
|
|
def message
|
|
|
|
"PhantomJS requires Mac OS X 10.6 (Snow Leopard) or newer."
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2011-03-10 05:11:03 +00:00
|
|
|
class Phantomjs < Formula
|
2012-04-01 20:03:21 +00:00
|
|
|
url "http://phantomjs.googlecode.com/files/phantomjs-1.5.0-macosx-static.zip"
|
2011-05-23 13:14:55 +00:00
|
|
|
homepage 'http://www.phantomjs.org/'
|
2012-04-01 20:03:21 +00:00
|
|
|
sha1 'b87152ce691e7ed1937d30f86bc706a408d47f64'
|
2011-01-25 22:39:18 +00:00
|
|
|
|
2012-04-01 20:03:21 +00:00
|
|
|
depends_on NeedsSnowLeopardOrNewer.new
|
2011-01-25 22:39:18 +00:00
|
|
|
|
2012-04-03 06:36:47 +00:00
|
|
|
def script; <<-EOS.undent
|
|
|
|
#!/bin/sh
|
|
|
|
# phantomjs wrapper script to hide dock icon
|
|
|
|
# See http://code.google.com/p/phantomjs/issues/detail?id=281
|
|
|
|
exec #{libexec}/phantomjs "$@"
|
|
|
|
EOS
|
2011-01-25 22:39:18 +00:00
|
|
|
end
|
2012-04-01 20:03:21 +00:00
|
|
|
|
2012-04-03 06:36:47 +00:00
|
|
|
def install
|
|
|
|
libexec.install ['bin/phantomjs', 'bin/Info.plist']
|
|
|
|
(bin+'phantomjs').write script
|
2012-04-01 20:03:21 +00:00
|
|
|
end
|
2011-01-25 22:39:18 +00:00
|
|
|
end
|