homebrew-core/Formula/phantomjs.rb
Jack Nagel 53473b6bf5 Clean up MacOS version method usage
The MacOS.version? family of methods (other than "leopard?") are poorly
defined and lead to confusing code. Replace them in formulae with more
explicit comparisons.

"MacOS.version" is a special version object that can be compared to
numerics, symbols, and strings using the standard Ruby comparison
methods.

The old methods were moved to compat when the version comparison code
was merged, and they must remain there "forever", but they should not be
used in new code.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-09-10 16:16:54 -05:00

23 lines
495 B
Ruby

require 'formula'
class SnowLeopardOrNewer < Requirement
def satisfied?
MacOS.version >= :snow_leopard
end
def message
"PhantomJS requires Mac OS X 10.6 (Snow Leopard) or newer."
end
end
class Phantomjs < Formula
homepage 'http://www.phantomjs.org/'
url 'http://phantomjs.googlecode.com/files/phantomjs-1.6.1-macosx-static.zip'
sha1 '69a616fa035a815f05e1892e3ff795ef740f568b'
depends_on SnowLeopardOrNewer.new
def install
bin.install 'bin/phantomjs'
end
end