Skip to content

Commit 1380d42

Browse files
committed
Support Rails 7.2
1 parent 8e3debe commit 1380d42

File tree

15 files changed

+78
-60
lines changed

15 files changed

+78
-60
lines changed

.github/workflows/test.yml

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323

2424
# The test job is a matrix of ruby/rails versions.
2525
gha-job-authlogic-test:
26-
name: Ruby ${{ matrix.ruby }}, ${{ matrix.gemfile }}.rb
26+
name: Ruby ${{ matrix.ruby }}, Rails ${{ matrix.rails }}
2727
runs-on: ubuntu-latest
2828
services:
2929
gha-service-authlogic-mysql:
@@ -50,28 +50,30 @@ jobs:
5050
ports:
5151
- 5432:5432
5252
strategy:
53+
fail-fast: false
5354
# Unlike TravisCI, the database will not be part of the matrix. Each
5455
# sub-job in the matrix tests all three databases. Alternatively, we could
5556
# have set this up with each database as a separate job, but then we'd be
5657
# duplicating the matrix configuration three times.
5758
matrix:
58-
gemfile:
59-
["rails_5.2", "rails_6.0", "rails_6.1", "rails_7.0", "rails_7.1"]
60-
6159
# To keep matrix size down, only test highest and lowest rubies. In
62-
# `.rubocopy.yml`, set `TargetRubyVersion`, to the lowest ruby version
60+
# `.rubocop.yml`, set `TargetRubyVersion`, to the lowest ruby version
6361
# tested here.
64-
ruby: ["2.6", "2.7"]
65-
62+
ruby: ["2.6", "3.3"]
63+
rails: ["5.2", "6.0", "6.1", "7.0", "7.1", "7.2"]
6664
exclude:
6765
# rails 7 requires ruby >= 2.7.0
6866
- ruby: "2.6"
69-
gemfile: "rails_7.0"
67+
rails: "7.0"
7068
- ruby: "2.6"
71-
gemfile: "rails_7.1"
69+
rails: "7.1"
70+
- ruby: "2.6"
71+
rails: "7.2"
72+
- ruby: "3.3"
73+
rails: "5.2"
7274
steps:
7375
- name: Checkout source
74-
uses: actions/checkout@v2
76+
uses: actions/checkout@v4
7577
- name: Setup ruby
7678
uses: ruby/setup-ruby@v1
7779
with:
@@ -81,7 +83,7 @@ jobs:
8183
gem install bundler -v 2.4.22
8284
bundle install --jobs 4 --retry 3
8385
env:
84-
BUNDLE_GEMFILE: gemfiles/${{ matrix.gemfile }}.rb
86+
BUNDLE_GEMFILE: gemfiles/rails_${{ matrix.rails }}.rb
8587

8688
# MySQL db was created above, sqlite will be created during test suite,
8789
# when migrations occur, so we only need to create the postgres db. I
@@ -105,13 +107,13 @@ jobs:
105107
- name: Test, sqlite
106108
run: bundle exec rake test
107109
env:
108-
BUNDLE_GEMFILE: gemfiles/${{ matrix.gemfile }}.rb
110+
BUNDLE_GEMFILE: gemfiles/rails_${{ matrix.rails }}.rb
109111
DB: sqlite
110112
- name: Test, mysql
111113
run: bundle exec rake test
112114
env:
113115
BACKTRACE: 1
114-
BUNDLE_GEMFILE: gemfiles/${{ matrix.gemfile }}.rb
116+
BUNDLE_GEMFILE: gemfiles/rails_${{ matrix.rails }}.rb
115117
DB: mysql
116118
AUTHLOGIC_DB_NAME: authlogic
117119
AUTHLOGIC_DB_USER: root
@@ -121,7 +123,7 @@ jobs:
121123
run: bundle exec rake test
122124
env:
123125
BACKTRACE: 1
124-
BUNDLE_GEMFILE: gemfiles/${{ matrix.gemfile }}.rb
126+
BUNDLE_GEMFILE: gemfiles/rails_${{ matrix.rails }}.rb
125127
DB: postgres
126128
AUTHLOGIC_DB_NAME: authlogic
127129
AUTHLOGIC_DB_USER: postgres

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
1212
- Added
1313
- None
1414
- Fixed
15-
- None
15+
- [#770](https://github.com/binarylogic/authlogic/pull/770) - Adds support for Rails 7.2
1616

1717
## 6.4.3 (2023-12-17)
1818

CONTRIBUTING.md

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,16 @@ BUNDLE_GEMFILE=gemfiles/rails_7.0.rb bundle exec rake
5252
# Rails 7.1
5353
BUNDLE_GEMFILE=gemfiles/rails_7.1.rb bundle install
5454
BUNDLE_GEMFILE=gemfiles/rails_7.1.rb bundle exec rake
55+
56+
# Rails 7.2
57+
BUNDLE_GEMFILE=gemfiles/rails_7.2.rb bundle install
58+
BUNDLE_GEMFILE=gemfiles/rails_7.2.rb bundle exec rake
5559
```
5660

5761
To run a single test:
5862

5963
```
60-
BUNDLE_GEMFILE=gemfiles/rails_6.0.rb \
64+
BUNDLE_GEMFILE=gemfiles/rails_7.2.rb \
6165
bundle exec ruby -I test path/to/test.rb
6266
```
6367

@@ -72,14 +76,14 @@ ruby –I test path/to/test.rb
7276

7377
```
7478
mysql -e 'drop database authlogic; create database authlogic;' && \
75-
DB=mysql BUNDLE_GEMFILE=gemfiles/rails_5.2.rb bundle exec rake
79+
DB=mysql BUNDLE_GEMFILE=gemfiles/rails_7.2.rb bundle exec rake
7680
```
7781

7882
### Test PostgreSQL
7983

8084
```
8185
psql -c 'create database authlogic;' -U postgres
82-
DB=postgres BUNDLE_GEMFILE=gemfiles/rails_6.0.rb bundle exec rake
86+
DB=postgres BUNDLE_GEMFILE=gemfiles/rails_7.2.rb bundle exec rake
8387
```
8488

8589
### Linting
@@ -88,13 +92,13 @@ Running `rake` also runs a linter, rubocop. Contributions must pass both
8892
the linter and the tests. The linter can be run on its own.
8993

9094
```
91-
BUNDLE_GEMFILE=gemfiles/rails_6.0.rb bundle exec rubocop
95+
BUNDLE_GEMFILE=gemfiles/rails_7.2.rb bundle exec rubocop
9296
```
9397

9498
To run the tests without linting, use `rake test`.
9599

96100
```
97-
BUNDLE_GEMFILE=gemfiles/rails_6.0.rb bundle exec rake test
101+
BUNDLE_GEMFILE=gemfiles/rails_7.2.rb bundle exec rake test
98102
```
99103

100104
### Version Control Branches

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -490,7 +490,7 @@ in `authlogic/session/base.rb`.
490490

491491
| Version | branch | ruby | activerecord |
492492
| ------- | ---------- | -------- | ------------- |
493-
| 6.4.3 | 6-4-stable | >= 2.4.0 | >= 5.2, < 7.2 |
493+
| 6.4.3 | 6-4-stable | >= 2.4.0 | >= 5.2, < 8.0 |
494494
| 5.2 | 5-2-stable | >= 2.3.0 | >= 5.2, < 6.1 |
495495
| 4.5 | 4-5-stable | >= 2.3.0 | >= 4.2, < 5.3 |
496496
| 4.3 | 4-3-stable | >= 2.3.0 | >= 4.2, < 5.3 |

Rakefile

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,7 @@ Rake::TestTask.new(:test) do |test|
1212
test.verbose = false
1313

1414
# Set interpreter warning level to 2 (verbose)
15-
#
16-
# Warnings are set to 0 on TravisCI because it has a maximum
17-
# log length of 4MB and the following warning is printed thousands of times:
18-
#
19-
# > ../postgresql/database_statements.rb:24:
20-
# > warning: rb_tainted_str_new is deprecated and will be removed in Ruby 3.2.
21-
warning_level = ENV.fetch("TRAVIS", "false") == "true" ? 0 : 2
22-
test.ruby_opts += [format("-W%d", warning_level)]
15+
test.ruby_opts += [format("-W%d", 2)]
2316
end
2417

2518
require "rubocop/rake_task"

authlogic.gemspec

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,24 +25,21 @@ require "authlogic/version"
2525
s.required_ruby_version = ">= 2.6.0"
2626

2727
# See doc/rails_support_in_authlogic_5.0.md
28-
s.add_dependency "activemodel", [">= 5.2", "< 7.2"]
29-
s.add_dependency "activerecord", [">= 5.2", "< 7.2"]
30-
s.add_dependency "activesupport", [">= 5.2", "< 7.2"]
28+
s.add_dependency "activemodel", [">= 5.2", "< 8.0"]
29+
s.add_dependency "activerecord", [">= 5.2", "< 8.0"]
30+
s.add_dependency "activesupport", [">= 5.2", "< 8.0"]
3131
s.add_dependency "request_store", "~> 1.0"
3232
s.add_development_dependency "bcrypt", "~> 3.1"
33-
s.add_development_dependency "byebug", "~> 10.0"
34-
s.add_development_dependency "coveralls", "~> 0.8.22"
33+
s.add_development_dependency "byebug", "~> 11.1.3"
34+
s.add_development_dependency "coveralls_reborn", "~> 0.28.0"
3535
s.add_development_dependency "minitest", "< 5.19.0" # See https://github.com/binarylogic/authlogic/issues/766
3636
s.add_development_dependency "minitest-reporters", "~> 1.3"
37-
s.add_development_dependency "mysql2", "~> 0.5.2"
38-
s.add_development_dependency "pg", "~> 1.1.4"
3937
s.add_development_dependency "rake", "~> 13.0"
4038
s.add_development_dependency "rubocop", "~> 0.80.1"
4139
s.add_development_dependency "rubocop-performance", "~> 1.1"
4240
s.add_development_dependency "scrypt", ">= 1.2", "< 4.0"
43-
s.add_development_dependency "simplecov", "~> 0.16.1"
44-
s.add_development_dependency "simplecov-console", "~> 0.4.2"
45-
s.add_development_dependency "sqlite3", "~> 1.4.0"
41+
s.add_development_dependency "simplecov", "~> 0.22.0"
42+
s.add_development_dependency "simplecov-console", "~> 0.9.1"
4643
s.add_development_dependency "timecop", "~> 0.7"
4744

4845
# To reduce gem size, only the minimum files are included.

gemfiles/rails_5.2.rb

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,8 @@
33
source "https://rubygems.org"
44
gemspec path: ".."
55

6-
gem "activerecord", "~> 5.2.1"
7-
gem "activesupport", "~> 5.2.1"
6+
gem "activerecord", "~> 5.2.8.1"
7+
gem "activesupport", "~> 5.2.8.1"
8+
gem "mysql2", "~> 0.5.6"
9+
gem "pg", "~> 1.5.7"
10+
gem "sqlite3", "~> 1.4.0"

gemfiles/rails_6.0.rb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
source "https://rubygems.org"
44
gemspec path: ".."
55

6-
# Rails 6 beta 1 has been released, so you might expect us to use exactly that
7-
# version here, but it is still in flux, so we may continue using git for a
8-
# while, maybe until RC 1 is released.
9-
gem "activerecord", "~> 6.0.0"
10-
gem "activesupport", "~> 6.0.0"
6+
gem "activerecord", "~> 6.0.6.1"
7+
gem "activesupport", "~> 6.0.6.1"
8+
gem "mysql2", "~> 0.5.6"
9+
gem "pg", "~> 1.5.7"
10+
gem "sqlite3", "~> 1.4.0"

gemfiles/rails_6.1.rb

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,8 @@
33
source "https://rubygems.org"
44
gemspec path: ".."
55

6-
gem "activerecord", "~> 6.1.0"
7-
gem "activesupport", "~> 6.1.0"
6+
gem "activerecord", "~> 6.1.7.8"
7+
gem "activesupport", "~> 6.1.7.8"
8+
gem "mysql2", "~> 0.5.6"
9+
gem "pg", "~> 1.5.7"
10+
gem "sqlite3", "~> 1.4.0"

gemfiles/rails_7.0.rb

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
# frozen_string_literal: true
22

3-
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
4-
53
source "https://rubygems.org"
64
gemspec path: ".."
75

8-
gem "activerecord", "~> 7.0.0"
9-
gem "activesupport", "~> 7.0.0"
6+
gem "activerecord", "~> 7.0.8.4"
7+
gem "activesupport", "~> 7.0.8.4"
8+
gem "mysql2", "~> 0.5.6"
9+
gem "pg", "~> 1.5.7"
10+
gem "sqlite3", "~> 1.6.0"

0 commit comments

Comments
 (0)