From 4a268f1d558a8b8be58f73a3ccb90a89d9364034 Mon Sep 17 00:00:00 2001 From: st0012 Date: Sat, 8 Aug 2020 15:27:35 +0800 Subject: [PATCH 1/3] Specify some gems' versions to speed up dependency resolution --- Gemfile | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Gemfile b/Gemfile index 803e4f737..b62bdb26c 100644 --- a/Gemfile +++ b/Gemfile @@ -3,28 +3,28 @@ source "https://rubygems.org/" gemspec if ENV["RAILS_VERSION"] && (ENV["RAILS_VERSION"].to_i == 4) - gem "rails", "< 5" - gem "rspec-rails", "> 3" + gem "rails", "~> 4.2" + gem "rspec-rails", "~> 4.0" elsif ENV["RAILS_VERSION"] && (ENV["RAILS_VERSION"].to_i == 0) # no-op. No Rails. else - gem "rails", "< 6" - gem "rspec-rails", "> 3" + gem "rails", "~> 5.2" + gem "rspec-rails", "~> 4.0" end +gem "sidekiq" + gem "rack" gem "rack-timeout" -gem "sidekiq" - gem "pry" gem "benchmark-ips" gem "benchmark-ipsa" gem "ruby-prof", platform: :mri gem "rake", "> 12" gem "rubocop", "~> 0.41.1" # Last version that supported 1.9, upgrade to 0.50 after we drop 1.9 -gem "rspec", "> 3" -gem "capybara" # rspec system tests +gem "rspec", "~> 3.9.0" +gem "capybara", "~> 3.15.0" # rspec system tests gem "puma" # rspec system tests gem "timecop" From c7303464b312439cb445d8af239b614a56f3c96e Mon Sep 17 00:00:00 2001 From: st0012 Date: Sat, 8 Aug 2020 16:58:32 +0800 Subject: [PATCH 2/3] Exclude the combination of Rails 4 and Ruby 2.7 --- .travis.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.travis.yml b/.travis.yml index 1cfa53e73..a95216efa 100644 --- a/.travis.yml +++ b/.travis.yml @@ -41,6 +41,9 @@ matrix: env: RUBYOPT="--enable-frozen-string-literal --debug=frozen-string-literal" - rvm: ruby-head env: RAILS_VERSION=0 + exclude: + - rvm: 2.7 + env: RAILS_VERSION=4 allow_failures: - rvm: ruby-head From 95af9646e638ec0bcebdbf5b55d1067fded2e255 Mon Sep 17 00:00:00 2001 From: st0012 Date: Sat, 8 Aug 2020 16:12:59 +0800 Subject: [PATCH 3/3] Make sure we still use bundler 1.17 in Ruby 2.7 --- .travis.yml | 6 ++++-- cleanup_bundler | 10 ++++++++++ 2 files changed, 14 insertions(+), 2 deletions(-) create mode 100755 cleanup_bundler diff --git a/.travis.yml b/.travis.yml index a95216efa..f18505bc8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -28,8 +28,10 @@ addons: before_install: - service haveged start - # Pin bundler version due to https://github.com/rubygems/rubygems/issues/2055 - - gem install bundler -v 1.16.0 + # Ruby 2.7 adds default bundler with 2.0+ version + # This script removes the default bundler so we can install the version we want + - ./cleanup_bundler + - gem install bundler -v '1.17' matrix: include: diff --git a/cleanup_bundler b/cleanup_bundler new file mode 100755 index 000000000..c3e5f1a28 --- /dev/null +++ b/cleanup_bundler @@ -0,0 +1,10 @@ +#!/usr/bin/env ruby + +gempaths = `gem env gempath`.split(":") + +gempaths.each do |gempath| + # lookup bundler-*.gemspec files and delete them + # this is the only way to completely cleanup default bundler + # Note: the bundler gemspecs' paths are different for CRuby and JRuby + Dir.glob(gempath.strip + "/specifications/**/bundler-*.gemspec").each { |p| File.delete(p) } +end