Skip to content

Commit 085d234

Browse files
committed
Revert "Drop support for Ruby < 3.2 and Rails < 7.2"
This reverts commit 1080cbd.
1 parent 1080cbd commit 085d234

228 files changed

Lines changed: 4357 additions & 21 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/tests.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,16 @@ jobs:
1515
name: ${{ matrix.ruby }}
1616
runs-on: ubuntu-latest
1717
env:
18-
COVERAGE_RUBY_VERSION: 3.2
18+
COVERAGE_RUBY_VERSION: 2.6
1919
BUNDLE_PATH: ${{ github.workspace }}/vendor/bundle
2020
strategy:
2121
fail-fast: false
2222
matrix:
2323
ruby:
24+
- 2.6
25+
- 2.7
26+
- '3.0' # Due to https://github.com/actions/runner/issues/849, we have to use quotes for '3.0'
27+
- 3.1
2428
- 3.2
2529
- 3.3
2630
- 3.4

Appraisals

Lines changed: 71 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,68 @@ min_ruby_version = ->(version) {
66
RUBY_ENGINE == 'ruby' && Gem::Version.new(RUBY_VERSION) >= Gem::Version.new(version)
77
}
88

9-
# Rails 8.0 requires Ruby > 3.2
10-
if min_ruby_version.call('3.2.0')
11-
appraise 'rails-8.0' do
9+
# Rails 5.x, 6.0 require Ruby < 3
10+
if max_ruby_version.call('3.0')
11+
appraise 'rails-5.2' do
12+
gem 'activerecord-jdbcsqlite3-adapter', '~> 52.5', platform: :jruby
13+
gem 'bootsnap', '~> 1.4'
14+
gem 'rails', '~> 5.2.0'
15+
gem 'rspec-rails', '~> 3.7'
16+
gem 'sqlite3', '< 1.4.0', platform: :ruby
17+
end
18+
19+
appraise 'rails-6.0' do
20+
gem 'activerecord-jdbcsqlite3-adapter', '~> 60.1', platform: :jruby
21+
gem 'bootsnap', '~> 1.4'
22+
gem 'rails', '~> 6.0.0'
23+
gem 'rspec-rails', '~> 3.7'
24+
gem 'sqlite3', '~> 1', platform: :ruby
25+
end
26+
end
27+
28+
appraise 'rails-6.1' do
29+
gem 'activerecord-jdbcsqlite3-adapter', '~> 61.1', platform: :jruby
30+
gem 'bootsnap', '>= 1.4.4'
31+
gem 'drb', '~> 2.2' if min_ruby_version.call('3.4')
32+
gem 'mutex_m', '~> 0.2.0' if min_ruby_version.call('3.4')
33+
gem 'psych', '>= 4'
34+
gem 'rails', '~> 6.1.0'
35+
gem 'rspec-rails', '~> 5.0'
36+
gem 'sqlite3', '~> 1', platform: :ruby
37+
gem 'benchmark'
38+
end
39+
40+
# Rails 7.0 require Ruby > 2.7
41+
if min_ruby_version.call('2.7') || RUBY_ENGINE != 'ruby'
42+
appraise 'rails-7.0' do
43+
gem 'activerecord-jdbcsqlite3-adapter', '~> 70.1', platform: :jruby
44+
gem 'bootsnap', '>= 1.4.4'
45+
gem 'drb', '~> 2.2' if min_ruby_version.call('3.4')
46+
gem 'mutex_m', '~> 0.2.0' if min_ruby_version.call('3.4')
47+
gem 'psych', '>= 4'
48+
gem 'rails', '~> 7.0.0'
49+
gem 'rspec-rails', '~> 7.0'
50+
gem 'sprockets-rails', '~> 3.5.2'
51+
gem 'sqlite3', '~> 1', platform: :ruby
52+
end
53+
end
54+
55+
# Rails 7.1 require Ruby > 2.7
56+
if min_ruby_version.call('2.7')
57+
appraise 'rails-7.1' do
1258
gem 'activerecord-jdbcsqlite3-adapter', '~> 71.0', platform: :jruby
1359
gem 'bootsnap', '>= 1.16.0'
14-
gem 'kamal', '~> 2.7.0'
15-
gem 'rails', '~> 8.0.0'
16-
gem 'rspec-rails', '~> 8.0'
1760
gem 'psych', '>= 4'
18-
gem 'sqlite3', '>= 2.1', platform: :ruby
61+
gem 'rails', '~> 7.1.0'
62+
gem 'rspec-rails', '~> 7.0'
63+
gem 'sprockets-rails', '~> 3.5.2'
64+
gem 'sqlite3', '~> 1', platform: :ruby
1965
end
2066

21-
# Rails 7.2 requires Ruby > 3.1 but 3.1 is EOL.
67+
end
68+
69+
# Rails 7.2 requires Ruby > 3.1
70+
if min_ruby_version.call('3.1.0')
2271
appraise 'rails-7.2' do
2372
gem 'activerecord-jdbcsqlite3-adapter', '~> 71.0', platform: :jruby
2473
gem 'bootsnap', '>= 1.16.0'
@@ -30,6 +79,19 @@ if min_ruby_version.call('3.2.0')
3079
end
3180
end
3281

82+
# Rails 8.0 requires Ruby > 3.2
83+
if min_ruby_version.call('3.2.0')
84+
appraise 'rails-8.0' do
85+
gem 'activerecord-jdbcsqlite3-adapter', '~> 71.0', platform: :jruby
86+
gem 'bootsnap', '>= 1.16.0'
87+
gem 'kamal', '~> 2.7.0'
88+
gem 'rails', '~> 8.0.0'
89+
gem 'rspec-rails', '~> 8.0'
90+
gem 'psych', '>= 4'
91+
gem 'sqlite3', '>= 2.1', platform: :ruby
92+
end
93+
end
94+
3395
# Rails 8.1 requires Ruby > 3.3
3496
if min_ruby_version.call('3.3.0')
3597
appraise 'rails-8.1' do
@@ -44,5 +106,5 @@ if min_ruby_version.call('3.3.0')
44106
end
45107

46108
appraise 'sinatra' do
47-
gem 'sinatra', '~> 4.2.0'
109+
gem 'sinatra', '2.0.8.1'
48110
end

README.md

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,22 +23,17 @@ Config helps you easily manage environment specific settings in an easy and usab
2323
Current version supports and is [tested](.github/workflows/tests.yml#L19) for the following interpreters and frameworks:
2424

2525
* Interpreters
26-
* [Ruby](https://www.ruby-lang.org) `>= 3.6`
26+
* [Ruby](https://www.ruby-lang.org) `>= 2.6`
2727
* [JRuby](https://www.jruby.org) `>= 9.2`
2828
* [TruffleRuby](https://github.com/oracle/truffleruby) `>= 19.3`
2929
* Application frameworks
30-
* Rails `>= 7.2`
30+
* Rails `>= 5.2`
3131
* Padrino
32-
* Sinatra `>= 4.2.0`
32+
* Sinatra
3333

34-
| Ruby | Rails | Config |
35-
|---|---|---|
36-
| >= 3.2 | >= 7.2 | 6.x |
37-
| < 3.2 | < 7.2 | 5.x |
38-
| 2.4–2.5 | 4.2–5.1 | 3.x |
39-
| 2.0–2.3 | 3.0–4.1 | 1.x |
34+
For Ruby `2.0` to `2.3` or Rails `3` to `4.1` use version `1.x` of this gem. For older versions of Rails or Ruby use [AppConfig](http://github.com/fredwu/app_config).
4035

41-
For older versions of Rails or Ruby use [AppConfig](http://github.com/fredwu/app_config).
36+
For Ruby `2.4` or `2.5` or Rails `4.2`, `5.0`, or `5.1` use version `3.x` of this gem.
4237

4338
## Installing
4439

config.gemspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ Gem::Specification.new do |s|
2525
s.files.select! { |file| /(^lib\/|^\w+.md$|\.gemspec$)/ =~ file }
2626

2727
s.require_paths = ['lib']
28-
s.required_ruby_version = '>= 3.2.0'
28+
s.required_ruby_version = '>= 2.6.0'
2929

3030
s.add_dependency 'deep_merge', '~> 1.2', '>= 1.2.1'
3131
s.add_dependency 'ostruct'

spec/app/rails_5.2/Gemfile

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
source 'https://rubygems.org'
2+
3+
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
4+
gem 'rails', '~> 5.2.2'
5+
# Use sqlite3 as the database for Active Record
6+
gem 'sqlite3'
7+
# Use Puma as the app server
8+
gem 'puma', '~> 5.6.9'
9+
# Use SCSS for stylesheets
10+
gem 'sass-rails', '~> 5.0'
11+
# Use Uglifier as compressor for JavaScript assets
12+
gem 'uglifier', '>= 1.3.0'
13+
# See https://github.com/rails/execjs#readme for more supported runtimes
14+
# gem 'mini_racer', platforms: :ruby
15+
16+
# Use CoffeeScript for .coffee assets and views
17+
gem 'coffee-rails', '~> 4.2'
18+
# Turbolinks makes navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks
19+
gem 'turbolinks', '~> 5'
20+
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
21+
gem 'jbuilder', '~> 2.5'
22+
# Use Redis adapter to run Action Cable in production
23+
# gem 'redis', '~> 4.0'
24+
# Use ActiveModel has_secure_password
25+
# gem 'bcrypt', '~> 3.1.7'
26+
27+
# Use ActiveStorage variant
28+
# gem 'mini_magick', '~> 4.8'
29+
30+
# Use Capistrano for deployment
31+
# gem 'capistrano-rails', group: :development
32+
33+
# Reduces boot times through caching; required in config/boot.rb
34+
gem 'bootsnap', '>= 1.1.0', require: false
35+
36+
group :development, :test do
37+
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
38+
gem 'byebug', platforms: [:mri, :mingw, :x64_mingw]
39+
end
40+
41+
group :development do
42+
# Access an interactive console on exception pages or by calling 'console' anywhere in the code.
43+
gem 'web-console', '>= 3.3.0'
44+
gem 'listen', '>= 3.0.5', '< 3.2'
45+
# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
46+
gem 'spring'
47+
gem 'spring-watcher-listen', '~> 2.0.0'
48+
end
49+
50+
group :test do
51+
# Adds support for Capybara system testing and selenium driver
52+
gem 'capybara', '>= 2.15'
53+
gem 'selenium-webdriver'
54+
# Easy installation and use of chromedriver to run system tests with Chrome
55+
gem 'chromedriver-helper'
56+
end
57+
58+
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
59+
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]

spec/app/rails_5.2/README.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# README
2+
3+
This README would normally document whatever steps are necessary to get the
4+
application up and running.
5+
6+
Things you may want to cover:
7+
8+
* Ruby version
9+
10+
* System dependencies
11+
12+
* Configuration
13+
14+
* Database creation
15+
16+
* Database initialization
17+
18+
* How to run the test suite
19+
20+
* Services (job queues, cache servers, search engines, etc.)
21+
22+
* Deployment instructions
23+
24+
* ...

spec/app/rails_5.2/Rakefile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Add your own tasks in files placed in lib/tasks ending in .rake,
2+
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
3+
4+
require_relative 'config/application'
5+
6+
Rails.application.load_tasks
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
//= link_tree ../images
2+
//= link_directory ../javascripts .js
3+
//= link_directory ../stylesheets .css
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// This is a manifest file that'll be compiled into application.js, which will include all the files
2+
// listed below.
3+
//
4+
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, or any plugin's
5+
// vendor/assets/javascripts directory can be referenced here using a relative path.
6+
//
7+
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
8+
// compiled file. JavaScript code in this file should be added after the last require_* statement.
9+
//
10+
// Read Sprockets README (https://github.com/rails/sprockets#sprockets-directives) for details
11+
// about supported directives.
12+
//
13+
//= require rails-ujs
14+
//= require activestorage
15+
//= require turbolinks
16+
//= require_tree .
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// Action Cable provides the framework to deal with WebSockets in Rails.
2+
// You can generate new channels where WebSocket features live using the `rails generate channel` command.
3+
//
4+
//= require action_cable
5+
//= require_self
6+
//= require_tree ./channels
7+
8+
(function() {
9+
this.App || (this.App = {});
10+
11+
App.cable = ActionCable.createConsumer();
12+
13+
}).call(this);

0 commit comments

Comments
 (0)