diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 1cd2c507..66dfc529 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -20,43 +20,12 @@ jobs: - '3.2' - '3.1' - '3.0' - - '2.7' - - '2.6' - - '2.5' - - '2.4' - - '2.3' - - '2.2' - - '2.1' env: - DEVISE_ORM=active_record - DEVISE_ORM=mongoid exclude: - - gemfile: Gemfile - ruby: '2.6' - - gemfile: Gemfile - ruby: '2.5' - - gemfile: Gemfile - ruby: '2.4' - - gemfile: Gemfile - ruby: '2.3' - - gemfile: Gemfile - ruby: '2.2' - - gemfile: Gemfile - ruby: '2.1' - gemfile: Gemfile env: DEVISE_ORM=mongoid - - gemfile: gemfiles/Gemfile-rails-main - ruby: '2.6' - - gemfile: gemfiles/Gemfile-rails-main - ruby: '2.5' - - gemfile: gemfiles/Gemfile-rails-main - ruby: '2.4' - - gemfile: gemfiles/Gemfile-rails-main - ruby: '2.3' - - gemfile: gemfiles/Gemfile-rails-main - ruby: '2.2' - - gemfile: gemfiles/Gemfile-rails-main - ruby: '2.1' - gemfile: gemfiles/Gemfile-rails-main env: DEVISE_ORM=mongoid - gemfile: gemfiles/Gemfile-rails-7-0 @@ -73,28 +42,12 @@ jobs: ruby: '2.1' - gemfile: gemfiles/Gemfile-rails-7-0 env: DEVISE_ORM=mongoid - - gemfile: gemfiles/Gemfile-rails-6-1 - ruby: '2.4' - - gemfile: gemfiles/Gemfile-rails-6-1 - ruby: '2.3' - - gemfile: gemfiles/Gemfile-rails-6-1 - ruby: '2.2' - - gemfile: gemfiles/Gemfile-rails-6-1 - ruby: '2.1' - gemfile: gemfiles/Gemfile-rails-6-1 env: DEVISE_ORM=mongoid - gemfile: gemfiles/Gemfile-rails-6-0 ruby: '3.2' - gemfile: gemfiles/Gemfile-rails-6-0 ruby: '3.1' - - gemfile: gemfiles/Gemfile-rails-6-0 - ruby: '2.4' - - gemfile: gemfiles/Gemfile-rails-6-0 - ruby: '2.3' - - gemfile: gemfiles/Gemfile-rails-6-0 - ruby: '2.2' - - gemfile: gemfiles/Gemfile-rails-6-0 - ruby: '2.1' - gemfile: gemfiles/Gemfile-rails-6-0 env: DEVISE_ORM=mongoid - gemfile: gemfiles/Gemfile-rails-5-2 @@ -103,12 +56,6 @@ jobs: ruby: '3.1' - gemfile: gemfiles/Gemfile-rails-5-2 ruby: '3.0' - - gemfile: gemfiles/Gemfile-rails-5-2 - ruby: '2.7' - - gemfile: gemfiles/Gemfile-rails-5-2 - ruby: '2.2' - - gemfile: gemfiles/Gemfile-rails-5-2 - ruby: '2.1' - gemfile: gemfiles/Gemfile-rails-5-2 env: DEVISE_ORM=mongoid - gemfile: gemfiles/Gemfile-rails-5-1 @@ -117,10 +64,6 @@ jobs: ruby: '3.1' - gemfile: gemfiles/Gemfile-rails-5-1 ruby: '3.0' - - gemfile: gemfiles/Gemfile-rails-5-1 - ruby: '2.7' - - gemfile: gemfiles/Gemfile-rails-5-1 - ruby: '2.1' - gemfile: gemfiles/Gemfile-rails-5-1 env: DEVISE_ORM=mongoid - gemfile: gemfiles/Gemfile-rails-5-0 @@ -129,10 +72,6 @@ jobs: ruby: '3.1' - gemfile: gemfiles/Gemfile-rails-5-0 ruby: '3.0' - - gemfile: gemfiles/Gemfile-rails-5-0 - ruby: '2.7' - - gemfile: gemfiles/Gemfile-rails-5-0 - ruby: '2.1' - gemfile: gemfiles/Gemfile-rails-5-0 env: DEVISE_ORM=mongoid - gemfile: gemfiles/Gemfile-rails-4-2 @@ -141,24 +80,12 @@ jobs: ruby: '3.1' - gemfile: gemfiles/Gemfile-rails-4-2 ruby: '3.0' - - gemfile: gemfiles/Gemfile-rails-4-2 - ruby: '2.7' - - gemfile: gemfiles/Gemfile-rails-4-2 - ruby: '2.6' - gemfile: gemfiles/Gemfile-rails-4-1 ruby: '3.2' - gemfile: gemfiles/Gemfile-rails-4-1 ruby: '3.1' - gemfile: gemfiles/Gemfile-rails-4-1 ruby: '3.0' - - gemfile: gemfiles/Gemfile-rails-4-1 - ruby: '2.7' - - gemfile: gemfiles/Gemfile-rails-4-1 - ruby: '2.6' - - gemfile: gemfiles/Gemfile-rails-4-1 - ruby: '2.5' - - gemfile: gemfiles/Gemfile-rails-4-1 - ruby: '2.4' # TODO: lock `ubunty-20.04` due to older Ruby version compatibility, change to `ubuntu-latest` again when dropping older Ruby support. # https://github.com/ruby/setup-ruby/issues/496#issuecomment-1520662740 runs-on: ubuntu-20.04 @@ -169,12 +96,6 @@ jobs: - name: Setup Bundler 1.x for Rails 4.x and Ruby <= 2.2 if: ${{ matrix.gemfile == 'gemfiles/Gemfile-rails-4-1' || matrix.gemfile == 'gemfiles/Gemfile-rails-4-2' || matrix.ruby <= '2.2' }} run: echo "BUNDLER_VERSION=1.17.3" >> $GITHUB_ENV - - name: Setup Rubygems version as default for Ruby < 2.5 - if: ${{ matrix.ruby < '2.5' }} - run: echo "RUBYGEMS_VERSION=default" >> $GITHUB_ENV - - name: Setup Rubygems version as 3.2.3 for Ruby 2.5 - if: ${{ matrix.ruby == '2.5' }} - run: echo "RUBYGEMS_VERSION=3.2.3" >> $GITHUB_ENV - uses: ruby/setup-ruby@v1 with: ruby-version: ${{ matrix.ruby }} diff --git a/README.md b/README.md index 0cb8151d..b1b778f1 100644 --- a/README.md +++ b/README.md @@ -129,9 +129,9 @@ Please note that the command output will show the variable value being used. ### BUNDLE_GEMFILE We can use this variable to tell bundler what Gemfile it should use (instead of the one in the current directory). Inside the [gemfiles](https://github.com/heartcombo/devise/tree/main/gemfiles) directory, we have one for each version of Rails we support. When you send us a pull request, it may happen that the test suite breaks using some of them. If that's the case, you can simulate the same environment using the `BUNDLE_GEMFILE` variable. -For example, if the tests broke using Ruby 2.4.2 and Rails 4.1, you can do the following: +For example, if the tests broke using Ruby 3.0.0 and Rails 4.1, you can do the following: ```bash -rbenv shell 2.4.2 # or rvm use 2.4.2 +rbenv shell 3.0.0 # or rvm use 3.0.0 BUNDLE_GEMFILE=gemfiles/Gemfile.rails-4.1-stable bundle install BUNDLE_GEMFILE=gemfiles/Gemfile.rails-4.1-stable bin/test ``` diff --git a/devise.gemspec b/devise.gemspec index 3efad0f4..bea117bb 100644 --- a/devise.gemspec +++ b/devise.gemspec @@ -25,7 +25,7 @@ Gem::Specification.new do |s| s.files = Dir["{app,config,lib}/**/*", "CHANGELOG.md", "MIT-LICENSE", "README.md"] s.require_paths = ["lib"] - s.required_ruby_version = '>= 2.1.0' + s.required_ruby_version = '>= 3.0.0' s.add_dependency("warden", "~> 1.2.3") s.add_dependency("orm_adapter", "~> 0.1") diff --git a/gemfiles/Gemfile-rails-4-1 b/gemfiles/Gemfile-rails-4-1 deleted file mode 100644 index f164f8a9..00000000 --- a/gemfiles/Gemfile-rails-4-1 +++ /dev/null @@ -1,49 +0,0 @@ -# frozen_string_literal: true - -source "https://rubygems.org" - -git_source(:github) do |repo_name| - repo_name = "#{repo_name}/#{repo_name}" unless repo_name.include?('/') - "https://github.com/#{repo_name}.git" -end - -gemspec path: ".." - -gem "rails", github: "rails/rails", branch: "4-1-stable" -gem "omniauth" -gem "omniauth-oauth2" -gem "rdoc", "~> 5.1" -# Force this version because it's breaking on CI since a higher nokogiri version requires Ruby 2.3+. -gem "nokogiri", "1.9.1" - -group :test do - gem "omniauth-facebook" - gem "omniauth-openid" - gem "timecop" - gem "webrat", "0.7.3", require: false - gem "mocha", "~> 2.1", require: false - gem 'test_after_commit', require: false -end - -platforms :jruby do - gem "activerecord-jdbc-adapter" - gem "activerecord-jdbcsqlite3-adapter" - gem "jruby-openssl" -end - -platforms :ruby do - gem "sqlite3", "~> 1.3.6" -end - -group :mongoid do - gem "mongoid", "~> 4.0" -end - -if RUBY_VERSION < "2.3.0" - # We're getting version 2.2.0 which doesn't play nice with Ruby 2.2, using - # `Object.deprecate_constant` which isn't available. - gem "multipart-post", "2.1.1" -end - -# There's a build incompatibility issue with nokogiri and loofah -gem "loofah", "~> 2.20.0" diff --git a/gemfiles/Gemfile-rails-4-2 b/gemfiles/Gemfile-rails-4-2 deleted file mode 100644 index 31205659..00000000 --- a/gemfiles/Gemfile-rails-4-2 +++ /dev/null @@ -1,48 +0,0 @@ -# frozen_string_literal: true - -source "https://rubygems.org" - -git_source(:github) do |repo_name| - repo_name = "#{repo_name}/#{repo_name}" unless repo_name.include?('/') - "https://github.com/#{repo_name}.git" -end - -gemspec path: ".." - -gem "rails", github: "rails/rails", branch: "4-2-stable" -gem "omniauth" -gem "omniauth-oauth2" -gem "rdoc", "~> 5.1" -gem "nokogiri", "1.9.1" - -group :test do - gem "omniauth-facebook" - gem "omniauth-openid" - gem "timecop" - gem "webrat", "0.7.3", require: false - gem "mocha", "~> 2.1", require: false - gem 'test_after_commit', require: false -end - -platforms :jruby do - gem "activerecord-jdbc-adapter" - gem "activerecord-jdbcsqlite3-adapter" - gem "jruby-openssl" -end - -platforms :ruby do - gem "sqlite3", "~> 1.3.6" -end - -group :mongoid do - gem "mongoid", "~> 4.0" -end - -if RUBY_VERSION < "2.3.0" - # We're getting version 2.2.0 which doesn't play nice with Ruby 2.2, using - # `Object.deprecate_constant` which isn't available. - gem "multipart-post", "2.1.1" -end - -# There's a build incompatibility issue with nokogiri and loofah -gem "loofah", "~> 2.20.0" diff --git a/gemfiles/Gemfile-rails-5-0 b/gemfiles/Gemfile-rails-5-0 deleted file mode 100644 index 7e3c3295..00000000 --- a/gemfiles/Gemfile-rails-5-0 +++ /dev/null @@ -1,40 +0,0 @@ -# frozen_string_literal: true - -source "https://rubygems.org" - -gemspec path: ".." - -gem "rails", '~> 5.0.0' -gem "omniauth" -gem "omniauth-oauth2" -gem "rdoc" - -gem "rails-controller-testing" - -gem "responders", "~> 2.1" - -group :test do - gem "omniauth-facebook" - gem "omniauth-openid" - gem "timecop" - gem "webrat", "0.7.3", require: false - gem "mocha", "~> 2.1", require: false -end - -platforms :ruby do - gem "sqlite3", "~> 1.3.6" -end - -# TODO: -# group :mongoid do -# gem "mongoid", "~> 4.0.0" -# end - -if RUBY_VERSION < "2.3.0" - # We're getting version 2.2.0 which doesn't play nice with Ruby 2.2, using - # `Object.deprecate_constant` which isn't available. - gem "multipart-post", "2.1.1" -end - -# There's a build incompatibility issue with nokogiri and loofah -gem "loofah", "~> 2.20.0" diff --git a/gemfiles/Gemfile-rails-5-1 b/gemfiles/Gemfile-rails-5-1 deleted file mode 100644 index bc85e0d4..00000000 --- a/gemfiles/Gemfile-rails-5-1 +++ /dev/null @@ -1,33 +0,0 @@ -source "https://rubygems.org" - -gemspec path: ".." - -gem "rails", '~> 5.1.0' -gem "omniauth" -gem "omniauth-oauth2" -gem "rdoc" - -gem "rails-controller-testing" - -gem "responders", "~> 2.1" - -group :test do - gem "omniauth-facebook" - gem "omniauth-openid" - gem "timecop" - gem "webrat", "0.7.3", require: false - gem "mocha", "~> 2.1", require: false -end - -platforms :ruby do - gem "sqlite3", "~> 1.3.6" -end - -if RUBY_VERSION < "2.3.0" - # We're getting version 2.2.0 which doesn't play nice with Ruby 2.2, using - # `Object.deprecate_constant` which isn't available. - gem "multipart-post", "2.1.1" -end - -# There's a build incompatibility issue with nokogiri and loofah -gem "loofah", "~> 2.20.0"