diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 8602d98..def3940 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -15,7 +15,7 @@ jobs: - uses: actions/checkout@v4 - uses: ruby/setup-ruby@v1 with: - ruby-version: "3.1" + ruby-version: "3.2" bundler-cache: true - run: bundle exec standardrb --parallel --format github test: @@ -23,12 +23,18 @@ jobs: strategy: fail-fast: false matrix: - ruby: [3.1, 3.2, head, debug, jruby-head, truffleruby-head] - continue-on-error: ${{ endsWith(matrix.ruby, 'head') || matrix.ruby == 'debug' }} + ruby: ["3.2", "3.3", "3.4", "4.0", head] + gemfile: [rails-7.2, rails-8.0, rails-8.1] + include: + - { ruby: jruby-10.0, gemfile: rails-8.0 } + - { ruby: jruby-10.0, gemfile: rails-8.1 } + continue-on-error: ${{ endsWith(matrix.ruby, 'head') }} steps: - uses: actions/checkout@v4 - uses: ruby/setup-ruby@v1 with: ruby-version: ${{ matrix.ruby }} - - run: bundle install - - run: bundle exec rspec + bundler-cache: true + - run: bundle exec appraisal generate + - run: bundle exec appraisal ${{ matrix.gemfile }} bundle install + - run: bundle exec appraisal ${{ matrix.gemfile }} rspec diff --git a/.gitignore b/.gitignore index e087fe0..fb9677d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,6 @@ /Gemfile.lock +gemfiles/*.gemfile +gemfiles/*.gemfile.lock /.DS_Store /.bundle/ /.ruby-* diff --git a/Appraisals b/Appraisals new file mode 100644 index 0000000..e3b0920 --- /dev/null +++ b/Appraisals @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +appraise "rails-7.2" do + gem "activemodel", "~> 7.2.0" + gem "activesupport", "~> 7.2.0" +end + +appraise "rails-8.0" do + gem "activemodel", "~> 8.0.0" + gem "activesupport", "~> 8.0.0" +end + +appraise "rails-8.1" do + gem "activemodel", "~> 8.1.0" + gem "activesupport", "~> 8.1.0" +end diff --git a/CHANGELOG.md b/CHANGELOG.md index dbabdc8..e7c9251 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,8 +8,14 @@ since Active Remote depends on specific Rails versions. ## [Unreleased] +### Added + +- Support ActiveModel/ActiveSupport 8.0 and 8.1 (now allows `>= 7.2, < 8.2`) +- Test against Rails 7.2, 8.0, and 8.1 via Appraisal, including a JRuby 10.0 leg for the 8.x line + ### Changed +- Require Ruby 3.2 (to match Rails 8) - Fix Standard violations ## [7.2.0] – 2026-02-13 diff --git a/Gemfile b/Gemfile index 02a4f2b..29d8a17 100644 --- a/Gemfile +++ b/Gemfile @@ -3,6 +3,8 @@ source "https://rubygems.org" # Specify your gem's dependencies in active_remote.gemspec gemspec +gem "appraisal" + gem "benchmark-ips" gem "protobuf-rspec", ">= 1.1.2" diff --git a/active_remote.gemspec b/active_remote.gemspec index 8344085..6b80620 100644 --- a/active_remote.gemspec +++ b/active_remote.gemspec @@ -12,7 +12,7 @@ Gem::Specification.new do |spec| spec.description = "Active Remote provides Active Record-like object-relational mapping over RPC. It was written for use with Google Protocol Buffers, but could be extended to use any RPC data format." spec.homepage = "https://github.com/liveh2o/active_remote" spec.license = "MIT" - spec.required_ruby_version = ">= 3.1.0" + spec.required_ruby_version = ">= 3.2.0" spec.metadata["homepage_uri"] = spec.homepage spec.metadata["source_code_uri"] = spec.homepage @@ -34,7 +34,7 @@ Gem::Specification.new do |spec| ## # Dependencies # - spec.add_dependency "activemodel", "~> 7.2.0" - spec.add_dependency "activesupport", "~> 7.2.0" + spec.add_dependency "activemodel", ">= 7.2", "< 8.2" + spec.add_dependency "activesupport", ">= 7.2", "< 8.2" spec.add_dependency "protobuf", ">= 3.0" end diff --git a/spec/lib/active_remote/association_spec.rb b/spec/lib/active_remote/association_spec.rb index e092f49..6d7b3a2 100644 --- a/spec/lib/active_remote/association_spec.rb +++ b/spec/lib/active_remote/association_spec.rb @@ -48,7 +48,7 @@ end context "when user_guid doesnt exist on model " do - before { allow(subject.class).to receive_message_chain(:public_instance_methods, :include?).with(:user_guid).and_return(false) } + before { allow(subject.class).to receive(:public_method_defined?).with(:user_guid).and_return(false) } it "raises an error" do expect { subject.user }.to raise_error(::RuntimeError, /Could not find attribute/) @@ -56,7 +56,7 @@ end context "when user_guid doesnt exist on associated model " do - before { allow(Author).to receive_message_chain(:public_instance_methods, :include?).with(:user_guid).and_return(false) } + before { allow(Author).to receive(:public_method_defined?).with(:user_guid).and_return(false) } it "raises an error" do expect { subject.user }.to raise_error(::RuntimeError, /Could not find attribute/) @@ -158,7 +158,7 @@ end context "when user_guid doesnt exist on associated model " do - before { allow(Post).to receive_message_chain(:public_instance_methods, :include?).with(:user_guid).and_return(false) } + before { allow(Post).to receive(:public_method_defined?).with(:user_guid).and_return(false) } it "raises an error" do expect { subject.user_posts }.to raise_error(::RuntimeError, /Could not find attribute/) @@ -246,7 +246,7 @@ end context "when user_guid doesnt exist on associated model " do - before { allow(Author).to receive_message_chain(:public_instance_methods, :include?).with(:user_guid).and_return(false) } + before { allow(Author).to receive(:public_method_defined?).with(:user_guid).and_return(false) } it "raises an error" do expect { subject.chief_editor }.to raise_error(::RuntimeError, /Could not find attribute/)