lib/vx/builder/script/ruby.rb in vx-builder-0.0.12 vs lib/vx/builder/script/ruby.rb in vx-builder-0.0.13
- old
+ new
@@ -11,12 +11,12 @@
env.cache_key << "rvm-#{rvm env}"
env.before_install.tap do |i|
i << 'eval "$(rbenv init -)" || true'
i << "rbenv shell #{make_rbenv_version_command env}"
- i << "export BUNDLE_GEMFILE=${PWD}/#{gemfile(env)}"
- i << 'export GEM_HOME=$HOME/cached/rubygems'
+ i << trace_sh_command("export BUNDLE_GEMFILE=${PWD}/#{gemfile(env)}")
+ i << trace_sh_command('export GEM_HOME=~/.rubygems')
end
env.announce.tap do |a|
a << trace_sh_command("ruby --version")
a << trace_sh_command("gem --version")
@@ -24,9 +24,13 @@
end
env.install.tap do |i|
i << trace_sh_command("bundle install")
i << trace_sh_command("bundle clean --force")
+ end
+
+ if env.source.cached_directories != false
+ env.cached_directories.push "~/.rubygems"
end
end
app.call(env)
end