From 8d2b95cf51b1caaac03b1fc6b825158e8138fff3 Mon Sep 17 00:00:00 2001 From: Benoit Tigeot Date: Sun, 15 Jul 2018 11:59:47 +0200 Subject: [PATCH 1/8] Change minimum Ruby version for Puma to 2.2 Puma now require Ruby 2.2 minmum https://github.com/puma/puma/pull/1506/files --- Gemfile-rails-dependencies | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Gemfile-rails-dependencies b/Gemfile-rails-dependencies index b6ffd397d9..3eb2f2f759 100644 --- a/Gemfile-rails-dependencies +++ b/Gemfile-rails-dependencies @@ -13,14 +13,14 @@ when /master/ gem 'i18n', :git => 'git://github.com/svenfuchs/i18n.git', :branch => 'master' gem 'sprockets', :git => 'git://github.com/rails/sprockets.git', :branch => 'master' gem 'sprockets-rails', :git => 'git://github.com/rails/sprockets-rails.git', :branch => 'master' - if RUBY_VERSION >= "1.9.3" + if RUBY_VERSION >= "2.2" gem 'puma', :git => 'git://github.com/puma/puma', :branch => 'master' end when /stable$/ gem_list = %w[rails railties actionmailer actionpack activerecord activesupport] gem_list << 'activejob' if version > '4-1-stable' gem_list << 'actionview' if version > '4-0-stable' - if RUBY_VERSION >= "1.9.3" + if RUBY_VERSION >= "2.2" gem_list << 'puma' if version > '5-0-stable' end @@ -40,7 +40,7 @@ when nil, false, "" else gem "rails", version - if version >= '5-1-stable' && RUBY_VERSION >= "1.9.3" + if version >= '5-1-stable' && RUBY_VERSION >= "2.2" gem "puma" end end From 0d4547bb1b62f2e7c30b60067b3b8445c2dd7b89 Mon Sep 17 00:00:00 2001 From: Benoit Tigeot Date: Sun, 15 Jul 2018 13:06:07 +0200 Subject: [PATCH 2/8] Specify rdoc version when Ruby version is under 2.2 Because of https://github.com/ruby/rdoc/commit/51b03c357457183e94a6b26d71630f183afbc6b0 --- Gemfile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Gemfile b/Gemfile index 267c6b3a0a..afcaa4c952 100644 --- a/Gemfile +++ b/Gemfile @@ -24,6 +24,11 @@ end gem 'sqlite3', '~> 1.3.6' +# Version 6.0.4 of rdoc requires Ruby 2.2 +if RUBY_VERSION < '2.2' + gem 'rdoc', '< 6.0.4' +end + if RUBY_VERSION >= '2.4.0' gem 'json', '>= 2.0.2' end @@ -44,7 +49,6 @@ if RUBY_VERSION < '2.0.0' gem 'mime-types', '< 3' end - # Capybara versions that support RSpec 3 only support RUBY_VERSION >= 1.9.3 if RUBY_VERSION >= '1.9.3' if /5(\.|-)[1-9]\d*/ === RAILS_VERSION || "master" == RAILS_VERSION From 1a4788572267c38d3c69cab7f78f035dc9acbf0d Mon Sep 17 00:00:00 2001 From: Benoit Tigeot Date: Wed, 18 Jul 2018 09:04:12 +0200 Subject: [PATCH 3/8] Use generated Gemfile to store rdoc specific requirement for Ruby 2.2 --- Gemfile | 5 ----- example_app_generator/generate_app.rb | 5 +++++ 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Gemfile b/Gemfile index afcaa4c952..5d19da734e 100644 --- a/Gemfile +++ b/Gemfile @@ -24,11 +24,6 @@ end gem 'sqlite3', '~> 1.3.6' -# Version 6.0.4 of rdoc requires Ruby 2.2 -if RUBY_VERSION < '2.2' - gem 'rdoc', '< 6.0.4' -end - if RUBY_VERSION >= '2.4.0' gem 'json', '>= 2.0.2' end diff --git a/example_app_generator/generate_app.rb b/example_app_generator/generate_app.rb index 6841db7695..8e04b86664 100644 --- a/example_app_generator/generate_app.rb +++ b/example_app_generator/generate_app.rb @@ -57,6 +57,11 @@ | gem 'mime-types', '< 3' |end | + |# Version 6.0.4 of rdoc requires Ruby 2.2 + |if RUBY_VERSION < '2.2' + | gem 'rdoc', '< 6.0.4' + |end + | |gem 'rspec-rails', | :path => '#{rspec_rails_repo_path}', | :groups => [:development, :test] From d920c302345c625b50a1564032cef4d66a6a2d6e Mon Sep 17 00:00:00 2001 From: Benoit Tigeot Date: Wed, 18 Jul 2018 09:48:38 +0200 Subject: [PATCH 4/8] Permit usage of puma 3.11.4 between Ruby 1.9.3 and 2.2 --- Gemfile-rails-dependencies | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/Gemfile-rails-dependencies b/Gemfile-rails-dependencies index 3eb2f2f759..1706085527 100644 --- a/Gemfile-rails-dependencies +++ b/Gemfile-rails-dependencies @@ -20,7 +20,9 @@ when /stable$/ gem_list = %w[rails railties actionmailer actionpack activerecord activesupport] gem_list << 'activejob' if version > '4-1-stable' gem_list << 'actionview' if version > '4-0-stable' - if RUBY_VERSION >= "2.2" + if RUBY_VERSION >= "1.9.3" && RUBY_VERSION < "2.2" + gem "puma", "~> 3.11.4" + elsif RUBY_VERSION >= "2.2" gem_list << 'puma' if version > '5-0-stable' end @@ -40,8 +42,12 @@ when nil, false, "" else gem "rails", version - if version >= '5-1-stable' && RUBY_VERSION >= "2.2" - gem "puma" + if version >= '5-1-stable' + if RUBY_VERSION < "2.2" + gem "puma", "~> 3.11.4" + else + gem "puma" + end end end From 00a254e4c9267a7abe59ed2033ddd0e70ed86faf Mon Sep 17 00:00:00 2001 From: Benoit Tigeot Date: Fri, 20 Jul 2018 10:25:25 +0200 Subject: [PATCH 5/8] Specify rdoc version when Ruby version is under 2.2 on generated_app Because of ruby/rdoc@51b03c3 --- example_app_generator/generate_app.rb | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/example_app_generator/generate_app.rb b/example_app_generator/generate_app.rb index 8e04b86664..fe37556739 100644 --- a/example_app_generator/generate_app.rb +++ b/example_app_generator/generate_app.rb @@ -23,9 +23,13 @@ gsub_file "Gemfile", /.*debugger.*/, '' gsub_file "Gemfile", /.*byebug.*/, "gem 'byebug', '~> 9.0.6'" gsub_file "Gemfile", /.*puma.*/, "" +<<<<<<< HEAD if RUBY_VERSION < '2.2.2' gsub_file "Gemfile", /.*rdoc.*/, "gem 'rdoc', '< 6'" end +======= + gsub_file "Gemfile", /.*rdoc.*/, "gem 'rdoc', '< 6.0.4'" +>>>>>>> Specify rdoc version when Ruby version is under 2.2 on generated_app if Rails::VERSION::STRING >= '5.0.0' append_to_file('Gemfile', "gem 'rails-controller-testing', :git => 'https://github.com/rails/rails-controller-testing'\n") @@ -57,11 +61,6 @@ | gem 'mime-types', '< 3' |end | - |# Version 6.0.4 of rdoc requires Ruby 2.2 - |if RUBY_VERSION < '2.2' - | gem 'rdoc', '< 6.0.4' - |end - | |gem 'rspec-rails', | :path => '#{rspec_rails_repo_path}', | :groups => [:development, :test] From ae334b53afcb90ae30a2faeed3cc34a55d68678e Mon Sep 17 00:00:00 2001 From: Benoit Tigeot Date: Fri, 20 Jul 2018 12:27:50 +0200 Subject: [PATCH 6/8] Clear conflicts and rewrite puma clause --- Gemfile-rails-dependencies | 6 +++--- example_app_generator/generate_app.rb | 4 ---- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/Gemfile-rails-dependencies b/Gemfile-rails-dependencies index 1706085527..edd364d522 100644 --- a/Gemfile-rails-dependencies +++ b/Gemfile-rails-dependencies @@ -20,10 +20,10 @@ when /stable$/ gem_list = %w[rails railties actionmailer actionpack activerecord activesupport] gem_list << 'activejob' if version > '4-1-stable' gem_list << 'actionview' if version > '4-0-stable' - if RUBY_VERSION >= "1.9.3" && RUBY_VERSION < "2.2" - gem "puma", "~> 3.11.4" - elsif RUBY_VERSION >= "2.2" + if RUBY_VERSION >= "2.2" gem_list << 'puma' if version > '5-0-stable' + elsif RUBY_VERSION >= "1.9.3" + gem "puma", "~> 3.11.4" end gem_list.each do |rails_gem| diff --git a/example_app_generator/generate_app.rb b/example_app_generator/generate_app.rb index fe37556739..6841db7695 100644 --- a/example_app_generator/generate_app.rb +++ b/example_app_generator/generate_app.rb @@ -23,13 +23,9 @@ gsub_file "Gemfile", /.*debugger.*/, '' gsub_file "Gemfile", /.*byebug.*/, "gem 'byebug', '~> 9.0.6'" gsub_file "Gemfile", /.*puma.*/, "" -<<<<<<< HEAD if RUBY_VERSION < '2.2.2' gsub_file "Gemfile", /.*rdoc.*/, "gem 'rdoc', '< 6'" end -======= - gsub_file "Gemfile", /.*rdoc.*/, "gem 'rdoc', '< 6.0.4'" ->>>>>>> Specify rdoc version when Ruby version is under 2.2 on generated_app if Rails::VERSION::STRING >= '5.0.0' append_to_file('Gemfile', "gem 'rails-controller-testing', :git => 'https://github.com/rails/rails-controller-testing'\n") From 65d85a32f9cb47be4ddf3929f0b85be36d580020 Mon Sep 17 00:00:00 2001 From: Benoit Tigeot Date: Fri, 20 Jul 2018 12:48:13 +0200 Subject: [PATCH 7/8] Revert to initial changes See : https://github.com/rspec/rspec-rails/pull/2013/commits/33e41f254eb8596165edd94e866075279ed73925 --- Gemfile | 1 + Gemfile-rails-dependencies | 10 ++-------- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/Gemfile b/Gemfile index 5d19da734e..267c6b3a0a 100644 --- a/Gemfile +++ b/Gemfile @@ -44,6 +44,7 @@ if RUBY_VERSION < '2.0.0' gem 'mime-types', '< 3' end + # Capybara versions that support RSpec 3 only support RUBY_VERSION >= 1.9.3 if RUBY_VERSION >= '1.9.3' if /5(\.|-)[1-9]\d*/ === RAILS_VERSION || "master" == RAILS_VERSION diff --git a/Gemfile-rails-dependencies b/Gemfile-rails-dependencies index edd364d522..3eb2f2f759 100644 --- a/Gemfile-rails-dependencies +++ b/Gemfile-rails-dependencies @@ -22,8 +22,6 @@ when /stable$/ gem_list << 'actionview' if version > '4-0-stable' if RUBY_VERSION >= "2.2" gem_list << 'puma' if version > '5-0-stable' - elsif RUBY_VERSION >= "1.9.3" - gem "puma", "~> 3.11.4" end gem_list.each do |rails_gem| @@ -42,12 +40,8 @@ when nil, false, "" else gem "rails", version - if version >= '5-1-stable' - if RUBY_VERSION < "2.2" - gem "puma", "~> 3.11.4" - else - gem "puma" - end + if version >= '5-1-stable' && RUBY_VERSION >= "2.2" + gem "puma" end end From c50398994ab983d9e7ed2df96c866ca73bae865c Mon Sep 17 00:00:00 2001 From: Benoit Tigeot Date: Fri, 20 Jul 2018 13:02:45 +0200 Subject: [PATCH 8/8] Avoid bundler load error on CI See: https://github.com/bundler/bundler/issues/6629 Should be changed when fixed on next bundler release --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index bd74040e5c..76b13c0c6c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -24,7 +24,7 @@ bundler_args: "--binstubs --path ../bundle --retry=3 --jobs=3" before_install: - gem update --system - - gem install bundler + - gem install bundler -v 1.16.2 - script/clone_all_rspec_repos before_script: