From 1380d42c137756935e3d608ea6e42aa91db73178 Mon Sep 17 00:00:00 2001 From: Bohdan Zhuravel Date: Sat, 10 Aug 2024 13:18:19 +0300 Subject: [PATCH 1/7] Support Rails 7.2 --- .github/workflows/test.yml | 30 ++++++++++++++++-------------- CHANGELOG.md | 2 +- CONTRIBUTING.md | 14 +++++++++----- README.md | 2 +- Rakefile | 9 +-------- authlogic.gemspec | 17 +++++++---------- gemfiles/rails_5.2.rb | 7 +++++-- gemfiles/rails_6.0.rb | 10 +++++----- gemfiles/rails_6.1.rb | 7 +++++-- gemfiles/rails_7.0.rb | 9 +++++---- gemfiles/rails_7.1.rb | 9 +++++---- gemfiles/rails_7.2.rb | 10 ++++++++++ lib/authlogic/config.rb | 2 +- lib/authlogic/session/base.rb | 4 ++-- test/test_helper.rb | 6 +++++- 15 files changed, 78 insertions(+), 60 deletions(-) create mode 100644 gemfiles/rails_7.2.rb diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ec1a526b..b0950165 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -23,7 +23,7 @@ jobs: # The test job is a matrix of ruby/rails versions. gha-job-authlogic-test: - name: Ruby ${{ matrix.ruby }}, ${{ matrix.gemfile }}.rb + name: Ruby ${{ matrix.ruby }}, Rails ${{ matrix.rails }} runs-on: ubuntu-latest services: gha-service-authlogic-mysql: @@ -50,28 +50,30 @@ 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"] - # 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"] + rails: ["5.2", "6.0", "6.1", "7.0", "7.1", "7.2"] exclude: # rails 7 requires ruby >= 2.7.0 - ruby: "2.6" - gemfile: "rails_7.0" + rails: "7.0" - ruby: "2.6" - gemfile: "rails_7.1" + rails: "7.1" + - ruby: "2.6" + rails: "7.2" + - ruby: "3.3" + rails: "5.2" steps: - name: Checkout source - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Setup ruby uses: ruby/setup-ruby@v1 with: @@ -81,7 +83,7 @@ jobs: gem install bundler -v 2.4.22 bundle install --jobs 4 --retry 3 env: - BUNDLE_GEMFILE: gemfiles/${{ matrix.gemfile }}.rb + BUNDLE_GEMFILE: gemfiles/rails_${{ matrix.rails }}.rb # MySQL db was created above, sqlite will be created during test suite, # when migrations occur, so we only need to create the postgres db. I @@ -105,13 +107,13 @@ jobs: - name: Test, sqlite run: bundle exec rake test env: - BUNDLE_GEMFILE: gemfiles/${{ matrix.gemfile }}.rb + BUNDLE_GEMFILE: gemfiles/rails_${{ matrix.rails }}.rb DB: sqlite - name: Test, mysql run: bundle exec rake test env: BACKTRACE: 1 - BUNDLE_GEMFILE: gemfiles/${{ matrix.gemfile }}.rb + BUNDLE_GEMFILE: gemfiles/rails_${{ matrix.rails }}.rb DB: mysql AUTHLOGIC_DB_NAME: authlogic AUTHLOGIC_DB_USER: root @@ -121,7 +123,7 @@ jobs: run: bundle exec rake test env: BACKTRACE: 1 - BUNDLE_GEMFILE: gemfiles/${{ matrix.gemfile }}.rb + BUNDLE_GEMFILE: gemfiles/rails_${{ matrix.rails }}.rb DB: postgres AUTHLOGIC_DB_NAME: authlogic AUTHLOGIC_DB_USER: postgres diff --git a/CHANGELOG.md b/CHANGELOG.md index 22e94f97..4f2ea655 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index fdef8d9c..e72cb2ae 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -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 ``` @@ -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 @@ -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 diff --git a/README.md b/README.md index 42d7928c..abb5115d 100644 --- a/README.md +++ b/README.md @@ -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.3 | 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 | diff --git a/Rakefile b/Rakefile index c7682564..3c7437da 100644 --- a/Rakefile +++ b/Rakefile @@ -12,14 +12,7 @@ Rake::TestTask.new(:test) do |test| test.verbose = false # Set interpreter warning level to 2 (verbose) - # - # Warnings are set to 0 on TravisCI because it has a maximum - # log length of 4MB and the following warning is printed thousands of times: - # - # > ../postgresql/database_statements.rb:24: - # > warning: rb_tainted_str_new is deprecated and will be removed in Ruby 3.2. - warning_level = ENV.fetch("TRAVIS", "false") == "true" ? 0 : 2 - test.ruby_opts += [format("-W%d", warning_level)] + test.ruby_opts += [format("-W%d", 2)] end require "rubocop/rake_task" diff --git a/authlogic.gemspec b/authlogic.gemspec index e92abf31..c57f4851 100644 --- a/authlogic.gemspec +++ b/authlogic.gemspec @@ -25,24 +25,21 @@ 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" - s.add_development_dependency "coveralls", "~> 0.8.22" + s.add_development_dependency "byebug", "~> 11.1.3" + s.add_development_dependency "coveralls_reborn", "~> 0.28.0" s.add_development_dependency "minitest", "< 5.19.0" # See https://github.com/binarylogic/authlogic/issues/766 s.add_development_dependency "minitest-reporters", "~> 1.3" - s.add_development_dependency "mysql2", "~> 0.5.2" - s.add_development_dependency "pg", "~> 1.1.4" s.add_development_dependency "rake", "~> 13.0" s.add_development_dependency "rubocop", "~> 0.80.1" s.add_development_dependency "rubocop-performance", "~> 1.1" s.add_development_dependency "scrypt", ">= 1.2", "< 4.0" - s.add_development_dependency "simplecov", "~> 0.16.1" - s.add_development_dependency "simplecov-console", "~> 0.4.2" - s.add_development_dependency "sqlite3", "~> 1.4.0" + s.add_development_dependency "simplecov", "~> 0.22.0" + s.add_development_dependency "simplecov-console", "~> 0.9.1" s.add_development_dependency "timecop", "~> 0.7" # To reduce gem size, only the minimum files are included. diff --git a/gemfiles/rails_5.2.rb b/gemfiles/rails_5.2.rb index 7be12501..c419ef83 100644 --- a/gemfiles/rails_5.2.rb +++ b/gemfiles/rails_5.2.rb @@ -3,5 +3,8 @@ source "https://rubygems.org" gemspec path: ".." -gem "activerecord", "~> 5.2.1" -gem "activesupport", "~> 5.2.1" +gem "activerecord", "~> 5.2.8.1" +gem "activesupport", "~> 5.2.8.1" +gem "mysql2", "~> 0.5.6" +gem "pg", "~> 1.5.7" +gem "sqlite3", "~> 1.4.0" diff --git a/gemfiles/rails_6.0.rb b/gemfiles/rails_6.0.rb index c4a6fed0..9e1db397 100644 --- a/gemfiles/rails_6.0.rb +++ b/gemfiles/rails_6.0.rb @@ -3,8 +3,8 @@ source "https://rubygems.org" gemspec path: ".." -# Rails 6 beta 1 has been released, so you might expect us to use exactly that -# version here, but it is still in flux, so we may continue using git for a -# while, maybe until RC 1 is released. -gem "activerecord", "~> 6.0.0" -gem "activesupport", "~> 6.0.0" +gem "activerecord", "~> 6.0.6.1" +gem "activesupport", "~> 6.0.6.1" +gem "mysql2", "~> 0.5.6" +gem "pg", "~> 1.5.7" +gem "sqlite3", "~> 1.4.0" diff --git a/gemfiles/rails_6.1.rb b/gemfiles/rails_6.1.rb index 7d0571ac..52655284 100644 --- a/gemfiles/rails_6.1.rb +++ b/gemfiles/rails_6.1.rb @@ -3,5 +3,8 @@ source "https://rubygems.org" gemspec path: ".." -gem "activerecord", "~> 6.1.0" -gem "activesupport", "~> 6.1.0" +gem "activerecord", "~> 6.1.7.8" +gem "activesupport", "~> 6.1.7.8" +gem "mysql2", "~> 0.5.6" +gem "pg", "~> 1.5.7" +gem "sqlite3", "~> 1.4.0" diff --git a/gemfiles/rails_7.0.rb b/gemfiles/rails_7.0.rb index 3729980d..e6eea0ed 100644 --- a/gemfiles/rails_7.0.rb +++ b/gemfiles/rails_7.0.rb @@ -1,9 +1,10 @@ # frozen_string_literal: true -git_source(:github) { |repo| "https://github.com/#{repo}.git" } - source "https://rubygems.org" gemspec path: ".." -gem "activerecord", "~> 7.0.0" -gem "activesupport", "~> 7.0.0" +gem "activerecord", "~> 7.0.8.4" +gem "activesupport", "~> 7.0.8.4" +gem "mysql2", "~> 0.5.6" +gem "pg", "~> 1.5.7" +gem "sqlite3", "~> 1.6.0" diff --git a/gemfiles/rails_7.1.rb b/gemfiles/rails_7.1.rb index 8166c832..1425a627 100644 --- a/gemfiles/rails_7.1.rb +++ b/gemfiles/rails_7.1.rb @@ -1,9 +1,10 @@ # frozen_string_literal: true -git_source(:github) { |repo| "https://github.com/#{repo}.git" } - source "https://rubygems.org" gemspec path: ".." -gem "activerecord", "~> 7.1.0" -gem "activesupport", "~> 7.1.0" +gem "activerecord", "~> 7.1.3.4" +gem "activesupport", "~> 7.1.3.4" +gem "mysql2", "~> 0.5.6" +gem "pg", "~> 1.5.7" +gem "sqlite3", "~> 1.6.0" diff --git a/gemfiles/rails_7.2.rb b/gemfiles/rails_7.2.rb new file mode 100644 index 00000000..3710dbbb --- /dev/null +++ b/gemfiles/rails_7.2.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +source "https://rubygems.org" +gemspec path: ".." + +gem "activerecord", "~> 7.2.0" +gem "activesupport", "~> 7.2.0" +gem "mysql2", "~> 0.5.6" +gem "pg", "~> 1.5.7" +gem "sqlite3", "~> 2.0.0" diff --git a/lib/authlogic/config.rb b/lib/authlogic/config.rb index 1dacb183..2e2aa2a5 100644 --- a/lib/authlogic/config.rb +++ b/lib/authlogic/config.rb @@ -24,7 +24,7 @@ def self.extended(klass) private def deprecate_authlogic_config(method_name) - ::ActiveSupport::Deprecation.warn( + ::ActiveSupport::Deprecation.new.warn( format(E_USE_NORMAL_RAILS_VALIDATION, method_name) ) end diff --git a/lib/authlogic/session/base.rb b/lib/authlogic/session/base.rb index e3ec415c..716b658a 100644 --- a/lib/authlogic/session/base.rb +++ b/lib/authlogic/session/base.rb @@ -673,7 +673,7 @@ def find(id = nil, priority_record = nil) # @deprecated in favor of record_selection_method def find_by_login_method(value = nil) - ::ActiveSupport::Deprecation.warn(E_DPR_FIND_BY_LOGIN_METHOD) + ::ActiveSupport::Deprecation.new.warn(E_DPR_FIND_BY_LOGIN_METHOD) record_selection_method(value) end alias find_by_login_method= find_by_login_method @@ -1791,7 +1791,7 @@ def exceeded_failed_logins_limit? # @deprecated in favor of `self.class.record_selection_method` def find_by_login_method - ::ActiveSupport::Deprecation.warn(E_DPR_FIND_BY_LOGIN_METHOD) + ::ActiveSupport::Deprecation.new.warn(E_DPR_FIND_BY_LOGIN_METHOD) self.class.record_selection_method end diff --git a/test/test_helper.rb b/test/test_helper.rb index f61669c4..fa4ddeee 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -183,7 +183,11 @@ module ActiveSupport class TestCase include ActiveRecord::TestFixtures - self.fixture_path = File.dirname(__FILE__) + "/fixtures" + if respond_to?(:fixture_paths=) + self.fixture_paths = [File.dirname(__FILE__) + "/fixtures"] + else + self.fixture_path = File.dirname(__FILE__) + "/fixtures" + end # use_transactional_fixtures= is deprecated and will be removed from Rails 5.1 # (use use_transactional_tests= instead) From 135be7fd9c776abe77d3382b77a0b60c60ade426 Mon Sep 17 00:00:00 2001 From: Bohdan Zhuravel Date: Mon, 12 Aug 2024 22:35:17 +0300 Subject: [PATCH 2/7] Explain `fixture_paths=` --- test/test_helper.rb | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/test/test_helper.rb b/test/test_helper.rb index fa4ddeee..9c96aab3 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -183,14 +183,17 @@ module ActiveSupport class TestCase include ActiveRecord::TestFixtures + + # `fixture_path=` was deprecated in favor of + # `fixture_paths=` in Rails 7.1, removed in Rails 7.2. if respond_to?(:fixture_paths=) self.fixture_paths = [File.dirname(__FILE__) + "/fixtures"] else self.fixture_path = File.dirname(__FILE__) + "/fixtures" end - # use_transactional_fixtures= is deprecated and will be removed from Rails 5.1 - # (use use_transactional_tests= instead) + # `use_transactional_fixtures=` was deprecated in favor of + # `use_transactional_tests=` in Rails 5.0, removed in Rails 5.1. if respond_to?(:use_transactional_tests=) self.use_transactional_tests = false else From 5b0f588450b94ef97d0b183418c6cd37d2e6829d Mon Sep 17 00:00:00 2001 From: Bohdan Zhuravel Date: Mon, 12 Aug 2024 22:41:38 +0300 Subject: [PATCH 3/7] Cleanup since the gem supports Rails 5.2+ --- test/test_helper.rb | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/test/test_helper.rb b/test/test_helper.rb index 9c96aab3..30c9561f 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -192,14 +192,7 @@ class TestCase self.fixture_path = File.dirname(__FILE__) + "/fixtures" end - # `use_transactional_fixtures=` was deprecated in favor of - # `use_transactional_tests=` in Rails 5.0, removed in Rails 5.1. - if respond_to?(:use_transactional_tests=) - self.use_transactional_tests = false - else - self.use_transactional_fixtures = false - end - + self.use_transactional_tests = false self.use_instantiated_fixtures = false self.pre_loaded_fixtures = false fixtures :all From 755343cf613e58f6a3c1b25a73f4432ac205017d Mon Sep 17 00:00:00 2001 From: Bohdan Zhuravel Date: Fri, 16 Aug 2024 16:55:09 +0300 Subject: [PATCH 4/7] Cleanup --- Rakefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Rakefile b/Rakefile index 3c7437da..5828c10d 100644 --- a/Rakefile +++ b/Rakefile @@ -12,7 +12,7 @@ Rake::TestTask.new(:test) do |test| test.verbose = false # Set interpreter warning level to 2 (verbose) - test.ruby_opts += [format("-W%d", 2)] + test.ruby_opts << "-W2" end require "rubocop/rake_task" From 261891ef6033d0bc5e2081c06691bec06fdeea70 Mon Sep 17 00:00:00 2001 From: Bohdan Zhuravel Date: Fri, 23 Aug 2024 13:55:47 +0300 Subject: [PATCH 5/7] Cleanup --- gemfiles/rails_5.2.rb | 4 ++-- gemfiles/rails_6.0.rb | 4 ++-- gemfiles/rails_6.1.rb | 4 ++-- gemfiles/rails_7.0.rb | 4 ++-- gemfiles/rails_7.1.rb | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/gemfiles/rails_5.2.rb b/gemfiles/rails_5.2.rb index c419ef83..2bc3332a 100644 --- a/gemfiles/rails_5.2.rb +++ b/gemfiles/rails_5.2.rb @@ -3,8 +3,8 @@ source "https://rubygems.org" gemspec path: ".." -gem "activerecord", "~> 5.2.8.1" -gem "activesupport", "~> 5.2.8.1" +gem "activerecord", "~> 5.2.0" +gem "activesupport", "~> 5.2.0" gem "mysql2", "~> 0.5.6" gem "pg", "~> 1.5.7" gem "sqlite3", "~> 1.4.0" diff --git a/gemfiles/rails_6.0.rb b/gemfiles/rails_6.0.rb index 9e1db397..9e2d6b31 100644 --- a/gemfiles/rails_6.0.rb +++ b/gemfiles/rails_6.0.rb @@ -3,8 +3,8 @@ source "https://rubygems.org" gemspec path: ".." -gem "activerecord", "~> 6.0.6.1" -gem "activesupport", "~> 6.0.6.1" +gem "activerecord", "~> 6.0.0" +gem "activesupport", "~> 6.0.0" gem "mysql2", "~> 0.5.6" gem "pg", "~> 1.5.7" gem "sqlite3", "~> 1.4.0" diff --git a/gemfiles/rails_6.1.rb b/gemfiles/rails_6.1.rb index 52655284..4b9e1c13 100644 --- a/gemfiles/rails_6.1.rb +++ b/gemfiles/rails_6.1.rb @@ -3,8 +3,8 @@ source "https://rubygems.org" gemspec path: ".." -gem "activerecord", "~> 6.1.7.8" -gem "activesupport", "~> 6.1.7.8" +gem "activerecord", "~> 6.1.0" +gem "activesupport", "~> 6.1.0" gem "mysql2", "~> 0.5.6" gem "pg", "~> 1.5.7" gem "sqlite3", "~> 1.4.0" diff --git a/gemfiles/rails_7.0.rb b/gemfiles/rails_7.0.rb index e6eea0ed..e919463d 100644 --- a/gemfiles/rails_7.0.rb +++ b/gemfiles/rails_7.0.rb @@ -3,8 +3,8 @@ source "https://rubygems.org" gemspec path: ".." -gem "activerecord", "~> 7.0.8.4" -gem "activesupport", "~> 7.0.8.4" +gem "activerecord", "~> 7.0.0" +gem "activesupport", "~> 7.0.0" gem "mysql2", "~> 0.5.6" gem "pg", "~> 1.5.7" gem "sqlite3", "~> 1.6.0" diff --git a/gemfiles/rails_7.1.rb b/gemfiles/rails_7.1.rb index 1425a627..c247ed79 100644 --- a/gemfiles/rails_7.1.rb +++ b/gemfiles/rails_7.1.rb @@ -3,8 +3,8 @@ source "https://rubygems.org" gemspec path: ".." -gem "activerecord", "~> 7.1.3.4" -gem "activesupport", "~> 7.1.3.4" +gem "activerecord", "~> 7.1.0" +gem "activesupport", "~> 7.1.0" gem "mysql2", "~> 0.5.6" gem "pg", "~> 1.5.7" gem "sqlite3", "~> 1.6.0" From 3cd77fb5e30efa0b34ba0a90c47826414e0fa0f2 Mon Sep 17 00:00:00 2001 From: Bohdan Zhuravel Date: Tue, 22 Oct 2024 15:12:43 +0300 Subject: [PATCH 6/7] Support Rails 8.0 --- .github/workflows/test.yml | 4 +++- CHANGELOG.md | 2 +- CONTRIBUTING.md | 14 +++++++++----- README.md | 2 +- authlogic.gemspec | 6 +++--- gemfiles/rails_5.2.rb | 2 +- gemfiles/rails_6.0.rb | 2 +- gemfiles/rails_6.1.rb | 2 +- gemfiles/rails_7.0.rb | 2 +- gemfiles/rails_7.1.rb | 2 +- gemfiles/rails_7.2.rb | 2 +- gemfiles/rails_8.0.rb | 10 ++++++++++ 12 files changed, 33 insertions(+), 17 deletions(-) create mode 100644 gemfiles/rails_8.0.rb diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b0950165..7e94c7bd 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -60,7 +60,7 @@ jobs: # `.rubocop.yml`, set `TargetRubyVersion`, to the lowest ruby version # tested here. ruby: ["2.6", "3.3"] - rails: ["5.2", "6.0", "6.1", "7.0", "7.1", "7.2"] + rails: ["5.2", "6.0", "6.1", "7.0", "7.1", "7.2", "8.0"] exclude: # rails 7 requires ruby >= 2.7.0 - ruby: "2.6" @@ -69,6 +69,8 @@ jobs: rails: "7.1" - ruby: "2.6" rails: "7.2" + - ruby: "2.6" + rails: "8.0" - ruby: "3.3" rails: "5.2" steps: diff --git a/CHANGELOG.md b/CHANGELOG.md index 4f2ea655..52a980e9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,7 +12,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Added - None - Fixed - - [#770](https://github.com/binarylogic/authlogic/pull/770) - Adds support for Rails 7.2 + - [#770](https://github.com/binarylogic/authlogic/pull/770) - Adds support for Rails 7.2 and 8.0 ## 6.4.3 (2023-12-17) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index e72cb2ae..d5cb3118 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -56,12 +56,16 @@ 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 + +# Rails 8.0 +BUNDLE_GEMFILE=gemfiles/rails_8.0.rb bundle install +BUNDLE_GEMFILE=gemfiles/rails_8.0.rb bundle exec rake ``` To run a single test: ``` -BUNDLE_GEMFILE=gemfiles/rails_7.2.rb \ +BUNDLE_GEMFILE=gemfiles/rails_8.0.rb \ bundle exec ruby -I test path/to/test.rb ``` @@ -76,14 +80,14 @@ ruby –I test path/to/test.rb ``` mysql -e 'drop database authlogic; create database authlogic;' && \ - DB=mysql BUNDLE_GEMFILE=gemfiles/rails_7.2.rb bundle exec rake + DB=mysql BUNDLE_GEMFILE=gemfiles/rails_8.0.rb bundle exec rake ``` ### Test PostgreSQL ``` psql -c 'create database authlogic;' -U postgres -DB=postgres BUNDLE_GEMFILE=gemfiles/rails_7.2.rb bundle exec rake +DB=postgres BUNDLE_GEMFILE=gemfiles/rails_8.0.rb bundle exec rake ``` ### Linting @@ -92,13 +96,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_7.2.rb bundle exec rubocop +BUNDLE_GEMFILE=gemfiles/rails_8.0.rb bundle exec rubocop ``` To run the tests without linting, use `rake test`. ``` -BUNDLE_GEMFILE=gemfiles/rails_7.2.rb bundle exec rake test +BUNDLE_GEMFILE=gemfiles/rails_8.0.rb bundle exec rake test ``` ### Version Control Branches diff --git a/README.md b/README.md index abb5115d..5e2a95ce 100644 --- a/README.md +++ b/README.md @@ -490,7 +490,7 @@ in `authlogic/session/base.rb`. | Version | branch | ruby | activerecord | | ------- | ---------- | -------- | ------------- | -| 6.4.3 | 6-4-stable | >= 2.4.0 | >= 5.2, < 8.0 | +| 6.4.3 | 6-4-stable | >= 2.4.0 | >= 5.2, < 8.1 | | 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 | diff --git a/authlogic.gemspec b/authlogic.gemspec index c57f4851..d0eb418c 100644 --- a/authlogic.gemspec +++ b/authlogic.gemspec @@ -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", "< 8.0"] - s.add_dependency "activerecord", [">= 5.2", "< 8.0"] - s.add_dependency "activesupport", [">= 5.2", "< 8.0"] + s.add_dependency "activemodel", [">= 5.2", "< 8.1"] + s.add_dependency "activerecord", [">= 5.2", "< 8.1"] + s.add_dependency "activesupport", [">= 5.2", "< 8.1"] s.add_dependency "request_store", "~> 1.0" s.add_development_dependency "bcrypt", "~> 3.1" s.add_development_dependency "byebug", "~> 11.1.3" diff --git a/gemfiles/rails_5.2.rb b/gemfiles/rails_5.2.rb index 2bc3332a..4840c6f5 100644 --- a/gemfiles/rails_5.2.rb +++ b/gemfiles/rails_5.2.rb @@ -6,5 +6,5 @@ gem "activerecord", "~> 5.2.0" gem "activesupport", "~> 5.2.0" gem "mysql2", "~> 0.5.6" -gem "pg", "~> 1.5.7" +gem "pg", "~> 1.5.8" gem "sqlite3", "~> 1.4.0" diff --git a/gemfiles/rails_6.0.rb b/gemfiles/rails_6.0.rb index 9e2d6b31..69147ebe 100644 --- a/gemfiles/rails_6.0.rb +++ b/gemfiles/rails_6.0.rb @@ -6,5 +6,5 @@ gem "activerecord", "~> 6.0.0" gem "activesupport", "~> 6.0.0" gem "mysql2", "~> 0.5.6" -gem "pg", "~> 1.5.7" +gem "pg", "~> 1.5.8" gem "sqlite3", "~> 1.4.0" diff --git a/gemfiles/rails_6.1.rb b/gemfiles/rails_6.1.rb index 4b9e1c13..ed03ee5b 100644 --- a/gemfiles/rails_6.1.rb +++ b/gemfiles/rails_6.1.rb @@ -6,5 +6,5 @@ gem "activerecord", "~> 6.1.0" gem "activesupport", "~> 6.1.0" gem "mysql2", "~> 0.5.6" -gem "pg", "~> 1.5.7" +gem "pg", "~> 1.5.8" gem "sqlite3", "~> 1.4.0" diff --git a/gemfiles/rails_7.0.rb b/gemfiles/rails_7.0.rb index e919463d..1fdddbbc 100644 --- a/gemfiles/rails_7.0.rb +++ b/gemfiles/rails_7.0.rb @@ -6,5 +6,5 @@ gem "activerecord", "~> 7.0.0" gem "activesupport", "~> 7.0.0" gem "mysql2", "~> 0.5.6" -gem "pg", "~> 1.5.7" +gem "pg", "~> 1.5.8" gem "sqlite3", "~> 1.6.0" diff --git a/gemfiles/rails_7.1.rb b/gemfiles/rails_7.1.rb index c247ed79..fecba797 100644 --- a/gemfiles/rails_7.1.rb +++ b/gemfiles/rails_7.1.rb @@ -6,5 +6,5 @@ gem "activerecord", "~> 7.1.0" gem "activesupport", "~> 7.1.0" gem "mysql2", "~> 0.5.6" -gem "pg", "~> 1.5.7" +gem "pg", "~> 1.5.8" gem "sqlite3", "~> 1.6.0" diff --git a/gemfiles/rails_7.2.rb b/gemfiles/rails_7.2.rb index 3710dbbb..8904a020 100644 --- a/gemfiles/rails_7.2.rb +++ b/gemfiles/rails_7.2.rb @@ -6,5 +6,5 @@ gem "activerecord", "~> 7.2.0" gem "activesupport", "~> 7.2.0" gem "mysql2", "~> 0.5.6" -gem "pg", "~> 1.5.7" +gem "pg", "~> 1.5.8" gem "sqlite3", "~> 2.0.0" diff --git a/gemfiles/rails_8.0.rb b/gemfiles/rails_8.0.rb new file mode 100644 index 00000000..f75c48e4 --- /dev/null +++ b/gemfiles/rails_8.0.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +source "https://rubygems.org" +gemspec path: ".." + +gem "activerecord", "~> 8.0.0.beta" +gem "activesupport", "~> 8.0.0.beta" +gem "mysql2", "~> 0.5.6" +gem "pg", "~> 1.5.8" +gem "sqlite3", "~> 2.1.0" From 318c758ad5cc8901a0d4c52c90af28519e0f8d19 Mon Sep 17 00:00:00 2001 From: Bohdan Zhuravel Date: Fri, 8 Nov 2024 11:45:26 +0200 Subject: [PATCH 7/7] Cleanup --- gemfiles/rails_8.0.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gemfiles/rails_8.0.rb b/gemfiles/rails_8.0.rb index f75c48e4..f7270f39 100644 --- a/gemfiles/rails_8.0.rb +++ b/gemfiles/rails_8.0.rb @@ -3,8 +3,8 @@ source "https://rubygems.org" gemspec path: ".." -gem "activerecord", "~> 8.0.0.beta" -gem "activesupport", "~> 8.0.0.beta" +gem "activerecord", "~> 8.0.0" +gem "activesupport", "~> 8.0.0" gem "mysql2", "~> 0.5.6" gem "pg", "~> 1.5.8" gem "sqlite3", "~> 2.1.0"