From c0c6fb4d40c1f291f7cf27eaaa615dcccc6e4ca7 Mon Sep 17 00:00:00 2001 From: Wolfgang Wedelich-John Date: Mon, 2 Sep 2024 13:10:21 +0200 Subject: [PATCH] ActiveRecord 7.2 support --- .github/workflows/ci.yml | 30 ++++------------------- .github/workflows/lint.yml | 4 +-- .github/workflows/rubygem.yml | 4 +-- .rubocop.yml | 2 +- Appraisals | 23 +++++++---------- CHANGELOG.md | 5 ++++ README.md | 10 +++----- acts_as_recursive_tree.gemspec | 6 ++--- gemfiles/ar_61.gemfile | 8 ------ gemfiles/{ar_52.gemfile => ar_71.gemfile} | 4 +-- gemfiles/{ar_60.gemfile => ar_72.gemfile} | 4 +-- lib/acts_as_recursive_tree/version.rb | 2 +- spec/spec_helper.rb | 2 +- 13 files changed, 36 insertions(+), 68 deletions(-) delete mode 100644 gemfiles/ar_61.gemfile rename gemfiles/{ar_52.gemfile => ar_71.gemfile} (59%) rename gemfiles/{ar_60.gemfile => ar_72.gemfile} (59%) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4e15e09..33437dc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,31 +19,11 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - ruby-version: ['2.5', '2.6', '2.7', '3.0', '3.1', '3.2'] - gemfile: [ar_52, ar_60, ar_61, ar_70, ar_next] - exclude: - - ruby-version: '3.2' - gemfile: ar_52 - - ruby-version: '3.2' - gemfile: ar_60 - - ruby-version: '3.2' - gemfile: ar_61 - - ruby-version: '3.1' - gemfile: ar_52 - - ruby-version: '3.1' - gemfile: ar_60 - - ruby-version: '3.1' - gemfile: ar_61 - - ruby-version: '3.0' - gemfile: ar_52 - - ruby-version: '2.6' - gemfile: ar_next - - ruby-version: '2.6' - gemfile: ar_70 - - ruby-version: '2.5' - gemfile: ar_next - - ruby-version: '2.5' - gemfile: ar_70 + ruby-version: ['3.1', '3.2', '3.3'] + gemfile: [ar_70, ar_71, ar_72, ar_next] +# exclude: +# - ruby-version: '3.2' +# gemfile: ar_60 env: # $BUNDLE_GEMFILE must be set at the job level, so it is set for all steps BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/${{ matrix.gemfile }}.gemfile steps: diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 57fce48..46ee2cc 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -18,14 +18,14 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Set up Ruby # To automatically get bug fixes and new Ruby versions for ruby/setup-ruby, # change this to (see https://github.com/ruby/setup-ruby#versioning): uses: ruby/setup-ruby@v1 # uses: ruby/setup-ruby@473e4d8fe5dd94ee328fdfca9f8c9c7afc9dae5e with: - ruby-version: 2.7 + ruby-version: 3.1 bundler-cache: true # runs 'bundle install' and caches installed gems automatically - name: Run rubocop run: bundle exec rubocop diff --git a/.github/workflows/rubygem.yml b/.github/workflows/rubygem.yml index 028db84..dd1c6fb 100644 --- a/.github/workflows/rubygem.yml +++ b/.github/workflows/rubygem.yml @@ -18,11 +18,11 @@ jobs: contents: read steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Set up Ruby uses: ruby/setup-ruby@v1 with: - ruby-version: 2.7 + ruby-version: 3.1 - run: bundle install - name: Publish to RubyGems env: diff --git a/.rubocop.yml b/.rubocop.yml index b5b2d3a..2aa5ddc 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -5,7 +5,7 @@ require: inherit_from: .rubocop_todo.yml AllCops: - TargetRubyVersion: 2.5 + TargetRubyVersion: 3.1 NewCops: enable SuggestExtensions: false diff --git a/Appraisals b/Appraisals index d744c1e..22e834b 100644 --- a/Appraisals +++ b/Appraisals @@ -1,23 +1,18 @@ # frozen_string_literal: true -appraise 'ar-52' do - gem 'activerecord', '~> 5.2.0' - gem 'activesupport', '~> 5.2.0' -end - -appraise 'ar-60' do - gem 'activerecord', '~> 6.0.0' - gem 'activesupport', '~> 6.0.0' +appraise 'ar-70' do + gem 'activerecord', '~> 7.0' + gem 'activesupport', '~> 7.0' end -appraise 'ar-61' do - gem 'activerecord', '~> 6.1.0' - gem 'activesupport', '~> 6.1.0' +appraise 'ar-71' do + gem 'activerecord', '~> 7.1' + gem 'activesupport', '~> 7.1' end -appraise 'ar-70' do - gem 'activerecord', '~> 7.0' - gem 'activesupport', '~> 7.0' +appraise 'ar-72' do + gem 'activerecord', '~> 7.2' + gem 'activesupport', '~> 7.2' end appraise 'ar-next' do diff --git a/CHANGELOG.md b/CHANGELOG.md index bd326be..0322c00 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +### Version 4.0.0 +- ADD: Support for Rails 7.2 +- BREAKING: Dropped support for Rails < 7 +- BREAKING: Dropped support old Rubies < 3.1 + ### Version 3.5.0 - Added :dependent option for setting explicit deletion behaviour (issue #31) - Added automatic cycle detection when supported (currently only PostgresSQL 14+) (issue #22) diff --git a/README.md b/README.md index 2b63ace..ea319ce 100644 --- a/README.md +++ b/README.md @@ -14,20 +14,16 @@ Luckily, there is already a SQL standard that makes it very easy to retrieve dat ## Supported environments ActsAsRecursiveTree currently supports following ActiveRecord versions and is tested for compatibility: - * ActiveRecord 5.2.x - * ActiveRecord 6.0.x - * ActiveRecord 6.1.x * ActiveRecord 7.0.x * ActiveRecord 7.1.x + * ActiveRecord 7.2.x + * ActiveRecord NEXT (from git) ## Supported Rubies ActsAsRecursiveTree is tested with following rubies: - * MRuby 2.5 - * MRuby 2.6 - * MRuby 2.7 - * MRuby 3.0 * MRuby 3.1 * MRuby 3.2 + * MRuby 3.3 Other Ruby implementations are not tested, but should also work. diff --git a/acts_as_recursive_tree.gemspec b/acts_as_recursive_tree.gemspec index 29a1528..462cc6d 100644 --- a/acts_as_recursive_tree.gemspec +++ b/acts_as_recursive_tree.gemspec @@ -18,13 +18,13 @@ Gem::Specification.new do |spec| 'bug_tracker_uri' => 'https://github.com/1and1/acts_as_recursive_tree/issues', 'changelog_uri' => 'https://github.com/1and1/acts_as_recursive_tree/blob/main/CHANGELOG.md' } - spec.required_ruby_version = '>= 2.5.0' + spec.required_ruby_version = '>= 3.1.0' spec.files = `git ls-files -z`.split("\x0") spec.test_files = spec.files.grep(%r{^spec/}) spec.require_paths = ['lib'] - spec.add_runtime_dependency 'activerecord', '>= 5.2.0', '< 8' - spec.add_runtime_dependency 'activesupport', '>= 5.2.0', '< 8' + spec.add_runtime_dependency 'activerecord', '>= 7.0.0', '< 8' + spec.add_runtime_dependency 'activesupport', '>= 7.0.0', '< 8' spec.add_runtime_dependency 'zeitwerk', '>= 2.4' spec.add_development_dependency 'appraisal', '~> 2.4' diff --git a/gemfiles/ar_61.gemfile b/gemfiles/ar_61.gemfile deleted file mode 100644 index 43affbe..0000000 --- a/gemfiles/ar_61.gemfile +++ /dev/null @@ -1,8 +0,0 @@ -# This file was generated by Appraisal - -source "https://rubygems.org" - -gem "activerecord", "~> 6.1.0" -gem "activesupport", "~> 6.1.0" - -gemspec path: "../" diff --git a/gemfiles/ar_52.gemfile b/gemfiles/ar_71.gemfile similarity index 59% rename from gemfiles/ar_52.gemfile rename to gemfiles/ar_71.gemfile index 44ff64e..d490cfb 100644 --- a/gemfiles/ar_52.gemfile +++ b/gemfiles/ar_71.gemfile @@ -2,7 +2,7 @@ source "https://rubygems.org" -gem "activerecord", "~> 5.2.0" -gem "activesupport", "~> 5.2.0" +gem "activerecord", "~> 7.1" +gem "activesupport", "~> 7.1" gemspec path: "../" diff --git a/gemfiles/ar_60.gemfile b/gemfiles/ar_72.gemfile similarity index 59% rename from gemfiles/ar_60.gemfile rename to gemfiles/ar_72.gemfile index 16ac8a2..9341e47 100644 --- a/gemfiles/ar_60.gemfile +++ b/gemfiles/ar_72.gemfile @@ -2,7 +2,7 @@ source "https://rubygems.org" -gem "activerecord", "~> 6.0.0" -gem "activesupport", "~> 6.0.0" +gem "activerecord", "~> 7.2" +gem "activesupport", "~> 7.2" gemspec path: "../" diff --git a/lib/acts_as_recursive_tree/version.rb b/lib/acts_as_recursive_tree/version.rb index 70c73cd..50201d1 100644 --- a/lib/acts_as_recursive_tree/version.rb +++ b/lib/acts_as_recursive_tree/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module ActsAsRecursiveTree - VERSION = '3.5.0' + VERSION = '4.0.0' end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 14d316b..c52dc85 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -13,7 +13,7 @@ # Requires supporting ruby files with custom matchers and macros, etc, # in spec/support/ and its subdirectories. -Dir[File.join(__dir__, 'support/**/*.rb')].sort.each { |f| require f } +Dir[File.join(__dir__, 'support/**/*.rb')].each { |f| require f } # This file was generated by the `rspec --init` command. Conventionally, all # specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.