dispatch-rider 1.8.6 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (80) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/build.yml +50 -0
  3. data/.github/workflows/rubocop-challenger.yml +26 -0
  4. data/.gitignore +1 -0
  5. data/.rubocop.yml +31 -20
  6. data/.rubocop_todo.yml +904 -0
  7. data/.travis.yml +4 -4
  8. data/CHANGELOG.md +20 -0
  9. data/README.md +2 -2
  10. data/dispatch-rider.gemspec +16 -10
  11. data/gemfiles/Gemfile-5-2 +8 -0
  12. data/gemfiles/Gemfile-6-0 +8 -0
  13. data/gemfiles/Gemfile-6-1 +8 -0
  14. data/gemfiles/Gemfile-7-0 +8 -0
  15. data/lib/dispatch-rider/callbacks/access.rb +0 -1
  16. data/lib/dispatch-rider/callbacks/storage.rb +0 -2
  17. data/lib/dispatch-rider/callbacks/support.rb +0 -2
  18. data/lib/dispatch-rider/command.rb +0 -2
  19. data/lib/dispatch-rider/demultiplexer.rb +1 -1
  20. data/lib/dispatch-rider/dispatcher.rb +0 -2
  21. data/lib/dispatch-rider/error_handlers.rb +0 -1
  22. data/lib/dispatch-rider/handlers/inheritance_tracking.rb +0 -2
  23. data/lib/dispatch-rider/handlers/named_process.rb +0 -2
  24. data/lib/dispatch-rider/integrations/appsignal.rb +0 -2
  25. data/lib/dispatch-rider/logging/json_formatter.rb +0 -2
  26. data/lib/dispatch-rider/logging/lifecycle_logger.rb +0 -1
  27. data/lib/dispatch-rider/logging/text_formatter.rb +1 -3
  28. data/lib/dispatch-rider/logging/translator/base_translator.rb +0 -2
  29. data/lib/dispatch-rider/logging/translator/complete_translator.rb +0 -2
  30. data/lib/dispatch-rider/logging/translator/error_handler_fail_translator.rb +0 -2
  31. data/lib/dispatch-rider/logging/translator/fail_translator.rb +0 -2
  32. data/lib/dispatch-rider/logging/translator/start_translator.rb +0 -2
  33. data/lib/dispatch-rider/logging/translator/stop_translator.rb +0 -2
  34. data/lib/dispatch-rider/logging/translator/success_translator.rb +0 -2
  35. data/lib/dispatch-rider/logging/translator.rb +0 -2
  36. data/lib/dispatch-rider/logging.rb +0 -1
  37. data/lib/dispatch-rider/notification_services/aws_sns.rb +4 -4
  38. data/lib/dispatch-rider/notification_services/base.rb +1 -1
  39. data/lib/dispatch-rider/notification_services/file_system/channel.rb +1 -2
  40. data/lib/dispatch-rider/notification_services/file_system/notifier.rb +0 -2
  41. data/lib/dispatch-rider/publisher/configuration/destination.rb +0 -2
  42. data/lib/dispatch-rider/publisher/configuration/notification_service.rb +0 -2
  43. data/lib/dispatch-rider/publisher/configuration.rb +0 -2
  44. data/lib/dispatch-rider/publisher/configuration_reader.rb +0 -3
  45. data/lib/dispatch-rider/publisher/configuration_support.rb +0 -2
  46. data/lib/dispatch-rider/queue_services/aws_sqs/sqs_received_message.rb +6 -7
  47. data/lib/dispatch-rider/queue_services/aws_sqs.rb +28 -20
  48. data/lib/dispatch-rider/queue_services/file_system/fs_received_message.rb +0 -1
  49. data/lib/dispatch-rider/queue_services/file_system.rb +2 -2
  50. data/lib/dispatch-rider/queue_services/received_message.rb +0 -2
  51. data/lib/dispatch-rider/registrars/base.rb +2 -2
  52. data/lib/dispatch-rider/registrars/sns_channel.rb +1 -1
  53. data/lib/dispatch-rider/runner.rb +0 -1
  54. data/lib/dispatch-rider/version.rb +1 -1
  55. data/lib/dispatch-rider.rb +2 -0
  56. data/lib/generators/dispatch_rider/install/install_generator.rb +0 -2
  57. data/lib/generators/dispatch_rider/job/dispatch_job_generator.rb +0 -2
  58. data/spec/factories/messages.rb +7 -6
  59. data/spec/lib/dispatch-rider/callbacks/access_spec.rb +2 -2
  60. data/spec/lib/dispatch-rider/callbacks/storage_spec.rb +3 -3
  61. data/spec/lib/dispatch-rider/configuration_spec.rb +1 -1
  62. data/spec/lib/dispatch-rider/default_error_handler_spec.rb +1 -0
  63. data/spec/lib/dispatch-rider/demultiplexer_spec.rb +2 -2
  64. data/spec/lib/dispatch-rider/notification_services/aws_sns_spec.rb +3 -3
  65. data/spec/lib/dispatch-rider/notification_services/base_spec.rb +7 -7
  66. data/spec/lib/dispatch-rider/notification_services/file_system/channel_spec.rb +5 -4
  67. data/spec/lib/dispatch-rider/publisher/base_spec.rb +2 -2
  68. data/spec/lib/dispatch-rider/publisher/configuration/destination_spec.rb +1 -2
  69. data/spec/lib/dispatch-rider/publisher/configuration/notification_service_spec.rb +1 -2
  70. data/spec/lib/dispatch-rider/publisher/configuration_spec.rb +2 -2
  71. data/spec/lib/dispatch-rider/publisher_spec.rb +2 -1
  72. data/spec/lib/dispatch-rider/queue_services/aws_sqs_spec.rb +24 -34
  73. data/spec/lib/dispatch-rider/queue_services/file_system_spec.rb +2 -2
  74. data/spec/lib/dispatch-rider/scheduled_job_spec.rb +12 -12
  75. data/spec/lib/dispatch-rider/subscriber_spec.rb +4 -0
  76. data/spec/spec_helper.rb +32 -4
  77. data/spec/support/integration_support.rb +0 -1
  78. metadata +93 -33
  79. data/.rubocop.hound.yml +0 -261
  80. data/spec/lib/dispatch-rider/queue_services_spec.rb +0 -6
@@ -3,10 +3,10 @@ require "spec_helper"
3
3
  describe DispatchRider::ScheduledJob do
4
4
  let(:message_details) {
5
5
  {
6
- destinations: [:allied_forces],
6
+ destinations: ["allied_forces"],
7
7
  message: {
8
- subject: :war_update,
9
- body: { enigma_machine: :broken }
8
+ "subject" => "war_update",
9
+ "body" => { "enigma_machine" => "broken" }
10
10
  }
11
11
  }
12
12
  }
@@ -32,10 +32,10 @@ describe DispatchRider::ScheduledJob do
32
32
 
33
33
  describe ".publish_due_jobs" do
34
34
  example {
35
- expect(described_class.publisher).to receive(:publish).once.with destinations: [:allied_forces],
35
+ expect(described_class.publisher).to receive(:publish).once.with destinations: ["allied_forces"],
36
36
  message: {
37
- subject: :war_update,
38
- body: { enigma_machine: :broken }
37
+ "subject" => "war_update",
38
+ "body" => { "enigma_machine" => "broken" }
39
39
  }
40
40
 
41
41
  2.times { described_class.publish_due_jobs }
@@ -45,15 +45,15 @@ describe DispatchRider::ScheduledJob do
45
45
  describe "#destinations serialization" do
46
46
  subject { described_class.find(due_job.id).destinations }
47
47
 
48
- it { is_expected.to eq [:allied_forces] }
48
+ it { is_expected.to eq ["allied_forces"] }
49
49
  end
50
50
 
51
51
  describe "#message serialization" do
52
52
  subject { described_class.find(due_job.id).message }
53
53
 
54
54
  it {
55
- is_expected.to eq subject: :war_update,
56
- body: { enigma_machine: :broken }
55
+ is_expected.to eq "subject" => "war_update",
56
+ "body" => { "enigma_machine" => "broken" }
57
57
  }
58
58
  end
59
59
 
@@ -61,10 +61,10 @@ describe DispatchRider::ScheduledJob do
61
61
  subject(:job) { described_class.find(due_job.id) }
62
62
 
63
63
  example {
64
- expect(described_class.publisher).to receive(:publish).with destinations: [:allied_forces],
64
+ expect(described_class.publisher).to receive(:publish).with destinations: ["allied_forces"],
65
65
  message: {
66
- subject: :war_update,
67
- body: { enigma_machine: :broken }
66
+ "subject" => "war_update",
67
+ "body" => { "enigma_machine" => "broken" }
68
68
  }
69
69
 
70
70
  job.publish
@@ -93,6 +93,7 @@ describe DispatchRider::Subscriber do
93
93
 
94
94
  context "when process quits" do
95
95
  let(:message_subject) { :quiter }
96
+
96
97
  before do
97
98
  konst = Class.new(DispatchRider::Handlers::Base) do
98
99
  def process(_options)
@@ -110,6 +111,7 @@ describe DispatchRider::Subscriber do
110
111
 
111
112
  context "when process terminates" do
112
113
  let(:message_subject) { :terminator }
114
+
113
115
  before do
114
116
  konst = Class.new(DispatchRider::Handlers::Base) do
115
117
  def process(_options)
@@ -126,6 +128,7 @@ describe DispatchRider::Subscriber do
126
128
 
127
129
  context "when process is interupted" do
128
130
  let(:message_subject) { :interupter }
131
+
129
132
  before do
130
133
  konst = Class.new(DispatchRider::Handlers::Base) do
131
134
  def process(_options)
@@ -142,6 +145,7 @@ describe DispatchRider::Subscriber do
142
145
 
143
146
  context "when process is interupted twice" do
144
147
  let(:message_subject) { :twice_interupter }
148
+
145
149
  before do
146
150
  allow(subject.demultiplexer).to receive(:stop) # do nothing just ignore the interuption
147
151
  allow(subject).to receive(:exit) { throw :got_forcefully_stopped }
data/spec/spec_helper.rb CHANGED
@@ -1,4 +1,32 @@
1
- require 'bundler'
1
+ # frozen_string_literal: true
2
+
3
+ require 'bundler/setup'
4
+
5
+ require 'simplecov'
6
+ require 'coveralls'
7
+
8
+ if RUBY_VERSION < "3.1"
9
+ SimpleCov.start 'rails' do
10
+ if ENV['CI']
11
+ require 'simplecov-lcov'
12
+
13
+ SimpleCov::Formatter::LcovFormatter.config do |c|
14
+ c.report_with_single_file = true
15
+ c.single_report_path = 'coverage/lcov.info'
16
+ end
17
+
18
+ formatter SimpleCov::Formatter::LcovFormatter
19
+ end
20
+
21
+ add_filter '/bin/'
22
+ add_filter '/script/'
23
+ add_filter '/db/'
24
+ add_filter '/spec/' # for rspec
25
+ add_filter '/test/' # for minitest
26
+ end
27
+
28
+ Coveralls.wear!('rails')
29
+ end
2
30
 
3
31
  Bundler.setup
4
32
  Bundler.require(:default, :development)
@@ -7,8 +35,8 @@ require 'dispatch-rider'
7
35
 
8
36
  Dir['./spec/support/**/*.rb'].each { |fn| require(fn) }
9
37
 
10
- FactoryGirl.definition_file_paths = %w{spec/factories/}
11
- FactoryGirl.find_definitions
38
+ FactoryBot.definition_file_paths = %w{spec/factories/}
39
+ FactoryBot.find_definitions
12
40
 
13
41
  RSpec.configure do |config|
14
42
  config.raise_errors_for_deprecations!
@@ -42,7 +70,7 @@ RSpec.configure do |config|
42
70
  DispatchRider::ScheduledJob.destroy_all
43
71
  end
44
72
 
45
- config.include FactoryGirl::Syntax::Methods
73
+ config.include FactoryBot::Syntax::Methods
46
74
  end
47
75
 
48
76
  # Airbrake dummy module
@@ -29,5 +29,4 @@ module IntegrationSupport
29
29
 
30
30
  subscriber.demultiplexer.start
31
31
  end
32
-
33
32
  end
metadata CHANGED
@@ -1,17 +1,18 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dispatch-rider
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.8.6
4
+ version: 2.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Suman Mukherjee
8
8
  - Dane Natoli
9
9
  - Piotr Banasik
10
10
  - Ronald Maravilla
11
+ - Mathieu Jobin
11
12
  autorequire:
12
13
  bindir: bin
13
14
  cert_chain: []
14
- date: 2019-08-30 00:00:00.000000000 Z
15
+ date: 2022-09-20 00:00:00.000000000 Z
15
16
  dependencies:
16
17
  - !ruby/object:Gem::Dependency
17
18
  name: activesupport
@@ -19,42 +20,42 @@ dependencies:
19
20
  requirements:
20
21
  - - ">="
21
22
  - !ruby/object:Gem::Version
22
- version: 3.2.0
23
+ version: 5.2.0
23
24
  type: :runtime
24
25
  prerelease: false
25
26
  version_requirements: !ruby/object:Gem::Requirement
26
27
  requirements:
27
28
  - - ">="
28
29
  - !ruby/object:Gem::Version
29
- version: 3.2.0
30
+ version: 5.2.0
30
31
  - !ruby/object:Gem::Dependency
31
32
  name: activemodel
32
33
  requirement: !ruby/object:Gem::Requirement
33
34
  requirements:
34
35
  - - ">="
35
36
  - !ruby/object:Gem::Version
36
- version: 3.2.0
37
+ version: 5.2.0
37
38
  type: :runtime
38
39
  prerelease: false
39
40
  version_requirements: !ruby/object:Gem::Requirement
40
41
  requirements:
41
42
  - - ">="
42
43
  - !ruby/object:Gem::Version
43
- version: 3.2.0
44
+ version: 5.2.0
44
45
  - !ruby/object:Gem::Dependency
45
46
  name: activerecord
46
47
  requirement: !ruby/object:Gem::Requirement
47
48
  requirements:
48
49
  - - ">="
49
50
  - !ruby/object:Gem::Version
50
- version: 3.2.0
51
+ version: 5.2.0
51
52
  type: :runtime
52
53
  prerelease: false
53
54
  version_requirements: !ruby/object:Gem::Requirement
54
55
  requirements:
55
56
  - - ">="
56
57
  - !ruby/object:Gem::Version
57
- version: 3.2.0
58
+ version: 5.2.0
58
59
  - !ruby/object:Gem::Dependency
59
60
  name: daemons
60
61
  requirement: !ruby/object:Gem::Requirement
@@ -103,22 +104,64 @@ dependencies:
103
104
  - - "~>"
104
105
  - !ruby/object:Gem::Version
105
106
  version: '1.0'
107
+ - !ruby/object:Gem::Dependency
108
+ name: aws-sdk-sqs
109
+ requirement: !ruby/object:Gem::Requirement
110
+ requirements:
111
+ - - "~>"
112
+ - !ruby/object:Gem::Version
113
+ version: '1.30'
114
+ type: :development
115
+ prerelease: false
116
+ version_requirements: !ruby/object:Gem::Requirement
117
+ requirements:
118
+ - - "~>"
119
+ - !ruby/object:Gem::Version
120
+ version: '1.30'
121
+ - !ruby/object:Gem::Dependency
122
+ name: aws-sdk-sns
123
+ requirement: !ruby/object:Gem::Requirement
124
+ requirements:
125
+ - - "~>"
126
+ - !ruby/object:Gem::Version
127
+ version: '1.30'
128
+ type: :development
129
+ prerelease: false
130
+ version_requirements: !ruby/object:Gem::Requirement
131
+ requirements:
132
+ - - "~>"
133
+ - !ruby/object:Gem::Version
134
+ version: '1.30'
106
135
  - !ruby/object:Gem::Dependency
107
136
  name: bundler
137
+ requirement: !ruby/object:Gem::Requirement
138
+ requirements:
139
+ - - "<"
140
+ - !ruby/object:Gem::Version
141
+ version: '3.0'
142
+ type: :development
143
+ prerelease: false
144
+ version_requirements: !ruby/object:Gem::Requirement
145
+ requirements:
146
+ - - "<"
147
+ - !ruby/object:Gem::Version
148
+ version: '3.0'
149
+ - !ruby/object:Gem::Dependency
150
+ name: coveralls_reborn
108
151
  requirement: !ruby/object:Gem::Requirement
109
152
  requirements:
110
153
  - - "~>"
111
154
  - !ruby/object:Gem::Version
112
- version: '1.0'
155
+ version: '0.25'
113
156
  type: :development
114
157
  prerelease: false
115
158
  version_requirements: !ruby/object:Gem::Requirement
116
159
  requirements:
117
160
  - - "~>"
118
161
  - !ruby/object:Gem::Version
119
- version: '1.0'
162
+ version: '0.25'
120
163
  - !ruby/object:Gem::Dependency
121
- name: rake
164
+ name: simplecov-lcov
122
165
  requirement: !ruby/object:Gem::Requirement
123
166
  requirements:
124
167
  - - ">="
@@ -132,7 +175,7 @@ dependencies:
132
175
  - !ruby/object:Gem::Version
133
176
  version: '0'
134
177
  - !ruby/object:Gem::Dependency
135
- name: sqlite3
178
+ name: debug
136
179
  requirement: !ruby/object:Gem::Requirement
137
180
  requirements:
138
181
  - - ">="
@@ -146,7 +189,7 @@ dependencies:
146
189
  - !ruby/object:Gem::Version
147
190
  version: '0'
148
191
  - !ruby/object:Gem::Dependency
149
- name: rubygems-tasks
192
+ name: rake
150
193
  requirement: !ruby/object:Gem::Requirement
151
194
  requirements:
152
195
  - - ">="
@@ -160,7 +203,7 @@ dependencies:
160
203
  - !ruby/object:Gem::Version
161
204
  version: '0'
162
205
  - !ruby/object:Gem::Dependency
163
- name: github_changelog_generator
206
+ name: sqlite3
164
207
  requirement: !ruby/object:Gem::Requirement
165
208
  requirements:
166
209
  - - ">="
@@ -174,7 +217,7 @@ dependencies:
174
217
  - !ruby/object:Gem::Version
175
218
  version: '0'
176
219
  - !ruby/object:Gem::Dependency
177
- name: yard
220
+ name: rubygems-tasks
178
221
  requirement: !ruby/object:Gem::Requirement
179
222
  requirements:
180
223
  - - ">="
@@ -188,21 +231,21 @@ dependencies:
188
231
  - !ruby/object:Gem::Version
189
232
  version: '0'
190
233
  - !ruby/object:Gem::Dependency
191
- name: rspec
234
+ name: github_changelog_generator
192
235
  requirement: !ruby/object:Gem::Requirement
193
236
  requirements:
194
- - - "~>"
237
+ - - ">="
195
238
  - !ruby/object:Gem::Version
196
- version: '3.3'
239
+ version: '0'
197
240
  type: :development
198
241
  prerelease: false
199
242
  version_requirements: !ruby/object:Gem::Requirement
200
243
  requirements:
201
- - - "~>"
244
+ - - ">="
202
245
  - !ruby/object:Gem::Version
203
- version: '3.3'
246
+ version: '0'
204
247
  - !ruby/object:Gem::Dependency
205
- name: factory_girl
248
+ name: yard
206
249
  requirement: !ruby/object:Gem::Requirement
207
250
  requirements:
208
251
  - - ">="
@@ -216,21 +259,35 @@ dependencies:
216
259
  - !ruby/object:Gem::Version
217
260
  version: '0'
218
261
  - !ruby/object:Gem::Dependency
219
- name: aws-sdk
262
+ name: rspec
220
263
  requirement: !ruby/object:Gem::Requirement
221
264
  requirements:
222
265
  - - "~>"
223
266
  - !ruby/object:Gem::Version
224
- version: '1'
267
+ version: '3.3'
225
268
  type: :development
226
269
  prerelease: false
227
270
  version_requirements: !ruby/object:Gem::Requirement
228
271
  requirements:
229
272
  - - "~>"
230
273
  - !ruby/object:Gem::Version
231
- version: '1'
274
+ version: '3.3'
232
275
  - !ruby/object:Gem::Dependency
233
- name: pry
276
+ name: factory_bot
277
+ requirement: !ruby/object:Gem::Requirement
278
+ requirements:
279
+ - - ">="
280
+ - !ruby/object:Gem::Version
281
+ version: '0'
282
+ type: :development
283
+ prerelease: false
284
+ version_requirements: !ruby/object:Gem::Requirement
285
+ requirements:
286
+ - - ">="
287
+ - !ruby/object:Gem::Version
288
+ version: '0'
289
+ - !ruby/object:Gem::Dependency
290
+ name: rubocop_challenger
234
291
  requirement: !ruby/object:Gem::Requirement
235
292
  requirements:
236
293
  - - ">="
@@ -249,16 +306,17 @@ description: "\n Messaging system based on the reactor pattern.\n\n You ca
249
306
  hands over the message to the appropriate\n handler.\n\n You can choose your
250
307
  own queueing service.\n "
251
308
  email:
252
- - piotr@payrollhero.com
253
- - rmaravilla@payrollhero.com
309
+ - mathieu@payrollhero.com
254
310
  executables: []
255
311
  extensions: []
256
312
  extra_rdoc_files: []
257
313
  files:
258
314
  - ".codeclimate.yml"
315
+ - ".github/workflows/build.yml"
316
+ - ".github/workflows/rubocop-challenger.yml"
259
317
  - ".gitignore"
260
- - ".rubocop.hound.yml"
261
318
  - ".rubocop.yml"
319
+ - ".rubocop_todo.yml"
262
320
  - ".travis.yml"
263
321
  - CHANGELOG.md
264
322
  - DEPLOYING.md
@@ -267,6 +325,10 @@ files:
267
325
  - README.md
268
326
  - Rakefile
269
327
  - dispatch-rider.gemspec
328
+ - gemfiles/Gemfile-5-2
329
+ - gemfiles/Gemfile-6-0
330
+ - gemfiles/Gemfile-6-1
331
+ - gemfiles/Gemfile-7-0
270
332
  - lib/dispatch-rider.rb
271
333
  - lib/dispatch-rider/callbacks.rb
272
334
  - lib/dispatch-rider/callbacks/access.rb
@@ -378,7 +440,6 @@ files:
378
440
  - spec/lib/dispatch-rider/queue_services/file_system_spec.rb
379
441
  - spec/lib/dispatch-rider/queue_services/received_message_spec.rb
380
442
  - spec/lib/dispatch-rider/queue_services/simple_spec.rb
381
- - spec/lib/dispatch-rider/queue_services_spec.rb
382
443
  - spec/lib/dispatch-rider/registrars/base_spec.rb
383
444
  - spec/lib/dispatch-rider/registrars/file_system_channel_spec.rb
384
445
  - spec/lib/dispatch-rider/registrars/handler_spec.rb
@@ -406,16 +467,16 @@ require_paths:
406
467
  - lib
407
468
  required_ruby_version: !ruby/object:Gem::Requirement
408
469
  requirements:
409
- - - "~>"
470
+ - - ">="
410
471
  - !ruby/object:Gem::Version
411
- version: '2.2'
472
+ version: 2.6.5
412
473
  required_rubygems_version: !ruby/object:Gem::Requirement
413
474
  requirements:
414
475
  - - ">="
415
476
  - !ruby/object:Gem::Version
416
477
  version: '0'
417
478
  requirements: []
418
- rubygems_version: 3.0.4
479
+ rubygems_version: 3.3.5
419
480
  signing_key:
420
481
  specification_version: 4
421
482
  summary: Messaging system that is customizable based on which queueing system we are
@@ -457,7 +518,6 @@ test_files:
457
518
  - spec/lib/dispatch-rider/queue_services/file_system_spec.rb
458
519
  - spec/lib/dispatch-rider/queue_services/received_message_spec.rb
459
520
  - spec/lib/dispatch-rider/queue_services/simple_spec.rb
460
- - spec/lib/dispatch-rider/queue_services_spec.rb
461
521
  - spec/lib/dispatch-rider/registrars/base_spec.rb
462
522
  - spec/lib/dispatch-rider/registrars/file_system_channel_spec.rb
463
523
  - spec/lib/dispatch-rider/registrars/handler_spec.rb