diff --git a/Library/Formula/heroku-toolbelt.rb b/Library/Formula/heroku-toolbelt.rb index 17c5cb46bfe0..16520a69a1d0 100644 --- a/Library/Formula/heroku-toolbelt.rb +++ b/Library/Formula/heroku-toolbelt.rb @@ -1,9 +1,32 @@ +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 + + env do + ENV.prepend_path "PATH", which("ruby").dirname + end + + def message; <<-EOS.undent + The Heroku Toolbelt needs Ruby >=1.9 + EOS + end +end + class HerokuToolbelt < Formula homepage "https://toolbelt.heroku.com/other" - url "https://s3.amazonaws.com/assets.heroku.com/heroku-client/heroku-client-3.30.4.tgz" - sha256 "51a92e85994c65d016823ad7b8fa74bf30ddeb59afb33751c1f93e8105c80e9e" + url "https://s3.amazonaws.com/assets.heroku.com/heroku-client/heroku-client-3.31.2.tgz" + sha256 "8e859fc1f95508ddfb4684f752ced4c2876aa94839830619ec659f83d72050fd" head "https://github.com/heroku/heroku.git" + depends_on Ruby19 + def install libexec.install Dir["*"] bin.write_exec_script libexec/"bin/heroku"