dispatch-rider 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 +4 -4
- data/.github/workflows/build.yml +5 -4
- data/CHANGELOG.md +7 -0
- data/dispatch-rider.gemspec +1 -1
- data/lib/dispatch-rider/logging/lifecycle_logger.rb +1 -1
- data/lib/dispatch-rider/logging/translator/base_translator.rb +1 -1
- data/lib/dispatch-rider/publisher/configuration_reader.rb +1 -1
- data/lib/dispatch-rider/publisher.rb +4 -10
- data/lib/dispatch-rider/version.rb +1 -1
- data/spec/lib/dispatch-rider/publisher/configuration_reader_spec.rb +12 -3
- data/spec/lib/dispatch-rider/publisher_spec.rb +4 -13
- data/spec/spec_helper.rb +1 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b8cefb6d56d04893f7ce7a4fc75dbd57f1c1148efac30e40ebd415190c480be6
|
4
|
+
data.tar.gz: 84f3c1c18b51123a08434e6c389521d6ea30760bf5823d72178c699d36de38b4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a52539c08456b5296f16cb02ce3e4c324307d23ae5bf4805a25ce1c5e437b0127dca7619a77f7957311657b16387d8d267f14fd0b85399b29a868f8ea7101727
|
7
|
+
data.tar.gz: 49b41b85fb54f6454cef746095291484533f44cf8eaab3f536b63d2ab130279cacb3219b2aec6286cf50818fc71ec6f15f59f87d94043157e5700754fefde0d9
|
data/.github/workflows/build.yml
CHANGED
@@ -16,8 +16,9 @@ jobs:
|
|
16
16
|
fail-fast: false
|
17
17
|
matrix:
|
18
18
|
ruby:
|
19
|
+
- 3.1
|
20
|
+
- '3.0'
|
19
21
|
- 2.7
|
20
|
-
- 2.6
|
21
22
|
awssdk:
|
22
23
|
- v1
|
23
24
|
- v3
|
@@ -27,10 +28,10 @@ jobs:
|
|
27
28
|
- Gemfile-6-1
|
28
29
|
- Gemfile-7-0
|
29
30
|
exclude:
|
30
|
-
- gemfile: Gemfile-7-0
|
31
|
-
ruby: 2.6
|
32
31
|
- gemfile: Gemfile-5-2
|
33
|
-
ruby: 3.
|
32
|
+
ruby: 3.1
|
33
|
+
- gemfile: Gemfile-5-2
|
34
|
+
ruby: '3.0'
|
34
35
|
|
35
36
|
env:
|
36
37
|
AWS_SDK_VER: ${{ matrix.awssdk }}
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,12 @@
|
|
1
1
|
# Change Log
|
2
2
|
|
3
|
+
## [v2.1.0](https://github.com/payrollhero/dispatch-rider/tree/v2.1.0) (2022-09-20)
|
4
|
+
[Full Changelog](https://github.com/payrollhero/dispatch-rider/compare/v2.0.0...v2.1.0)
|
5
|
+
|
6
|
+
* Added support for ruby 3.0 and 3.1
|
7
|
+
* Require ruby 2.7 at the very minimum, there is a meta-programming class with kwards between 2.6 and 3.0
|
8
|
+
since 2.6 is not unsupported, support is removed
|
9
|
+
|
3
10
|
## [v2.0.0](https://github.com/payrollhero/dispatch-rider/tree/v2.0.0) (2022-09-20)
|
4
11
|
[Full Changelog](https://github.com/payrollhero/dispatch-rider/compare/v1.9.0...v2.0.0)
|
5
12
|
|
data/dispatch-rider.gemspec
CHANGED
@@ -38,7 +38,7 @@ Gem::Specification.new do |gem|
|
|
38
38
|
gem.executables = gem.files.grep(%r{^bin/}).map { |f| File.basename(f) }
|
39
39
|
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
40
40
|
gem.require_paths = ['lib']
|
41
|
-
gem.required_ruby_version = '>= 2.
|
41
|
+
gem.required_ruby_version = '>= 2.7.2'
|
42
42
|
|
43
43
|
|
44
44
|
gem.add_runtime_dependency 'activesupport', '>= 5.2.0'
|
@@ -11,7 +11,7 @@ module DispatchRider
|
|
11
11
|
|
12
12
|
def configure_notification_services(notification_services, publisher)
|
13
13
|
notification_services.each do |service|
|
14
|
-
publisher.register_notification_service(service.name, service.options)
|
14
|
+
publisher.register_notification_service(service.name, **service.options)
|
15
15
|
end
|
16
16
|
end
|
17
17
|
|
@@ -35,23 +35,17 @@ module DispatchRider
|
|
35
35
|
self
|
36
36
|
end
|
37
37
|
|
38
|
-
|
39
|
-
|
40
|
-
options
|
41
|
-
|
42
|
-
callbacks.invoke(:publish, options) do
|
38
|
+
def publish(message:, destinations:)
|
39
|
+
options = { message: build_message(message), destinations: destinations }
|
40
|
+
callbacks.invoke(:publish, **options) do
|
43
41
|
service_channel_mapper.map(options.delete(:destinations)).each do |(service, channels)|
|
44
|
-
notification_service_registrar.fetch(service).publish(options.merge to: channels)
|
42
|
+
notification_service_registrar.fetch(service).publish(**(options.merge to: channels))
|
45
43
|
end
|
46
44
|
end
|
47
45
|
end
|
48
46
|
|
49
47
|
private
|
50
48
|
|
51
|
-
def build_publish_options(message:, destinations:)
|
52
|
-
{ message: build_message(message), destinations: destinations }
|
53
|
-
end
|
54
|
-
|
55
49
|
def build_message(attributes)
|
56
50
|
DispatchRider::Message.new(attributes).tap do |message|
|
57
51
|
message.body[:guid] ||= generate_new_message_id
|
@@ -55,7 +55,11 @@ describe DispatchRider::Publisher::ConfigurationReader do
|
|
55
55
|
end
|
56
56
|
|
57
57
|
it "calls register_notification_service with :file_system and {}" do
|
58
|
-
|
58
|
+
if RUBY_VERSION > '3'
|
59
|
+
expect(publisher).to receive(:register_notification_service).with("file_system").once
|
60
|
+
else
|
61
|
+
expect(publisher).to receive(:register_notification_service).with("file_system", {}).once
|
62
|
+
end
|
59
63
|
subject.load_config(configuration, publisher)
|
60
64
|
end
|
61
65
|
end
|
@@ -71,8 +75,13 @@ describe DispatchRider::Publisher::ConfigurationReader do
|
|
71
75
|
end
|
72
76
|
|
73
77
|
it "calls register_notification_service with :file_system and {}, as well as :foo, {bar: '123'}" do
|
74
|
-
|
75
|
-
|
78
|
+
if RUBY_VERSION > '3'
|
79
|
+
expect(publisher).to receive(:register_notification_service).with("file_system").once
|
80
|
+
expect(publisher).to receive(:register_notification_service).with("foo", bar: "123").once
|
81
|
+
else
|
82
|
+
expect(publisher).to receive(:register_notification_service).with("file_system", {}).once
|
83
|
+
expect(publisher).to receive(:register_notification_service).with("foo", "bar" => "123").once
|
84
|
+
end
|
76
85
|
subject.load_config(configuration, publisher)
|
77
86
|
end
|
78
87
|
end
|
@@ -135,25 +135,16 @@ describe DispatchRider::Publisher do
|
|
135
135
|
describe "calls publish callback" do
|
136
136
|
describe "calls the publish callback" do
|
137
137
|
let(:publish_callback) { double :callback }
|
138
|
-
let(:expected_message) {
|
139
|
-
DispatchRider::Message.new(
|
140
|
-
subject: "bar_handler",
|
141
|
-
body: {
|
142
|
-
"bar" => "baz",
|
143
|
-
guid: "test-mode-not-random-guid"
|
144
|
-
}
|
145
|
-
)
|
146
|
-
}
|
147
138
|
|
148
139
|
before { DispatchRider.config.callbacks.for(:publish) << publish_callback }
|
149
140
|
|
150
141
|
after { DispatchRider.config.callbacks.for(:publish).delete publish_callback }
|
151
142
|
|
152
143
|
example do
|
153
|
-
expect(publish_callback).to receive(:call).with
|
154
|
-
|
155
|
-
|
156
|
-
|
144
|
+
expect(publish_callback).to receive(:call).with(
|
145
|
+
an_instance_of(Proc), # first argument is the inner job
|
146
|
+
{ destinations: [:fs_foo],
|
147
|
+
message: an_instance_of(DispatchRider::Message) })
|
157
148
|
publisher.publish destinations: [:fs_foo],
|
158
149
|
message: {
|
159
150
|
subject: "bar_handler",
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dispatch-rider
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Suman Mukherjee
|
@@ -469,14 +469,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
469
469
|
requirements:
|
470
470
|
- - ">="
|
471
471
|
- !ruby/object:Gem::Version
|
472
|
-
version: 2.
|
472
|
+
version: 2.7.2
|
473
473
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
474
474
|
requirements:
|
475
475
|
- - ">="
|
476
476
|
- !ruby/object:Gem::Version
|
477
477
|
version: '0'
|
478
478
|
requirements: []
|
479
|
-
rubygems_version: 3.
|
479
|
+
rubygems_version: 3.2.33
|
480
480
|
signing_key:
|
481
481
|
specification_version: 4
|
482
482
|
summary: Messaging system that is customizable based on which queueing system we are
|