2014-03-07 22:49:36 +00:00
|
|
|
class Ruby19Dependency < Requirement
|
|
|
|
fatal true
|
|
|
|
|
|
|
|
satisfy do
|
2014-09-06 03:29:13 +00:00
|
|
|
ruby = which("ruby")
|
|
|
|
`#{ruby} --version` =~ /ruby (\d\.\d).\d/
|
2014-03-07 22:49:36 +00:00
|
|
|
$1.to_f >= 1.9
|
|
|
|
end
|
|
|
|
|
|
|
|
def message
|
2014-09-06 03:29:13 +00:00
|
|
|
"Selecta requires Ruby 1.9 or greater."
|
2014-03-07 22:49:36 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
class Selecta < Formula
|
|
|
|
homepage "https://github.com/garybernhardt/selecta"
|
2015-01-05 23:16:07 +00:00
|
|
|
url "https://github.com/garybernhardt/selecta/archive/v0.0.6.tar.gz"
|
|
|
|
sha1 "bf8881b2d545847921b1a05d23b88e2037c358e4"
|
2014-03-07 22:49:36 +00:00
|
|
|
|
|
|
|
depends_on Ruby19Dependency
|
|
|
|
|
|
|
|
def install
|
|
|
|
bin.install "selecta"
|
|
|
|
end
|
|
|
|
|
|
|
|
test do
|
|
|
|
system "#{bin}/selecta", "--version"
|
|
|
|
end
|
|
|
|
end
|