From b40d473b74c875d1075e4555a5df9d29bd003a22 Mon Sep 17 00:00:00 2001 From: Mathieu Jobin Date: Wed, 21 Sep 2022 11:45:04 +0900 Subject: [PATCH] added ruby 3 support (#8) --- .github/workflows/build.yml | 2 ++ lib/activejob/queue_adapters/dispatch_rider_adapter.rb | 2 +- spec/activejob/dispatch_rider/job_handler_spec.rb | 4 ++-- spec/spec_helper.rb | 1 + 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c0190b0..766100a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -16,6 +16,8 @@ jobs: fail-fast: false matrix: ruby: + - 3.1 + - '3.0' - 2.7 - 2.6 gemfile: diff --git a/lib/activejob/queue_adapters/dispatch_rider_adapter.rb b/lib/activejob/queue_adapters/dispatch_rider_adapter.rb index 316a292..c98e4e8 100644 --- a/lib/activejob/queue_adapters/dispatch_rider_adapter.rb +++ b/lib/activejob/queue_adapters/dispatch_rider_adapter.rb @@ -4,7 +4,7 @@ module QueueAdapters class DispatchRiderAdapter # @param [ActiveJob::Base] job def enqueue(job) - publisher.publish job_details_for(job) + publisher.publish **job_details_for(job) end # @param [ActiveJob::Base] job diff --git a/spec/activejob/dispatch_rider/job_handler_spec.rb b/spec/activejob/dispatch_rider/job_handler_spec.rb index 8fdf41e..cb37e1b 100644 --- a/spec/activejob/dispatch_rider/job_handler_spec.rb +++ b/spec/activejob/dispatch_rider/job_handler_spec.rb @@ -6,8 +6,8 @@ job_class = Class.new(ActiveJob::Base) do queue_as :foo - def perform(foo:) - "foo is #{foo}" + def perform(options) + "foo is #{options[:foo]}" end end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 533f7af..eaacda8 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,4 +1,5 @@ require "sqlite3" +require 'fileutils' require "activejob/dispatch_rider"