From 235bac327efd8ad1e6a1c4890bc82b4a357fc095 Mon Sep 17 00:00:00 2001 From: Jun Aruga Date: Fri, 21 Apr 2017 17:45:43 +0200 Subject: [PATCH] Update .travis.yml * Update Rubies to latest version. * Add ruby-head as allow_failures. * It's good to know new version Ruby's issue as faster before the release. * fast_finish is to get the Travis result as faster without waiting the result of the "allow_failures" items. See https://blog.travis-ci.com/2013-11-27-fast-finishing-builds/ * Do hack for Ruby 1.9.3 and 2.0.0. Because the Rails 4.2 dependency's nokogiri latest version requires Ruby version >= 2.1.0. --- .travis.yml | 14 ++++++++++---- lib/spring/test/application_generator.rb | 5 +++++ 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 7bdf961e..82a53bd7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,9 +4,11 @@ sudo: false rvm: - 1.9.3 # when removed, get rid of the before_script hack and also the one in application_generator.rb - 2.0.0 - - 2.1.9 - - 2.2.5 - - 2.3.1 + - 2.1.10 + - 2.2.7 + - 2.3.4 + - 2.4.1 + - ruby-head env: - RAILS_VERSION="~> 4.2.0" - RAILS_VERSION="~> 5.0.0" @@ -16,8 +18,12 @@ matrix: env: RAILS_VERSION="~> 5.0.0" - rvm: 2.0.0 env: RAILS_VERSION="~> 5.0.0" - - rvm: 2.1.9 + - rvm: 2.1.10 env: RAILS_VERSION="~> 5.0.0" + allow_failures: + - rvm: ruby-head + fast_finish: true before_script: - "[ $TRAVIS_RUBY_VERSION = \"1.9.3\" ] && travis_retry gem install mime-types --version \"~> 2\" || true" + - "[ $TRAVIS_RUBY_VERSION = \"1.9.3\" -o $TRAVIS_RUBY_VERSION = \"2.0.0\" ] && travis_retry gem install nokogiri --version \"~> 1.6.8\" || true" - travis_retry gem install rails --version "$RAILS_VERSION" diff --git a/lib/spring/test/application_generator.rb b/lib/spring/test/application_generator.rb index aebdc060..5f698de1 100644 --- a/lib/spring/test/application_generator.rb +++ b/lib/spring/test/application_generator.rb @@ -92,6 +92,11 @@ def install_spring build_and_install_gems + # TO prevent nokogiri install error in application.bundle. + if RUBY_VERSION < "2.1.0" + append_to_file(application.gemfile, "gem 'nokogiri', '~> 1.6.8'") + end + application.bundle FileUtils.rm_rf application.path("bin")