handle vendored/nonvendored ruby and reset env vars

Fixes #2107
This commit is contained in:
Joao Duarte 2014-11-26 19:14:33 +00:00 committed by Jordan Sissel
parent eff219a003
commit eb8d54ee3a

View file

@ -12,10 +12,20 @@ namespace "plugin" do
end # task "install"
task "install-defaults" do
gem_path = ENV['GEM_PATH']
gem_home = ENV['GEM_HOME']
env = {
"GEM_PATH" => "#{ENV['GEM_PATH']}:vendor/bundle/jruby/1.9",
"GEM_HOME" => "vendor/plugins/jruby/1.9"
}
system(env, "bundle install")
if ENV['USE_RUBY'] != '1'
jruby = File.join("vendor", "jruby", "bin", "jruby")
bundle = File.join("build", "bootstrap", "bin", "bundle")
system(env, jruby, "-S", bundle, "install")
else
system(env, "bundle", "install")
end
ENV['GEM_PATH'] = gem_path
ENV['GEM_HOME'] = gem_home
end
end # namespace "plugin"