Skip to content

Commit

Permalink
travis ci matrix. default rails version. #472
Browse files Browse the repository at this point in the history
  • Loading branch information
Mark Yoon committed Mar 23, 2014
1 parent 4598c3a commit 826ba66
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 17 deletions.
6 changes: 4 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@ language: ruby
rvm:
- 2.1.1
env:
- DB=postgresql
- "RAILS_VERSION=3.2.0"
- "RAILS_VERSION=4.0.0"
script:
- bundle exec rake db:migrate
- bundle exec rake db:test:prepare
- bundle exec rake spec
- bundle exec rake spec
- bundle exec rake cucumber
34 changes: 19 additions & 15 deletions Gemfile.rails_version
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,23 @@
# separate fragment so that it can be sourced from the test
# application's Gemfile in addition to the main development Gemfile.

if ENV['RAILS_VERSION']
case ENV['RAILS_VERSION']
when /3.2$/
gem 'rails', '~> 3.2.0'
# A JS runtime is required for Rails 3.1+
gem 'therubyracer', '~> 0.10.2'
when /4.0$/
gem 'rails', '~> 4.0.0'
# A JS runtime is required for Rails 4.0+
gem 'therubyracer', platforms: :ruby
else
fail "Unsupported Rails version #{ENV['RAILS_VERSION']}"
end
env_rails_version = ENV["RAILS_VERSION"] || "default"

case env_rails_version
when "master"
{github: "rails/rails"}
when "default"
gem rails, "~> 4.0.0"
# A JS runtime is required for Rails 4.0+
gem 'therubyracer', platforms: :ruby
when /3.2$/
gem rails, "~> #{env_rails_version}"
# A JS runtime is required for Rails 3.1+
gem 'therubyracer', '~> 0.10.2'
when /4.0$/
gem rails, "~> #{env_rails_version}"
# A JS runtime is required for Rails 4.0+
gem 'therubyracer', platforms: :ruby
else
fail "ENV['RAILS_VERSION'] not set"
end
fail "Unsupported Rails version #{ENV['RAILS_VERSION']}"
end

0 comments on commit 826ba66

Please sign in to comment.