Skip to content

Commit 268cc22

Browse files
committed
feat: update ruby and rails support matrix
- Add support for Ruby 3.4 and Rails/ActiveRecord 8.1 - Drop support for Ruby 3.1 and Rails 7.0 - Update Appraisal definitions and generated gemfiles to reflect new version constraints BREAKING CHANGE: Minimum supported Rails version is now 7.1 and minimum Ruby version is 3.2.
1 parent 50b7036 commit 268cc22

16 files changed

Lines changed: 101 additions & 73 deletions

.github/dependabot.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: bundler
4+
directory: "/"
5+
schedule:
6+
interval: weekly
7+
open-pull-requests-limit: 10
8+
labels:
9+
- dependencies
10+
groups:
11+
ruby-gems:
12+
patterns:
13+
- "*"
14+
15+
- package-ecosystem: github-actions
16+
directory: "/"
17+
schedule:
18+
interval: weekly
19+
open-pull-requests-limit: 5
20+
labels:
21+
- dependencies
22+
groups:
23+
github-actions:
24+
patterns:
25+
- "*"

.github/workflows/ruby.yml

Lines changed: 20 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,58 +1,43 @@
1-
# This workflow uses actions that are not certified by GitHub.
2-
# They are provided by a third-party and are governed by
3-
# separate terms of service, privacy policy, and support
4-
# documentation.
5-
# This workflow will download a prebuilt Ruby version, install dependencies and run tests with Rake
6-
# For more information see: https://github.com/marketplace/actions/setup-ruby-jruby-and-truffleruby
7-
81
name: Ruby
92

103
on:
114
push:
12-
branches: [ "master" ]
5+
branches: ["master"]
136
pull_request:
14-
branches: [ "master" ]
7+
branches: ["master"]
158

169
permissions:
1710
contents: read
1811

1912
jobs:
2013
test:
21-
2214
runs-on: ubuntu-latest
2315
strategy:
16+
fail-fast: false
2417
matrix:
25-
ruby-version: ['3.1', '3.2', '3.3']
18+
ruby-version: ['3.2', '3.3', '3.4']
2619
gemfile:
27-
- gemfiles/rails_7_0.gemfile
2820
- gemfiles/rails_7_1.gemfile
2921
- gemfiles/rails_7_2.gemfile
3022
- gemfiles/rails_8_0.gemfile
31-
- gemfiles/activerecord_7_0.gemfile
23+
- gemfiles/rails_8_1.gemfile
3224
- gemfiles/activerecord_7_1.gemfile
3325
- gemfiles/activerecord_7_2.gemfile
3426
- gemfiles/activerecord_8_0.gemfile
35-
exclude:
36-
- ruby-version: '3.1'
37-
gemfile: gemfiles/rails_8_0.gemfile
38-
- ruby-version: '3.1'
39-
gemfile: gemfiles/activerecord_8_0.gemfile
27+
- gemfiles/activerecord_8_1.gemfile
4028

4129
steps:
42-
- uses: actions/checkout@v3
43-
- name: Set up Ruby
44-
# To automatically get bug fixes and new Ruby versions for ruby/setup-ruby,
45-
# change this to (see https://github.com/ruby/setup-ruby#versioning):
46-
uses: ruby/setup-ruby@v1
47-
with:
48-
ruby-version: ${{ matrix.ruby-version }}
49-
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
50-
- name: Install gems
51-
env:
52-
BUNDLE_GEMFILE: ${{ matrix.gemfile }}
53-
run: bundle install
54-
55-
- name: Run tests
56-
env:
57-
BUNDLE_GEMFILE: ${{ matrix.gemfile }}
58-
run: bundle exec rake
30+
- uses: actions/checkout@v6
31+
- name: Set up Ruby
32+
uses: ruby/setup-ruby@v1
33+
with:
34+
ruby-version: ${{ matrix.ruby-version }}
35+
bundler-cache: true
36+
- name: Install gems
37+
env:
38+
BUNDLE_GEMFILE: ${{ matrix.gemfile }}
39+
run: bundle install
40+
- name: Run tests
41+
env:
42+
BUNDLE_GEMFILE: ${{ matrix.gemfile }}
43+
run: bundle exec rake

.rumdl.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[global]
2+
exclude = ["AGENTS.md", "GEMINI.md", "CHANGELOG.md", "prompts/", "docs/**/*"]
3+
disable = ["MD013", "MD033"]

Appraisals

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,6 @@ skip_gems_snippet = <<~GEMS
77
end
88
GEMS
99

10-
appraise 'rails-7-0' do
11-
gem 'rails', '~> 7.0.0'
12-
gem 'sqlite3', '~> 1.6'
13-
eval(skip_gems_snippet)
14-
end
15-
1610
appraise 'rails-7-1' do
1711
gem 'rails', '~> 7.1.0'
1812
gem 'sqlite3', '~> 2.0'
@@ -31,10 +25,9 @@ appraise 'rails-8-0' do
3125
eval(skip_gems_snippet)
3226
end
3327

34-
appraise 'activerecord-7-0' do
35-
gem 'activerecord', '~> 7.0.0'
36-
gem 'rake'
37-
gem 'sqlite3', '~> 1.6'
28+
appraise 'rails-8-1' do
29+
gem 'rails', '~> 8.1.0'
30+
gem 'sqlite3', '~> 2.0'
3831
eval(skip_gems_snippet)
3932
end
4033

@@ -58,4 +51,11 @@ appraise 'activerecord-8-0' do
5851
gem 'sqlite3', '~> 2.0'
5952
eval(skip_gems_snippet)
6053
end
54+
55+
appraise 'activerecord-8-1' do
56+
gem 'activerecord', '~> 8.1.0'
57+
gem 'rake'
58+
gem 'sqlite3', '~> 2.0'
59+
eval(skip_gems_snippet)
60+
end
6161
# rubocop:enable Security/Eval

Gemfile

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,17 @@ gemspec
1616
# gem 'byebug', group: [:development, :test]
1717
#
1818

19-
# https://stackoverflow.com/questions/79360526/uninitialized-constant-activesupportloggerthreadsafelevellogger-nameerror
20-
gem 'concurrent-ruby', '1.3.4'
2119
gem 'minitest'
2220
gem 'minitest-focus'
2321
gem 'minitest-reporters'
22+
gem 'tzinfo-data'
2423

2524
group :local_development do
2625
gem 'appraisal'
2726
gem 'overcommit'
2827
gem 'pry'
29-
gem 'rails', '>= 7.0'
28+
gem 'rails', '>= 7.1'
3029
gem 'reek'
31-
gem 'rubocop', '~> 1.69.0'
30+
gem 'rubocop', '~> 1.85'
3231
gem 'sqlite3', '>= 1.4'
3332
end

README.md

Lines changed: 26 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# PpSql
22

3-
[![Version ][rubygems_badge]][rubygems]
4-
[![Codacy Badge ][codacy_badge]][codacy]
5-
[![Reviewed by Hound ][hound_badge]][hound]
6-
[<img src="https://api.gitsponsors.com/api/badge/img?id=78002099" height="20">](https://api.gitsponsors.com/api/badge/link?p=J9d+7zEGJS+BQMhX3FZDy2lWmzWp75oJZulj80NsvTrAkDEWcEC5PzkwUCDB/oqWGOfl1rwmFSi7crAJTxB6ww==)
3+
[![Version][rubygems_badge]][rubygems]
4+
[![Codacy Badge][codacy_badge]][codacy]
5+
[![Reviewed by Hound][hound_badge]][hound]
6+
[img src="https://api.gitsponsors.com/api/badge/img?id=78002099" height="20"](https://api.gitsponsors.com/api/badge/link?p=J9d+7zEGJS+BQMhX3FZDy2lWmzWp75oJZulj80NsvTrAkDEWcEC5PzkwUCDB/oqWGOfl1rwmFSi7crAJTxB6ww==)
77

88
Replace standard `ActiveRecord#to_sql` method with
99
[`anbt-sql-formatter`][anbt-sql-formatter-link]
@@ -22,21 +22,21 @@ Ruby 3.1+
2222

2323
## Rails
2424

25-
Rails 7.0+ (optional), will be injected automatically
25+
Rails / ActiveRecord 7.1+ (optional), will be injected automatically
2626

2727
## Legacy
2828

2929
You can use version `~> 0.2` of this gem with Ruby 2.2, 2.3 and/or Rails 4.0, 4.1
3030

3131
## Usage
3232

33-
```
33+
```text
3434
Post.first.to_sql
3535
```
3636

3737
for easy and clean usage with custom string you can use:
3838

39-
```
39+
```text
4040
class MyAwesomeDecoratedString < String
4141
include PpSql::ToSqlBeautify
4242
end
@@ -46,7 +46,7 @@ end
4646

4747
add in Gemfile
4848

49-
```
49+
```text
5050
gem 'pp_sql', group: :development
5151
```
5252

@@ -73,7 +73,7 @@ in initializers.
7373

7474
I found usefull this trick:
7575

76-
```
76+
```text
7777
class ApplicationRecord < ActiveRecord::Base
7878
include PpSql::ToSqlBeautify if defined?(Rails::Console)
7979
@@ -87,8 +87,23 @@ end
8787

8888
## Contributing
8989

90-
Running the tests requires sqlite. To run the tests for different combinations of dependency
91-
versions, run `bundle exec appraisal install` followed by `bundle exec appraisal rake`.
90+
Running the tests requires sqlite.
91+
92+
To refresh the generated appraisal gemfiles:
93+
94+
```bash
95+
bundle exec appraisal generate
96+
```
97+
98+
To run the maintained dependency matrix locally:
99+
100+
```bash
101+
bundle exec appraisal install
102+
bundle exec appraisal rake
103+
```
104+
105+
GitHub Actions runs the Rails / ActiveRecord `7.1`, `7.2`, `8.0`, and `8.1`
106+
matrix on Ruby `3.2`, `3.3`, and `3.4`.
92107

93108
## License
94109

gemfiles/activerecord_7_1.gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
source "https://rubygems.org"
44

5-
gem "concurrent-ruby", "1.3.4"
65
gem "minitest"
76
gem "minitest-focus"
87
gem "minitest-reporters"
8+
gem "tzinfo-data"
99
gem "activerecord", "~> 7.1.0"
1010
gem "rake"
1111
gem "sqlite3", "~> 2.0"

gemfiles/activerecord_7_2.gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
source "https://rubygems.org"
44

5-
gem "concurrent-ruby", "1.3.4"
65
gem "minitest"
76
gem "minitest-focus"
87
gem "minitest-reporters"
8+
gem "tzinfo-data"
99
gem "activerecord", "~> 7.2.0"
1010
gem "rake"
1111
gem "sqlite3", "~> 2.0"

gemfiles/activerecord_8_0.gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
source "https://rubygems.org"
44

5-
gem "concurrent-ruby", "1.3.4"
65
gem "minitest"
76
gem "minitest-focus"
87
gem "minitest-reporters"
8+
gem "tzinfo-data"
99
gem "activerecord", "~> 8.0.0"
1010
gem "rake"
1111
gem "sqlite3", "~> 2.0"
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22

33
source "https://rubygems.org"
44

5-
gem "concurrent-ruby", "1.3.4"
65
gem "minitest"
76
gem "minitest-focus"
87
gem "minitest-reporters"
9-
gem "activerecord", "~> 7.0.0"
8+
gem "tzinfo-data"
9+
gem "activerecord", "~> 8.1.0"
1010
gem "rake"
11-
gem "sqlite3", "~> 1.6"
11+
gem "sqlite3", "~> 2.0"
1212

1313
group :local_development do
1414

0 commit comments

Comments
 (0)