Skip to content
Browse files

Change rvm task to use rbenv

  • Loading branch information...
1 parent 077605a commit 83dfe5e553204f05e43b1a9722817b29106af2d9 @hawx committed
Showing with 13 additions and 26 deletions.
  1. +3 −1 Gemfile
  2. +10 −25 Rakefile
View
4 Gemfile
@@ -1,3 +1,5 @@
source "http://rubygems.org"
-gemspec
+gemspec
+
+gem 'rake'
View
35 Rakefile
@@ -5,30 +5,15 @@ require 'rspec/core/rake_task'
RSpec::Core::RakeTask.new(:spec)
task :default => :spec
-namespace(:spec) do
- desc "Run all specs on multiple ruby versions (requires rvm)"
- task(:portability) do
- %w[1.8.7 1.9.2].each do |version|
- system <<-BASH
- bash -c 'source ~/.rvm/scripts/rvm;
- rvm #{version};
- echo "--------- version #{version} ----------\n";
- bundle install;
- rake spec:prepare_fixtures
- rake spec'
- BASH
+namespace(:spec) do
+ desc 'Run tests on all versions of ruby (requires rbenv)'
+ task :all do
+ `rbenv versions --bare`.split("\n").each do |vers|
+ run_for vers, ['bundle install', 'bundle exec rake']
end
end
-
- desc "Run bundle install on each fixtures directories with Gemfile"
- task(:prepare_fixtures) do
- Dir.foreach("spec/fixtures") do |dir|
- if File.exists?("spec/fixtures/#{dir}/Gemfile")
- system <<-BASH
- cd spec/fixtures/#{dir};
- bundle install
- BASH
- end
- end
- end
-end
+end
+
+def run_for(vers, commands)
+ system "RBENV_VERSION='#{vers}' sh -c '#{commands.map {|i| "rbenv exec #{i}"}.join(' && ')}'"
+end

0 comments on commit 83dfe5e

Please sign in to comment.
Something went wrong with that request. Please try again.