aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula/phantomjs.rb
blob: 648fad9d1a9faa59360b8e3b67b649a7c5b42531 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
require 'formula'

class NeedsSnowLeopardOrNewer < Requirement
  def satisfied?
    MacOS.snow_leopard?
  end

  def message
    "PhantomJS requires Mac OS X 10.6 (Snow Leopard) or newer."
  end
end

class Phantomjs < Formula
  url "http://phantomjs.googlecode.com/files/phantomjs-1.5.0-macosx-static.zip"
  homepage 'http://www.phantomjs.org/'
  sha1 'b87152ce691e7ed1937d30f86bc706a408d47f64'

  depends_on NeedsSnowLeopardOrNewer.new

  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
  end

  def install
    libexec.install ['bin/phantomjs', 'bin/Info.plist']
    (bin+'phantomjs').write script
  end
end