From f8ab92d67411c9499c07477859385d359b23de3a Mon Sep 17 00:00:00 2001 From: mhenrixon Date: Thu, 9 Jun 2022 10:26:14 +0200 Subject: [PATCH] Chore: Sidekiq 6.5 compatibility --- Appraisals | 4 +++ gemfiles/sidekiq_6.5.gemfile | 27 ++++++++++++++++++++ lib/sidekiq_unique_jobs/middleware/client.rb | 2 ++ lib/sidekiq_unique_jobs/middleware/server.rb | 2 ++ spec/spec_helper.rb | 1 - 5 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 gemfiles/sidekiq_6.5.gemfile diff --git a/Appraisals b/Appraisals index d792f698..9c4dd2d9 100644 --- a/Appraisals +++ b/Appraisals @@ -35,3 +35,7 @@ end appraise "sidekiq-6.4" do gem "sidekiq", "~> 6.4.0" end + +appraise "sidekiq-6.5" do + gem "sidekiq", "~> 6.5.0" +end diff --git a/gemfiles/sidekiq_6.5.gemfile b/gemfiles/sidekiq_6.5.gemfile new file mode 100644 index 00000000..4b5caa37 --- /dev/null +++ b/gemfiles/sidekiq_6.5.gemfile @@ -0,0 +1,27 @@ +# This file was generated by Appraisal + +source "https://rubygems.org" + +gem "appraisal" +gem "gem-release" +gem "github-markup" +gem "rack-test" +gem "rake", "13.0.3" +gem "reek", ">= 5.3" +gem "rspec" +gem "rspec-benchmark" +gem "rspec-html-matchers" +gem "rspec-its" +gem "rubocop-mhenrixon" +gem "simplecov-sublime", ">= 0.21.2", require: false +gem "sinatra" +gem "timecop" +gem "yard" +gem "sidekiq", "~> 6.5.0" + +platforms :mri do + gem "concurrent-ruby-ext" + gem "hiredis" +end + +gemspec path: "../" diff --git a/lib/sidekiq_unique_jobs/middleware/client.rb b/lib/sidekiq_unique_jobs/middleware/client.rb index ea033903..6fb9ed01 100644 --- a/lib/sidekiq_unique_jobs/middleware/client.rb +++ b/lib/sidekiq_unique_jobs/middleware/client.rb @@ -6,6 +6,8 @@ module Middleware # # @author Mikael Henriksson class Client + include Sidekiq::ClientMiddleware if defined?(Sidekiq::ClientMiddleware) + # prepend "SidekiqUniqueJobs::Middleware" # @!parse prepends SidekiqUniqueJobs::Middleware prepend SidekiqUniqueJobs::Middleware diff --git a/lib/sidekiq_unique_jobs/middleware/server.rb b/lib/sidekiq_unique_jobs/middleware/server.rb index 71ef19c6..1807a2f8 100644 --- a/lib/sidekiq_unique_jobs/middleware/server.rb +++ b/lib/sidekiq_unique_jobs/middleware/server.rb @@ -6,6 +6,8 @@ module Middleware # # @author Mikael Henriksson class Server + include Sidekiq::ClientMiddleware if defined?(Sidekiq::ServerMiddleware) + # prepend "SidekiqUniqueJobs::Middleware" # @!parse prepends SidekiqUniqueJobs::Middleware prepend SidekiqUniqueJobs::Middleware diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index ab719f10..c6153379 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -17,7 +17,6 @@ require "sidekiq" require "sidekiq/api" -require "sidekiq/util" require "sidekiq-unique-jobs" require "timecop" require "sidekiq_unique_jobs/testing"