Use the env block

This commit is contained in:
Kimmo Lehto 2017-02-21 11:24:53 +02:00
parent 799da6dbe8
commit df7ae5eb26
No known key found for this signature in database
GPG Key ID: C70E4A4124AEF5EC

View File

@ -8,11 +8,10 @@ class RubyRequirement < Requirement
super
end
satisfy build_env: false do
found_ruby = rubies.detect { |ruby| suitable?(ruby) }
return unless found_ruby
ENV.prepend_path "PATH", found_ruby.dirname
found_ruby
satisfy build_env: false { suitable_ruby }
env do
ENV.prepend_path "PATH", suitable_ruby
end
def message
@ -35,6 +34,10 @@ class RubyRequirement < Requirement
private
def suitable_ruby
rubies.detect { |ruby| suitable?(ruby) }
end
def rubies
rubies = which_all("ruby")
if ruby_formula.installed?