Skip to content

Commit

Permalink
Merge pull request #316 from cjlarose/remove-support-for-old-ruby-and…
Browse files Browse the repository at this point in the history
…-rails-versions

Remove support for old Ruby and Rails versions
  • Loading branch information
cjlarose authored Feb 13, 2022
2 parents 3dd6817 + 2981bbd commit 116fe95
Show file tree
Hide file tree
Showing 158 changed files with 23 additions and 2,738 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ jobs:
fail-fast: false
matrix:
ruby:
- 2.4
- 2.5
- 2.6
- 2.7
- 3.0
- 3.1
- jruby
- truffleruby
- truffleruby-21
steps:
- name: Checkout
uses: actions/checkout@master
Expand Down
63 changes: 13 additions & 50 deletions Appraisals
Original file line number Diff line number Diff line change
@@ -1,67 +1,30 @@
# Bundler >= 2.x do not work with Rails 4.2
puts `bundle -v`

if (`bundle -v`[/\d+\.\d+\.\d+/]).start_with?('1.17')
appraise 'rails-4.2' do
gem 'activerecord-jdbcsqlite3-adapter', '~> 1.3.25', platform: :jruby
gem 'rails', '4.2.11.3'
# Rails 5.x, 6.0 requires Ruby < 3
if RUBY_ENGINE == 'ruby' && RUBY_VERSION <= '3.0'
appraise 'rails-5.2' do
gem 'activerecord-jdbcsqlite3-adapter', '~> 52.5', platform: :jruby
gem 'bootsnap', '~> 1.4'
gem 'rails', '5.2.4.3'
gem 'rspec-rails', '~> 3.7'
gem 'sprockets', '~> 3.7'
gem 'sqlite3', '< 1.4.0', platform: :ruby
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw]
end
else
puts 'Skipping rails-4.2 for Bundler >= 2.x'
end

appraise 'rails-5.0' do
gem 'activerecord-jdbcsqlite3-adapter', '~> 50.6', platform: :jruby
gem 'rails', '5.0.7.2'
gem 'rspec-rails', '~> 3.7'
gem 'sqlite3', '< 1.4.0', platform: :ruby
end

appraise 'rails-5.1' do
gem 'activerecord-jdbcsqlite3-adapter', '~> 51.6', platform: :jruby
gem 'rails', '5.1.7'
gem 'rspec-rails', '~> 3.7'
gem 'sqlite3', '< 1.4.0', platform: :ruby
end

appraise 'rails-5.2' do
gem 'activerecord-jdbcsqlite3-adapter', '~> 52.5', platform: :jruby
gem 'bootsnap', '~> 1.4'
gem 'rails', '5.2.4.3'
gem 'rspec-rails', '~> 3.7'
gem 'sqlite3', '< 1.4.0', platform: :ruby
end

# Rails 6.x requires Ruby >= 2.5.0
if (RUBY_ENGINE == 'ruby' && RUBY_VERSION >= '2.5.0') || RUBY_ENGINE != 'ruby'
appraise 'rails-6.0' do
gem 'activerecord-jdbcsqlite3-adapter', '~> 60.1', platform: :jruby
gem 'bootsnap', '~> 1.4'
gem 'rails', '6.0.3.1'
gem 'rspec-rails', '~> 3.7'
gem 'sqlite3', '~> 1.4.0', platform: :ruby
end
else
puts 'Skipping rails-6.0 for Ruby < 2.5'
end

# Test rails 6.1 with psych >= 4
# Rails 6.x requires Ruby >= 2.5.0
if (RUBY_ENGINE == 'ruby' && RUBY_VERSION >= '2.5.0') || RUBY_ENGINE != 'ruby'
appraise 'rails-6.1' do
gem 'activerecord-jdbcsqlite3-adapter', '~> 61.1', platform: :jruby
gem 'bootsnap', '>= 1.4.4'
gem 'rails', '6.1.4'
gem 'rspec-rails', '~> 5.0'
gem 'sqlite3', '~> 1.4', platform: :ruby
gem 'psych', '>= 4'
end
else
puts 'Skipping rails-6.1 for Ruby < 2.5'
appraise 'rails-6.1' do
gem 'activerecord-jdbcsqlite3-adapter', '~> 61.1', platform: :jruby
gem 'bootsnap', '>= 1.4.4'
gem 'rails', '6.1.4'
gem 'rspec-rails', '~> 5.0'
gem 'sqlite3', '~> 1.4', platform: :ruby
gem 'psych', '>= 4'
end

appraise 'sinatra' do
Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

### BREAKING CHANGES

* Rails versions `< 5.2` are no longer supported
* Ruby versions `< 2.6` are no longer supported
* Support `HashSource` and `EnvSource` instances in `Config.load_files` and `Config.load_and_set_settings`. ([#315](https://github.com/rubyconfig/config/pull/315)). There are a few subtle breaking changes:
* Previously, `Config.load_files` (called from `Config.load_and_set_settings`) would call `.to_s` on each of its arguments. Now, this responsibility is defered to YAMLSource. In effect, if your application passes String or Pathname objects to `Config.load_files`, no changes are necessary, but if you were somehow relying on the `.to_s` call for some other type of object, you'll now need to call `.to_s` on that object before passing it to `Config`.
* Before this change, `Config.load_files` would call `uniq` on its argument array. This call has been removed, so duplicate file paths are not removed before further processing. In some cases, this can cause differences in behavior since later config files override the values in earlier ones. In most cases, it's best to ensure that duplicate paths are not passed to `Config.load_files`.
Expand Down
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,18 @@ Config helps you easily manage environment specific settings in an easy and usab
Current version supports and is [tested](.github/workflows/tests.yml#L19) for the following interpreters and frameworks:

* Interpreters
* [Ruby](https://www.ruby-lang.org) `>= 2.4`
* [Ruby](https://www.ruby-lang.org) `>= 2.6`
* [JRuby](https://www.jruby.org) `>= 9.2`
* [TruffleRuby](https://github.com/oracle/truffleruby) `>= 19.3`
* Application frameworks
* Rails `>= 4.2`, `5` and `6`
* Rails `>= 5.2`
* Padrino
* Sinatra

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).

For Ruby `2.4` or `2.5` or Rails `4.2`, `5.0`, or `5.1` use version `3.x` of this gem.

## Installing

### Installing on Rails
Expand Down
2 changes: 1 addition & 1 deletion config.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Donate: \e[34mhttps://opencollective.com/rubyconfig/donate\e[0m\n"
s.files.select! { |file| /(^lib\/|^\w+.md$|\.gemspec$)/ =~ file }

s.require_paths = ['lib']
s.required_ruby_version = '>= 2.4.0'
s.required_ruby_version = '>= 2.6.0'

s.add_dependency 'deep_merge', '~> 1.2', '>= 1.2.1'
s.add_dependency 'dry-validation', '~> 1.0', '>= 1.0.0'
Expand Down
12 changes: 0 additions & 12 deletions gemfiles/rails_4.2.gemfile

This file was deleted.

10 changes: 0 additions & 10 deletions gemfiles/rails_5.0.gemfile

This file was deleted.

10 changes: 0 additions & 10 deletions gemfiles/rails_5.1.gemfile

This file was deleted.

6 changes: 0 additions & 6 deletions spec/app/rails_4.2/Rakefile

This file was deleted.

16 changes: 0 additions & 16 deletions spec/app/rails_4.2/app/assets/javascripts/application.js

This file was deleted.

15 changes: 0 additions & 15 deletions spec/app/rails_4.2/app/assets/stylesheets/application.css

This file was deleted.

5 changes: 0 additions & 5 deletions spec/app/rails_4.2/app/controllers/application_controller.rb

This file was deleted.

2 changes: 0 additions & 2 deletions spec/app/rails_4.2/app/helpers/application_helper.rb

This file was deleted.

14 changes: 0 additions & 14 deletions spec/app/rails_4.2/app/views/layouts/application.html.erb

This file was deleted.

3 changes: 0 additions & 3 deletions spec/app/rails_4.2/bin/bundle

This file was deleted.

8 changes: 0 additions & 8 deletions spec/app/rails_4.2/bin/rails

This file was deleted.

8 changes: 0 additions & 8 deletions spec/app/rails_4.2/bin/rake

This file was deleted.

29 changes: 0 additions & 29 deletions spec/app/rails_4.2/bin/setup

This file was deleted.

15 changes: 0 additions & 15 deletions spec/app/rails_4.2/bin/spring

This file was deleted.

4 changes: 0 additions & 4 deletions spec/app/rails_4.2/config.ru

This file was deleted.

31 changes: 0 additions & 31 deletions spec/app/rails_4.2/config/application.rb

This file was deleted.

3 changes: 0 additions & 3 deletions spec/app/rails_4.2/config/boot.rb

This file was deleted.

25 changes: 0 additions & 25 deletions spec/app/rails_4.2/config/database.yml

This file was deleted.

5 changes: 0 additions & 5 deletions spec/app/rails_4.2/config/environment.rb

This file was deleted.

Loading

0 comments on commit 116fe95

Please sign in to comment.