Merge pull request #10549 from mikemcquaid/brew-cask-ruby20
brew-cask: depend on Ruby 2.0.
This commit is contained in:
commit
554f705876
23
brew-cask.rb
23
brew-cask.rb
|
@ -7,6 +7,27 @@ rescue
|
|||
HBC_VERSION = HOMEBREW_CASK_VERSION
|
||||
end
|
||||
|
||||
class Ruby20 < 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("2.0")
|
||||
end
|
||||
|
||||
env do
|
||||
ENV.prepend_path "PATH", which("ruby").dirname
|
||||
end
|
||||
|
||||
def message; <<-EOS.undent
|
||||
brew-cask needs Ruby >=2.0
|
||||
EOS
|
||||
end
|
||||
end
|
||||
|
||||
class BrewCask < Formula
|
||||
homepage "https://github.com/caskroom/homebrew-cask/"
|
||||
url "https://github.com/caskroom/homebrew-cask.git", :tag => "v#{HBC_VERSION}"
|
||||
|
@ -14,6 +35,8 @@ class BrewCask < Formula
|
|||
|
||||
skip_clean "bin"
|
||||
|
||||
depends_on Ruby20
|
||||
|
||||
def install
|
||||
man1.install "doc/man/brew-cask.1"
|
||||
prefix.install "lib" => "rubylib"
|
||||
|
|
Loading…
Reference in New Issue