Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Refine installation and rspec running of various rubies under rvm.

  • Loading branch information...
commit af5b33408580dedbe56f93f91c00cbb5943607f7 1 parent 6b614ab
@jgarber jgarber authored
Showing with 43 additions and 7 deletions.
  1. +43 −7 tasks/rvm.rake
View
50 tasks/rvm.rake
@@ -1,6 +1,6 @@
namespace :rvm do
- RVM_RUBIES = ['jruby-1.5.3', 'ruby-1.8.6-p398', 'ruby-1.9.1-p243', 'ruby-1.9.2-head', 'ree-1.8.7']
+ RVM_RUBIES = ['jruby-1.5.3', 'ruby-1.8.6-p398', 'ruby-1.9.1-p243', 'ruby-1.9.2-head', 'ree-1.8.7-2010.02']
RVM_GEMSET_NAME = 'redcloth'
task :setup do
@@ -13,16 +13,51 @@ namespace :rvm do
end
end
- desc "Install development gems using bundler to each rubie version"
- task :bundle => :setup do
- rvm_each_rubie { RVM.run 'gem install bundler; bundle install' }
- end
-
desc "Runs specs under each rvm ruby"
task :spec => :setup do
- sh "rvm #{rvm_rubies.join(',')} rake"
+ puts rvm_rubies.join(',')
+ rvm_each_rubie do
+ # Make sure all dependencies are installed but ignore Gemfile.lock. It
+ # gets confused when locked to java and running ruby and vice-versa.
+ STDERR << RVM.run('bundle update').stderr
+
+ result = RVM.perform_set_operation(:rake)
+ STDOUT << result.stdout
+ STDERR << result.stderr
+ end
+ end
+
+ desc "Show rubies"
+ task :rubies => :setup do
+ puts rvm_rubies.join(",")
end
+ namespace :install do
+ task :rubies => :setup do
+ installed_rubies = RVM.list_strings
+ RVM_RUBIES.each do |rubie|
+ if installed_rubies.include?(rubie)
+ puts "info: Rubie #{rubie} already installed."
+ else
+ good_msg = "info: Rubie #{rubie} installed."
+ bad_msg = "Failed #{rubie} install! Check RVM logs here: #{RVM.path}/log/#{rubie}"
+ puts "info: Rubie #{rubie} installation inprogress. This could take awhile..."
+ if RVM.install(rubie,{})
+ puts(good_msg)
+ RVM.use(rubie)
+ RVM.perform_set_operation(:gem, 'install', 'bundler')
+ RVM.reset_current!
+ else
+ abort(bad_msg)
+ end
+ end
+ end
+ end
+ end
+
+ task :remove => :setup do
+ rvm_rubies.each { |rubie| RVM.remove(rubie) }
+ end
end
@@ -31,6 +66,7 @@ end
def rvm_each_rubie
rvm_rubies.each do |rubie|
RVM.use(rubie)
+ puts "Using #{rubie}"
yield
end
ensure
Please sign in to comment.
Something went wrong with that request. Please try again.