lib/vx/builder/script/ruby.rb in vx-builder-0.0.18 vs lib/vx/builder/script/ruby.rb in vx-builder-0.0.19

- old
+ new

@@ -12,11 +12,10 @@ if enabled?(env) env.cache_key << "rvm-#{ruby env}" env.cache_key << gemfile(env) env.before_install.tap do |i| - i << "source /etc/profile.d/rbenv.sh" i << 'eval "$(rbenv init -)" || true' i << "rbenv shell #{make_rbenv_version_command env}" i << trace_sh_command("export BUNDLE_GEMFILE=${PWD}/#{gemfile(env)}") i << trace_sh_command('export GEM_HOME=~/.rubygems') end @@ -28,9 +27,14 @@ end env.install.tap do |i| i << trace_sh_command("bundle install") i << trace_sh_command("bundle clean --force") + end + + if env.source.script.empty? + script = "test -f Rakefile && #{trace_sh_command "bundle exec rake"} || true" + env.script << script end if env.source.cached_directories != false env.cached_directories.push "~/.rubygems" end