RubyRequirement: check all available ruby
Closes Homebrew/homebrew#47605. Signed-off-by: Xu Cheng <xucheng@me.com>
This commit is contained in:
parent
17a57f529b
commit
15fe924484
@ -9,14 +9,11 @@ class RubyRequirement < Requirement
|
|||||||
end
|
end
|
||||||
|
|
||||||
satisfy :build_env => false do
|
satisfy :build_env => false do
|
||||||
next unless which "ruby"
|
which_all("ruby").detect do |ruby|
|
||||||
version = /\d\.\d/.match Utils.popen_read("ruby", "--version")
|
version = /\d\.\d/.match Utils.popen_read(ruby, "--version")
|
||||||
next unless version
|
next unless version
|
||||||
Version.new(version.to_s) >= Version.new(@version)
|
Version.new(version.to_s) >= Version.new(@version)
|
||||||
end
|
end
|
||||||
|
|
||||||
env do
|
|
||||||
ENV.prepend_path "PATH", which("ruby").dirname
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def message
|
def message
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user