Permalink
Browse files

tell travis to use separate gemfiles for rails versions

  • Loading branch information...
1 parent 2e633df commit 6df8afebc3f6d1d44458c7968b801961f34db361 @mjankowski mjankowski committed Apr 4, 2012
Showing with 43 additions and 37 deletions.
  1. +8 −0 .travis.yml
  2. +4 −14 Appraisals
  3. +10 −23 Rakefile
  4. +7 −0 gemfiles/rails-3.0.12.gemfile
  5. +7 −0 gemfiles/rails-3.1.4.gemfile
  6. +7 −0 gemfiles/rails-3.2.3.gemfile
View
@@ -0,0 +1,8 @@
+language: ruby
+rvm:
+ - 1.9.2
+ - 1.9.3
+gemfile:
+ - gemfiles/3.0.12.gemfile
+ - gemfiles/3.1.4.gemfile
+ - gemfiles/3.2.3.gemfile
View
@@ -1,15 +1,5 @@
-appraise "3.1.4" do
- gem "rails", "3.1.4"
- gem 'sass-rails'
- gem 'coffee-script'
- gem 'uglifier'
- gem 'jquery-rails'
-end
-
-appraise "3.0.12" do
- gem "rails", "3.0.12"
-end
-
-appraise "3.2.3" do
- gem "rails", "3.2.3"
+['3.2.3', '3.1.4', '3.0.12'].each do |rails_version|
+ appraise "rails-#{rails_version}" do
+ gem "rails", rails_version
+ end
end
View
@@ -1,31 +1,18 @@
-# encoding: UTF-8
-require 'rubygems'
-begin
- require 'bundler/setup'
-rescue LoadError
- puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
-end
-
-require 'rake'
-require 'rdoc/task'
+require 'bundler/setup'
+require 'bundler/gem_tasks'
require 'appraisal'
-require 'rspec/core'
require 'rspec/core/rake_task'
RSpec::Core::RakeTask.new(:spec)
-desc "Default: run the unit tests."
-task :default => [:all]
-
-desc 'Test the plugin under all supported Rails versions.'
-task :all => ["appraisal:install"] do |t|
- exec('rake appraisal spec')
+task :default do |t|
+ if ENV['BUNDLE_GEMFILE'] =~ /gemfiles/
+ exec 'rake spec'
+ else
+ Rake::Task['appraise'].execute
+ end
end
-desc 'Generate documentation for the paul revere plugin.'
-RDoc::Task.new(:rdoc) do |rdoc|
- rdoc.rdoc_dir = 'rdoc'
- rdoc.title = 'PaulRevere'
- rdoc.options << '--line-numbers' << '--inline-source'
- rdoc.rdoc_files.include('lib/**/*.rb')
+task :appraise => ['appraisal:install'] do |t|
+ exec 'rake appraisal'
end
@@ -0,0 +1,7 @@
+# This file was generated by Appraisal
+
+source "http://rubygems.org"
+
+gem "rails", "3.0.12"
+
+gemspec :path=>"../"
@@ -0,0 +1,7 @@
+# This file was generated by Appraisal
+
+source "http://rubygems.org"
+
+gem "rails", "3.1.4"
+
+gemspec :path=>"../"
@@ -0,0 +1,7 @@
+# This file was generated by Appraisal
+
+source "http://rubygems.org"
+
+gem "rails", "3.2.3"
+
+gemspec :path=>"../"

0 comments on commit 6df8afe

Please sign in to comment.