Skip to content

Commit

Permalink
Support Rails 7.2
Browse files Browse the repository at this point in the history
  • Loading branch information
zhuravel committed Aug 10, 2024
1 parent 8e3debe commit 9cc8ed6
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 15 deletions.
11 changes: 7 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,28 +50,31 @@ jobs:
ports:
- 5432:5432
strategy:
fail-fast: false
# Unlike TravisCI, the database will not be part of the matrix. Each
# sub-job in the matrix tests all three databases. Alternatively, we could
# have set this up with each database as a separate job, but then we'd be
# duplicating the matrix configuration three times.
matrix:
gemfile:
["rails_5.2", "rails_6.0", "rails_6.1", "rails_7.0", "rails_7.1"]
["rails_5.2", "rails_6.0", "rails_6.1", "rails_7.0", "rails_7.1", "rails_7.2"]

# To keep matrix size down, only test highest and lowest rubies. In
# `.rubocopy.yml`, set `TargetRubyVersion`, to the lowest ruby version
# `.rubocop.yml`, set `TargetRubyVersion`, to the lowest ruby version
# tested here.
ruby: ["2.6", "2.7"]
ruby: ["2.6", "3.3"]

exclude:
# rails 7 requires ruby >= 2.7.0
- ruby: "2.6"
gemfile: "rails_7.0"
- ruby: "2.6"
gemfile: "rails_7.1"
- ruby: "2.6"
gemfile: "rails_7.2"
steps:
- name: Checkout source
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Setup ruby
uses: ruby/setup-ruby@v1
with:
Expand Down
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- Added
- None
- Fixed
- None
- [#770](https://github.com/binarylogic/authlogic/pull/770) - Adds support for Rails 7.2

## 6.4.3 (2023-12-17)

Expand Down
14 changes: 9 additions & 5 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,16 @@ BUNDLE_GEMFILE=gemfiles/rails_7.0.rb bundle exec rake
# Rails 7.1
BUNDLE_GEMFILE=gemfiles/rails_7.1.rb bundle install
BUNDLE_GEMFILE=gemfiles/rails_7.1.rb bundle exec rake
# Rails 7.2
BUNDLE_GEMFILE=gemfiles/rails_7.2.rb bundle install
BUNDLE_GEMFILE=gemfiles/rails_7.2.rb bundle exec rake
```

To run a single test:

```
BUNDLE_GEMFILE=gemfiles/rails_6.0.rb \
BUNDLE_GEMFILE=gemfiles/rails_7.2.rb \
bundle exec ruby -I test path/to/test.rb
```

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

```
mysql -e 'drop database authlogic; create database authlogic;' && \
DB=mysql BUNDLE_GEMFILE=gemfiles/rails_5.2.rb bundle exec rake
DB=mysql BUNDLE_GEMFILE=gemfiles/rails_7.2.rb bundle exec rake
```

### Test PostgreSQL

```
psql -c 'create database authlogic;' -U postgres
DB=postgres BUNDLE_GEMFILE=gemfiles/rails_6.0.rb bundle exec rake
DB=postgres BUNDLE_GEMFILE=gemfiles/rails_7.2.rb bundle exec rake
```

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

```
BUNDLE_GEMFILE=gemfiles/rails_6.0.rb bundle exec rubocop
BUNDLE_GEMFILE=gemfiles/rails_7.2.rb bundle exec rubocop
```

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

```
BUNDLE_GEMFILE=gemfiles/rails_6.0.rb bundle exec rake test
BUNDLE_GEMFILE=gemfiles/rails_7.2.rb bundle exec rake test
```

### Version Control Branches
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -490,7 +490,7 @@ in `authlogic/session/base.rb`.

| Version | branch | ruby | activerecord |
| ------- | ---------- | -------- | ------------- |
| 6.4.3 | 6-4-stable | >= 2.4.0 | >= 5.2, < 7.2 |
| 6.4.4 | 6-4-stable | >= 2.4.0 | >= 5.2, < 8.0 |
| 5.2 | 5-2-stable | >= 2.3.0 | >= 5.2, < 6.1 |
| 4.5 | 4-5-stable | >= 2.3.0 | >= 4.2, < 5.3 |
| 4.3 | 4-3-stable | >= 2.3.0 | >= 4.2, < 5.3 |
Expand Down
6 changes: 3 additions & 3 deletions authlogic.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ require "authlogic/version"
s.required_ruby_version = ">= 2.6.0"

# See doc/rails_support_in_authlogic_5.0.md
s.add_dependency "activemodel", [">= 5.2", "< 7.2"]
s.add_dependency "activerecord", [">= 5.2", "< 7.2"]
s.add_dependency "activesupport", [">= 5.2", "< 7.2"]
s.add_dependency "activemodel", [">= 5.2", "< 8.0"]
s.add_dependency "activerecord", [">= 5.2", "< 8.0"]
s.add_dependency "activesupport", [">= 5.2", "< 8.0"]
s.add_dependency "request_store", "~> 1.0"
s.add_development_dependency "bcrypt", "~> 3.1"
s.add_development_dependency "byebug", "~> 10.0"
Expand Down
9 changes: 9 additions & 0 deletions gemfiles/rails_7.2.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# frozen_string_literal: true

git_source(:github) { |repo| "https://github.com/#{repo}.git" }

source "https://rubygems.org"
gemspec path: ".."

gem "activerecord", "~> 7.2.0"
gem "activesupport", "~> 7.2.0"
2 changes: 1 addition & 1 deletion lib/authlogic/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ module Authlogic
#
# @api public
def self.gem_version
::Gem::Version.new("6.4.3")
::Gem::Version.new("6.4.4")
end
end

0 comments on commit 9cc8ed6

Please sign in to comment.