Skip to content

Commit

Permalink
RUBY_ENGINE is undefined under MRI 1.8.7
Browse files Browse the repository at this point in the history
  • Loading branch information
rtomayko committed Sep 15, 2011
1 parent c0e076b commit f429a32
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,23 @@ task :default => [:setup, :test]
# set GEM_HOME to use local ./vendor dir for tests
vendor_dir = './vendor'
ruby_version = RbConfig::CONFIG['ruby_version']
gem_home = ENV['GEM_HOME'] = "#{vendor_dir}/#{RUBY_ENGINE}/#{ruby_version}"
ruby_engine = (defined?(RUBY_ENGINE) && RUBY_ENGINE) || 'ruby'
gem_home = ENV['GEM_HOME'] = "#{vendor_dir}/#{ruby_engine}/#{ruby_version}"

# Write the current version.
task :version do
puts "#{RUBY_ENGINE} #{RUBY_VERSION} (#{gem_home})"
puts "#{ruby_engine} #{RUBY_VERSION} (#{gem_home})"
end

desc "Install gems to #{ENV['GEM_HOME']}"
task :setup do
sh "
bundle check >/dev/null || {
echo 'Updating #{gem_home}' &&
bundle install --path='#{vendor_dir}'; }
", :verbose => false
verbose false do
sh "
bundle check >/dev/null || {
echo 'Updating #{gem_home}' &&
bundle install --path='#{vendor_dir}'; }
"
end
end

# SPECS =====================================================================
Expand Down

0 comments on commit f429a32

Please sign in to comment.