Permalink
Browse files

Rework the build to make it more travis-friendly.

  • Loading branch information...
dchelimsky committed Apr 23, 2011
1 parent 7716caf commit 023887f54818ec270ae314f4842422509a6df17c
View
@@ -6,8 +6,7 @@ vendor
*.gem
Gemfile
Gemfile.lock
-gemfiles/*.lock
-gemfiles/bin/*
+*.lock
bin
.rvmrc
*.rbc
View
@@ -3,9 +3,5 @@ rvm:
- 1.8.7
- 1.9.1
- 1.9.2
-gemfile:
- - gemfiles/rails-3.0.6
- - gemfiles/rails-3-0-stable
- - gemfiles/rails-master
env:
- USE_GIT_REPOS=true
@@ -1,10 +1,10 @@
module GemfileBase
def self.extended(host)
host.instance_eval do
- source "http://rubygems.org"
+ source :rubygems
%w[rspec rspec-core rspec-expectations rspec-mocks rspec-rails].each do |lib|
- library_path = File.expand_path("../../../#{lib}", __FILE__)
+ library_path = File.expand_path("../../#{lib}", __FILE__)
if File.exist?(library_path)
gem lib, :path => library_path
elsif ENV["USE_GIT_REPOS"] == 'true'
@@ -24,21 +24,23 @@ def self.extended(host)
gem "ZenTest", "~> 4.4.2"
gem "webrat", "0.7.2"
- if RUBY_PLATFORM =~ /darwin/
- gem "autotest-fsevent", "~> 0.2.4"
- gem "autotest-growl", "~> 0.2.9"
+ platforms :jruby do
+ gem "jruby-openssl"
end
- gem "ruby-debug", :platforms => :ruby_18
- gem "ruby-debug19", "~> 0.11.6", :platforms => :ruby_19
+ unless ENV['TRAVIS']
+ if RUBY_PLATFORM =~ /darwin/
+ gem "autotest-fsevent", "~> 0.2.4"
+ gem "autotest-growl", "~> 0.2.9"
+ end
- platforms :ruby_18, :ruby_19 do
- gem "rb-fsevent", "~> 0.3.9"
- gem "ruby-prof", "~> 0.9.2"
- end
+ gem "ruby-debug", :platforms => :ruby_18
+ gem "ruby-debug19", "~> 0.11.6", :platforms => :ruby_19
- platforms :jruby do
- gem "jruby-openssl"
+ platforms :ruby_18, :ruby_19 do
+ gem "rb-fsevent", "~> 0.3.9"
+ gem "ruby-prof", "~> 0.9.2"
+ end
end
end
end
@@ -1,4 +1,4 @@
-require File.expand_path("../base.rb", __FILE__)
+load File.expand_path("../Gemfile-base", __FILE__)
extend GemfileBase
View
@@ -0,0 +1,5 @@
+load File.expand_path("../Gemfile-base", __FILE__)
+
+extend GemfileBase
+
+gem "rails", "3.0.0"
View
@@ -0,0 +1,5 @@
+load File.expand_path("../Gemfile-base", __FILE__)
+
+extend GemfileBase
+
+gem "rails", "3.0.1"
View
@@ -0,0 +1,5 @@
+load File.expand_path("../Gemfile-base", __FILE__)
+
+extend GemfileBase
+
+gem "rails", "3.0.2"
View
@@ -0,0 +1,5 @@
+load File.expand_path("../Gemfile-base", __FILE__)
+
+extend GemfileBase
+
+gem "rails", "3.0.3"
View
@@ -0,0 +1,5 @@
+load File.expand_path("../Gemfile-base", __FILE__)
+
+extend GemfileBase
+
+gem "rails", "3.0.4"
View
@@ -0,0 +1,5 @@
+load File.expand_path("../Gemfile-base", __FILE__)
+
+extend GemfileBase
+
+gem "rails", "3.0.5"
View
@@ -0,0 +1,5 @@
+load File.expand_path("../Gemfile-base", __FILE__)
+
+extend GemfileBase
+
+gem "rails", "3.0.6"
View
@@ -0,0 +1,5 @@
+load File.expand_path("../Gemfile-base", __FILE__)
+
+extend GemfileBase
+
+gem "rails", "3.0.7"
@@ -1,4 +1,4 @@
-require File.expand_path("../base.rb", __FILE__)
+load File.expand_path("../Gemfile-base", __FILE__)
extend GemfileBase
View
@@ -1,34 +1,6 @@
-unless File.exist?("./.gemfile")
- warn <<-MESSAGE
-=============================================================================
-You must set the version of rails you want to run against. The simplest way
-to accomplish this is to install thor (if you don't already have it) and run:
+ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile-rails-3.0.7", __FILE__)
+# puts "Using gemfile: #{ENV["BUNDLE_GEMFILE"].gsub(Pathname.new(__FILE__).dirname.to_s,'').sub(/^\//,'')}"
- thor rails:use 3.0.6
-
-You can use any of the following versions/branches:
-
- 3.0.0 .. 3.0.6
- master
- 3-0-stable
-
-See the README_DEV.md file for more information.
-=============================================================================
-
-MESSAGE
- exit 1
-end
-
-require 'pathname'
-ENV["BUNDLE_GEMFILE"] ||= begin
- version = if File.exist?("./.gemfile")
- File.read("./.gemfile").chomp
- else
- "rails-3.0.6"
- end
- File.expand_path("../gemfiles/#{version}", __FILE__)
- end
-puts "Using gemfile: #{ENV["BUNDLE_GEMFILE"].gsub(Pathname.new(__FILE__).dirname.to_s,'').sub(/^\//,'')}"
require "bundler"
Bundler.setup
Bundler::GemHelper.install_tasks
@@ -69,6 +41,12 @@ RSpec::Core::RakeTask.new(:spec) do |t|
t.rspec_opts = %w[--color]
end
+desc "Run full build against all supported rubies and railses"
+task :ci do
+ %w[3.0.7 3-0-stable master].each do |v|
+ sh "BUNDLE_GEMFILE=Gemfile-rails-#{v} bundle install && rake"
+ end
+end
namespace :spec do
desc "Run all examples using rcov"
@@ -83,7 +61,7 @@ namespace :generate do
desc "generate a fresh app with rspec installed"
task :app do |t|
unless File.directory?('./tmp/example_app')
- sh "bin/rails new ./tmp/example_app"
+ sh "rails new ./tmp/example_app"
bindir = File.expand_path("gemfiles/bin")
Dir.chdir("./tmp/example_app") do
sh "ln -s #{bindir}"
View
@@ -1,5 +0,0 @@
-require File.expand_path("../base.rb", __FILE__)
-
-extend GemfileBase
-
-gem "rails", "3.0.0"
View
@@ -1,5 +0,0 @@
-require File.expand_path("../base.rb", __FILE__)
-
-extend GemfileBase
-
-gem "rails", "3.0.1"
View
@@ -1,5 +0,0 @@
-require File.expand_path("../base.rb", __FILE__)
-
-extend GemfileBase
-
-gem "rails", "3.0.2"
View
@@ -1,5 +0,0 @@
-require File.expand_path("../base.rb", __FILE__)
-
-extend GemfileBase
-
-gem "rails", "3.0.3"
View
@@ -1,5 +0,0 @@
-require File.expand_path("../base.rb", __FILE__)
-
-extend GemfileBase
-
-gem "rails", "3.0.4"
View
@@ -1,5 +0,0 @@
-require File.expand_path("../base.rb", __FILE__)
-
-extend GemfileBase
-
-gem "rails", "3.0.5"
View
@@ -1,5 +0,0 @@
-require File.expand_path("../base.rb", __FILE__)
-
-extend GemfileBase
-
-gem "rails", "3.0.6"
View
@@ -1,5 +0,0 @@
-require File.expand_path("../base.rb", __FILE__)
-
-extend GemfileBase
-
-gem "rails", "3.0.7"

0 comments on commit 023887f

Please sign in to comment.