2012-10-16 03:07:44 +00:00
|
|
|
require 'formula'
|
|
|
|
|
2014-04-17 22:45:37 +00:00
|
|
|
class Ruby19 < Requirement
|
|
|
|
fatal true
|
|
|
|
default_formula 'ruby'
|
|
|
|
|
|
|
|
satisfy :build_env => false do
|
|
|
|
next unless which 'ruby'
|
|
|
|
version = /\d\.\d/.match `ruby --version 2>&1`
|
|
|
|
|
|
|
|
next unless version
|
|
|
|
Version.new(version.to_s) >= Version.new("1.9")
|
|
|
|
end
|
|
|
|
|
|
|
|
def modify_build_environment
|
|
|
|
ruby = which "ruby"
|
|
|
|
return unless ruby
|
|
|
|
|
|
|
|
ENV.prepend_path "PATH", ruby.dirname
|
|
|
|
end
|
|
|
|
|
|
|
|
def message; <<-EOS.undent
|
|
|
|
The Heroku Toolbelt requires Ruby >= 1.9
|
|
|
|
EOS
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2012-10-16 03:07:44 +00:00
|
|
|
class HerokuToolbelt < Formula
|
|
|
|
homepage 'https://toolbelt.heroku.com/other'
|
2014-04-17 22:45:37 +00:00
|
|
|
url 'http://assets.heroku.com.s3.amazonaws.com/heroku-client/heroku-client-3.7.2.tgz'
|
|
|
|
sha1 'c8907404c959e0f23e9fd0cf2adb7e7dfe281c77'
|
|
|
|
|
|
|
|
depends_on Ruby19
|
2012-10-16 03:07:44 +00:00
|
|
|
|
|
|
|
def install
|
|
|
|
libexec.install Dir["*"]
|
2013-08-13 14:09:22 +00:00
|
|
|
bin.write_exec_script libexec/"bin/heroku"
|
2012-10-16 03:07:44 +00:00
|
|
|
end
|
|
|
|
|
2014-02-23 21:31:41 +00:00
|
|
|
test do
|
2012-10-16 03:07:44 +00:00
|
|
|
system "#{bin}/heroku", "version"
|
|
|
|
end
|
2014-02-04 17:36:57 +00:00
|
|
|
|
|
|
|
def caveats; <<-EOS.undent
|
|
|
|
heroku-toolbelt requires an installation of Ruby 1.9 or greater.
|
|
|
|
EOS
|
|
|
|
end
|
2012-10-16 03:07:44 +00:00
|
|
|
end
|