diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ec1a526b..92179df4 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -50,18 +50,19 @@ 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 @@ -69,9 +70,13 @@ jobs: gemfile: "rails_7.0" - ruby: "2.6" gemfile: "rails_7.1" + - ruby: "2.6" + gemfile: "rails_7.2" + - ruby: "3.3" + gemfile: "rails_5.2" steps: - name: Checkout source - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Setup ruby uses: ruby/setup-ruby@v1 with: 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)