wisper-sidekiq-compat 2.0.0 → 2.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b6a4388e72736b4fdac245dd3cdd98b9fd65b4b88f696f9ead73b394d32125e4
4
- data.tar.gz: 20889dbe889541df920687d4aae172dbb8bb576e04f51299e19522e249c52f39
3
+ metadata.gz: 616d35d7c672234d7defa465b89d6ac7ae70d5f16af727dec21e639a596e1a1e
4
+ data.tar.gz: 1e0a47d0378ba6d8dc9debf9f533e567652c5d5696c80fdf35ea40b0f8ab515b
5
5
  SHA512:
6
- metadata.gz: 4c0b102c2eb662bbca2a7ca78c0fe6463b210183dd9769af23a42cc8ca29eb87eaff5633f89241f4e359236441aef54964c0e5177c2d40dffd3f336e50049e1a
7
- data.tar.gz: 29cfb34f718162a6fb297ff6b835551160bd5ea3ad28f379f3ea2fd7c77c8bad4b55d5345bff31114f29a1764cd4729bfda82ec45d147f8d181b7320130e27de
6
+ metadata.gz: c613fa5f1d9e12278516a3e9f19dba3be559134e9bd5818f8c6f187554cb87efb071ce2fd2e483a39561bf2ebcb128880eb6eb3904ccfbdc8d5eb18e62594e82
7
+ data.tar.gz: 61b86a346ad8356b43d8969caf49e05c70be4d6006ae1cd2460105e038d0db37de698424a8c3882e836da2be5a0d9245212e58e9b4a777d38a77d7408d5f44c9
@@ -9,7 +9,7 @@ jobs:
9
9
  runs-on: ubuntu-latest
10
10
  strategy:
11
11
  matrix:
12
- ruby: [3.0, 3.1, 3.2]
12
+ ruby: [2.7, 3.0, 3.1, 3.2]
13
13
  services:
14
14
  redis:
15
15
  image: redis:7-alpine
@@ -1,5 +1,5 @@
1
1
  module Wisper
2
2
  module Sidekiq
3
- VERSION = "2.0.0"
3
+ VERSION = "2.1.0"
4
4
  end
5
5
  end
@@ -14,13 +14,13 @@ module Wisper
14
14
  include ::Sidekiq::Worker
15
15
 
16
16
  def perform(yml)
17
- (subscriber, event, args) =
17
+ (subscriber, event, args, kwargs) =
18
18
  if Psych::VERSION.to_i >= 4
19
19
  ::YAML.unsafe_load(yml)
20
20
  else
21
21
  ::YAML.load(yml)
22
22
  end
23
- subscriber.public_send(event, *args)
23
+ subscriber.public_send(event, *args, **kwargs)
24
24
  end
25
25
  end
26
26
 
@@ -31,13 +31,13 @@ module Wisper
31
31
  end
32
32
  end
33
33
 
34
- def broadcast(subscriber, _publisher, event, *args, **_kwargs)
34
+ def broadcast(subscriber, _publisher, event, *args, **kwargs)
35
35
  options = sidekiq_options(subscriber)
36
36
  schedule_options = sidekiq_schedule_options(subscriber, event)
37
37
 
38
38
  Worker.set(options).perform_in(
39
39
  schedule_options.fetch(:delay, 0),
40
- ::YAML.dump([subscriber, event, args])
40
+ ::YAML.dump([subscriber, event, args, kwargs])
41
41
  )
42
42
  end
43
43
 
@@ -145,15 +145,17 @@ RSpec.describe Wisper::SidekiqBroadcaster do
145
145
  .to change { Sidekiq::Queues["default"].select{|job| job.key?('at')}.size }.by(1)
146
146
  end
147
147
 
148
- context 'when provides subscriber with args' do
148
+ context 'when provides subscriber with args and/or kwargs' do
149
149
  let(:subscriber) { RegularSubscriberUnderTest }
150
150
  let(:event) { 'it_happened' }
151
151
  let(:args) { [1,2,3] }
152
+ let(:kwargs) { {hi: :there}}
152
153
 
153
- subject(:broadcast_event) { described_class.new.broadcast(subscriber, nil, event, *args) }
154
+
155
+ subject(:broadcast_event) { described_class.new.broadcast(subscriber, nil, event, *args, **kwargs) }
154
156
 
155
157
  it 'subscriber receives event with corrects args' do
156
- expect(RegularSubscriberUnderTest).to receive(event).with(*args)
158
+ expect(RegularSubscriberUnderTest).to receive(event).with(*args, **kwargs)
157
159
 
158
160
  Sidekiq::Testing.inline! { broadcast_event }
159
161
  end
@@ -18,7 +18,7 @@ Gem::Specification.new do |spec|
18
18
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
19
  spec.require_paths = ["lib"]
20
20
 
21
- spec.required_ruby_version = '>= 3.0'
21
+ spec.required_ruby_version = '>= 2.7'
22
22
  spec.add_dependency 'wisper-compat'
23
23
  spec.add_dependency 'sidekiq', '>= 6.5', '< 7'
24
24
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wisper-sidekiq-compat
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kris Leech
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2023-02-28 00:00:00.000000000 Z
12
+ date: 2023-03-13 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: wisper-compat
@@ -85,14 +85,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
85
85
  requirements:
86
86
  - - ">="
87
87
  - !ruby/object:Gem::Version
88
- version: '3.0'
88
+ version: '2.7'
89
89
  required_rubygems_version: !ruby/object:Gem::Requirement
90
90
  requirements:
91
91
  - - ">="
92
92
  - !ruby/object:Gem::Version
93
93
  version: '0'
94
94
  requirements: []
95
- rubygems_version: 3.4.6
95
+ rubygems_version: 3.4.7
96
96
  signing_key:
97
97
  specification_version: 4
98
98
  summary: Async publishing for Wisper using Sidekiq