Skip to content

Lock gems that fail to install on certain Ruby versions #2366

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 31, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,12 @@ gem 'rake', '~> 12'

gem 'mime-types', "~> 3"

if RUBY_VERSION.to_f == 2.2
if RUBY_VERSION.to_f < 2.3
gem 'capybara', '~> 3.1.0'
elsif RUBY_VERSION.to_f < 2.4
gem 'capybara', '< 3.16'
elsif RUBY_VERSION.to_f < 2.5
gem 'capybara', '< 3.33'
else
gem 'capybara', '>= 2.13', '< 4.0', require: false
end
Expand Down
3 changes: 2 additions & 1 deletion Gemfile-rails-dependencies
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ when /stable$/
gem_list = %w[rails railties actionmailer actionpack activerecord activesupport activejob actionview]
gem 'puma', "3.12.1" if version > '5-0-stable'
gem 'activerecord-jdbcsqlite3-adapter', git: 'https://github.com/jruby/activerecord-jdbc-adapter', platforms: [:jruby]
gem "sprockets", '~> 3.0' if RUBY_VERSION < '2.5'

gem_list.each do |rails_gem|
gem rails_gem, :git => "https://github.com/rails/rails.git", :branch => version
Expand All @@ -28,7 +29,7 @@ when nil, false, ""
gem 'activerecord-jdbcsqlite3-adapter', platforms: [:jruby]
else
gem "rails", version

gem "sprockets", '~> 3.0' if RUBY_VERSION < '2.5'
gem "puma" if version >= '5-1-stable'

if version.gsub(/[^\d\.]/,'').to_f >= 6.0
Expand Down
11 changes: 11 additions & 0 deletions example_app_generator/generate_app.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,22 @@
gsub_file "Gemfile", /.*rails-controller-testing.*/, "gem 'rails-controller-testing', git: 'https://github.com/rails/rails-controller-testing'"
end

if RUBY_VERSION < "2.3.0"
gsub_file "Gemfile", /.*childprocess.*/, "gem 'childprocess', '< 2.0.0'"
gsub_file "Gemfile", /.*i18n.*/, "gem 'i18n', '< 1.5.2'"
gsub_file "Gemfile", /.*nio4r.*/, "gem 'nio4r', '< 2.4.0'"
gsub_file "Gemfile", /.*public_suffix.*/, "gem 'public_suffix', '< 4.0.0'"
gsub_file "Gemfile", /.*rack.*/, "gem 'rack', '< 2.2.0', '!= 2.1.0'"
gsub_file "Gemfile", /.*xpath.*/, "gem 'xpath', '< 3.2.0'"
end

if Rails::VERSION::STRING >= "5.1.0"
if RUBY_VERSION < "2.3"
gsub_file "Gemfile", /.*capybara.*/, "gem 'capybara', '~> 3.1.0'"
elsif RUBY_VERSION < "2.4"
gsub_file "Gemfile", /.*capybara.*/, "gem 'capybara', '~> 3.15.0'"
elsif RUBY_VERSION < "2.5"
gsub_file "Gemfile", /.*capybara.*/, "gem 'capybara', '~> 3.32.0'"
end
if Rails::VERSION::STRING >= "5.2.0"
gsub_file "Gemfile", /.*chromedriver-helper.*/, "gem 'webdrivers', '< 4.0.0'"
Expand Down