lib/vx/builder/script/ruby.rb in vx-builder-0.0.10 vs lib/vx/builder/script/ruby.rb in vx-builder-0.0.11
- old
+ new
@@ -11,11 +11,11 @@
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'
+ i << "export BUNDLE_GEMFILE=${PWD}/#{gemfile(env)}"
i << 'export GEM_HOME=$HOME/cached/rubygems'
end
env.announce.tap do |a|
a << trace_sh_command("ruby --version")
@@ -34,9 +34,18 @@
private
def rvm(env)
env.source.rvm.first
+ end
+
+ def gemfile(env)
+ if env.source.gemfile
+ env.source.gemfile.first
+ else
+ env.source.gemfile = ["Gemfile"]
+ gemfile(env)
+ end
end
def make_rbenv_version_command(env)
select_rbenv_version(env)
end