dispatch-rider 2.1.0 → 2.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (128) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +21 -0
  3. data/.rubocop_todo.yml +17 -300
  4. data/Rakefile +2 -1
  5. data/dispatch-rider.gemspec +2 -2
  6. data/lib/dispatch-rider/callbacks/access.rb +2 -0
  7. data/lib/dispatch-rider/callbacks/storage.rb +7 -5
  8. data/lib/dispatch-rider/callbacks/support.rb +2 -0
  9. data/lib/dispatch-rider/callbacks.rb +2 -0
  10. data/lib/dispatch-rider/command.rb +3 -3
  11. data/lib/dispatch-rider/configuration.rb +3 -1
  12. data/lib/dispatch-rider/debug.rb +3 -1
  13. data/lib/dispatch-rider/demultiplexer.rb +17 -19
  14. data/lib/dispatch-rider/dispatcher.rb +2 -0
  15. data/lib/dispatch-rider/error_handlers.rb +3 -1
  16. data/lib/dispatch-rider/errors.rb +2 -0
  17. data/lib/dispatch-rider/handlers/base.rb +12 -10
  18. data/lib/dispatch-rider/handlers/inheritance_tracking.rb +2 -0
  19. data/lib/dispatch-rider/handlers/named_process.rb +2 -0
  20. data/lib/dispatch-rider/handlers.rb +2 -0
  21. data/lib/dispatch-rider/integrations/appsignal.rb +3 -1
  22. data/lib/dispatch-rider/logging/json_formatter.rb +2 -0
  23. data/lib/dispatch-rider/logging/lifecycle_logger.rb +2 -0
  24. data/lib/dispatch-rider/logging/text_formatter.rb +2 -0
  25. data/lib/dispatch-rider/logging/translator/base_translator.rb +2 -0
  26. data/lib/dispatch-rider/logging/translator/complete_translator.rb +2 -0
  27. data/lib/dispatch-rider/logging/translator/error_handler_fail_translator.rb +2 -0
  28. data/lib/dispatch-rider/logging/translator/fail_translator.rb +2 -0
  29. data/lib/dispatch-rider/logging/translator/start_translator.rb +2 -0
  30. data/lib/dispatch-rider/logging/translator/stop_translator.rb +2 -0
  31. data/lib/dispatch-rider/logging/translator/success_translator.rb +2 -0
  32. data/lib/dispatch-rider/logging/translator.rb +2 -0
  33. data/lib/dispatch-rider/logging.rb +2 -0
  34. data/lib/dispatch-rider/message.rb +3 -0
  35. data/lib/dispatch-rider/notification_services/aws_sns.rb +5 -3
  36. data/lib/dispatch-rider/notification_services/base.rb +2 -0
  37. data/lib/dispatch-rider/notification_services/file_system/channel.rb +2 -0
  38. data/lib/dispatch-rider/notification_services/file_system/notifier.rb +2 -0
  39. data/lib/dispatch-rider/notification_services/file_system.rb +3 -1
  40. data/lib/dispatch-rider/notification_services.rb +2 -0
  41. data/lib/dispatch-rider/publisher/base.rb +2 -0
  42. data/lib/dispatch-rider/publisher/configuration/destination.rb +6 -4
  43. data/lib/dispatch-rider/publisher/configuration/notification_service.rb +4 -2
  44. data/lib/dispatch-rider/publisher/configuration.rb +2 -0
  45. data/lib/dispatch-rider/publisher/configuration_reader.rb +2 -0
  46. data/lib/dispatch-rider/publisher/configuration_support.rb +3 -1
  47. data/lib/dispatch-rider/publisher.rb +3 -2
  48. data/lib/dispatch-rider/queue_services/aws_sqs/message_body_extractor.rb +2 -0
  49. data/lib/dispatch-rider/queue_services/aws_sqs/sqs_received_message.rb +6 -4
  50. data/lib/dispatch-rider/queue_services/aws_sqs.rb +5 -2
  51. data/lib/dispatch-rider/queue_services/base.rb +5 -4
  52. data/lib/dispatch-rider/queue_services/file_system/fs_received_message.rb +5 -3
  53. data/lib/dispatch-rider/queue_services/file_system/queue.rb +5 -4
  54. data/lib/dispatch-rider/queue_services/file_system.rb +7 -11
  55. data/lib/dispatch-rider/queue_services/received_message.rb +3 -1
  56. data/lib/dispatch-rider/queue_services/simple.rb +5 -7
  57. data/lib/dispatch-rider/queue_services.rb +2 -0
  58. data/lib/dispatch-rider/registrars/base.rb +5 -5
  59. data/lib/dispatch-rider/registrars/file_system_channel.rb +3 -1
  60. data/lib/dispatch-rider/registrars/handler.rb +3 -1
  61. data/lib/dispatch-rider/registrars/notification_service.rb +2 -0
  62. data/lib/dispatch-rider/registrars/publishing_destination.rb +3 -1
  63. data/lib/dispatch-rider/registrars/queue_service.rb +2 -0
  64. data/lib/dispatch-rider/registrars/sns_channel.rb +3 -1
  65. data/lib/dispatch-rider/registrars.rb +2 -0
  66. data/lib/dispatch-rider/runner.rb +2 -0
  67. data/lib/dispatch-rider/scheduled_job/migration.rb +2 -0
  68. data/lib/dispatch-rider/scheduled_job.rb +3 -3
  69. data/lib/dispatch-rider/subscriber.rb +2 -0
  70. data/lib/dispatch-rider/version.rb +3 -1
  71. data/lib/dispatch-rider.rb +3 -1
  72. data/lib/generators/dispatch_rider/install/install_generator.rb +2 -0
  73. data/lib/generators/dispatch_rider/install/templates/script/dispatch_rider +1 -0
  74. data/lib/generators/dispatch_rider/job/dispatch_job_generator.rb +2 -0
  75. data/spec/factories/messages.rb +4 -1
  76. data/spec/fixtures/handlers/another_test_handler.rb +2 -0
  77. data/spec/fixtures/handlers/test_handler.rb +2 -0
  78. data/spec/integration/logging_spec.rb +2 -0
  79. data/spec/lib/dispatch-rider/airbrake_error_handler_spec.rb +3 -1
  80. data/spec/lib/dispatch-rider/callbacks/access_spec.rb +2 -0
  81. data/spec/lib/dispatch-rider/callbacks/storage_spec.rb +2 -0
  82. data/spec/lib/dispatch-rider/configuration_spec.rb +3 -1
  83. data/spec/lib/dispatch-rider/default_error_handler_spec.rb +2 -0
  84. data/spec/lib/dispatch-rider/demultiplexer_spec.rb +4 -2
  85. data/spec/lib/dispatch-rider/dispatcher_spec.rb +12 -9
  86. data/spec/lib/dispatch-rider/handlers/base_spec.rb +2 -0
  87. data/spec/lib/dispatch-rider/handlers/inheritance_tracking_spec.rb +2 -0
  88. data/spec/lib/dispatch-rider/logging/json_formatter_spec.rb +2 -0
  89. data/spec/lib/dispatch-rider/logging/lifecycle_logger_spec.rb +3 -1
  90. data/spec/lib/dispatch-rider/logging/text_formatter_spec.rb +2 -0
  91. data/spec/lib/dispatch-rider/logging/translator_spec.rb +2 -0
  92. data/spec/lib/dispatch-rider/message_spec.rb +7 -5
  93. data/spec/lib/dispatch-rider/notification_services/aws_sns_spec.rb +2 -0
  94. data/spec/lib/dispatch-rider/notification_services/base_spec.rb +6 -4
  95. data/spec/lib/dispatch-rider/notification_services/file_system/channel_spec.rb +2 -0
  96. data/spec/lib/dispatch-rider/notification_services/file_system/notifier_spec.rb +2 -0
  97. data/spec/lib/dispatch-rider/notification_services/file_system_spec.rb +2 -0
  98. data/spec/lib/dispatch-rider/notification_services_spec.rb +2 -0
  99. data/spec/lib/dispatch-rider/publisher/base_spec.rb +2 -0
  100. data/spec/lib/dispatch-rider/publisher/configuration/destination_spec.rb +2 -0
  101. data/spec/lib/dispatch-rider/publisher/configuration/notification_service_spec.rb +2 -0
  102. data/spec/lib/dispatch-rider/publisher/configuration_reader_spec.rb +3 -1
  103. data/spec/lib/dispatch-rider/publisher/configuration_spec.rb +3 -1
  104. data/spec/lib/dispatch-rider/publisher/configuration_support_spec.rb +4 -2
  105. data/spec/lib/dispatch-rider/publisher_spec.rb +11 -9
  106. data/spec/lib/dispatch-rider/queue_services/aws_sqs_spec.rb +11 -4
  107. data/spec/lib/dispatch-rider/queue_services/base_spec.rb +10 -8
  108. data/spec/lib/dispatch-rider/queue_services/file_system_spec.rb +7 -5
  109. data/spec/lib/dispatch-rider/queue_services/received_message_spec.rb +2 -0
  110. data/spec/lib/dispatch-rider/queue_services/simple_spec.rb +6 -4
  111. data/spec/lib/dispatch-rider/registrars/base_spec.rb +4 -2
  112. data/spec/lib/dispatch-rider/registrars/file_system_channel_spec.rb +2 -0
  113. data/spec/lib/dispatch-rider/registrars/handler_spec.rb +2 -0
  114. data/spec/lib/dispatch-rider/registrars/notification_service_spec.rb +2 -0
  115. data/spec/lib/dispatch-rider/registrars/publishing_destination_spec.rb +2 -0
  116. data/spec/lib/dispatch-rider/registrars/queue_service_spec.rb +2 -0
  117. data/spec/lib/dispatch-rider/registrars/sns_channel_spec.rb +2 -0
  118. data/spec/lib/dispatch-rider/registrars_spec.rb +2 -0
  119. data/spec/lib/dispatch-rider/runner_spec.rb +3 -1
  120. data/spec/lib/dispatch-rider/scheduled_job_spec.rb +2 -0
  121. data/spec/lib/dispatch-rider/subscriber_spec.rb +6 -3
  122. data/spec/lib/dispatch-rider_spec.rb +2 -0
  123. data/spec/spec_helper.rb +1 -1
  124. data/spec/support/crashing_handler.rb +2 -0
  125. data/spec/support/integration_support.rb +2 -0
  126. data/spec/support/null_logger.rb +2 -0
  127. data/spec/support/sample_handler.rb +2 -0
  128. metadata +29 -29
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b8cefb6d56d04893f7ce7a4fc75dbd57f1c1148efac30e40ebd415190c480be6
4
- data.tar.gz: 84f3c1c18b51123a08434e6c389521d6ea30760bf5823d72178c699d36de38b4
3
+ metadata.gz: e2d285970e4f0568ed26104410b0c1619f48ca60583ed41a694ad06a92a146be
4
+ data.tar.gz: 9a7f5fb0656497f5b9598cad100a769397d1b64587a06673c834c628079ceb5a
5
5
  SHA512:
6
- metadata.gz: a52539c08456b5296f16cb02ce3e4c324307d23ae5bf4805a25ce1c5e437b0127dca7619a77f7957311657b16387d8d267f14fd0b85399b29a868f8ea7101727
7
- data.tar.gz: 49b41b85fb54f6454cef746095291484533f44cf8eaab3f536b63d2ab130279cacb3219b2aec6286cf50818fc71ec6f15f59f87d94043157e5700754fefde0d9
6
+ metadata.gz: 4d3d5c7f71b887e31b89a47742f9710431c87401862f534be2b67795e63b03403c898137ef3f07db65a01aa83c9d615958b4eccc6fb89bd22348863e9a46c66e
7
+ data.tar.gz: '02820503721cdafdbda6b53de96da2d678b13f32b0463c41d59052d2984fb13f614682ab23bb160f148f186ce4ae60f7b6e5f40bc16bd5eaae3f6750d8def6e8'
data/.rubocop.yml CHANGED
@@ -29,6 +29,13 @@ RSpec/VariableName:
29
29
  Exclude:
30
30
  - spec/lib/dispatch-rider/publisher/base_spec.rb
31
31
 
32
+ Style/CommentedKeyword:
33
+ Exclude:
34
+ - 'spec/lib/dispatch-rider/publisher/configuration_reader_spec.rb'
35
+
36
+ Style/RescueStandardError:
37
+ EnforcedStyle: implicit
38
+
32
39
  Style/StringLiterals:
33
40
  Enabled: false
34
41
 
@@ -64,3 +71,17 @@ Metrics/AbcSize:
64
71
  conditions.
65
72
  Enabled: true
66
73
  Max: 22
74
+
75
+ # We don't want to do this
76
+ Rails/ApplicationRecord:
77
+ Exclude:
78
+ - 'lib/dispatch-rider/scheduled_job.rb'
79
+
80
+ Style/PercentLiteralDelimiters:
81
+ Exclude:
82
+ - 'spec/lib/dispatch-rider/logging/json_formatter_spec.rb'
83
+ - 'spec/spec_helper.rb'
84
+
85
+ Style/FormatString:
86
+ Exclude:
87
+ - 'lib/dispatch-rider/logging/text_formatter.rb'
data/.rubocop_todo.yml CHANGED
@@ -1,6 +1,6 @@
1
1
  # This configuration was generated by
2
2
  # `rubocop --auto-gen-config`
3
- # on 2022-09-14 23:37:26 UTC using RuboCop version 1.36.0.
3
+ # on 2022-12-01 23:33:43 UTC using RuboCop version 1.39.0.
4
4
  # The point is for the user to remove these configuration records
5
5
  # one by one as the offenses are removed from the code base.
6
6
  # Note that changes in the inspected code, or installation of new
@@ -22,34 +22,13 @@ Layout/BlockAlignment:
22
22
  Exclude:
23
23
  - 'spec/lib/dispatch-rider/notification_services/aws_sns_spec.rb'
24
24
 
25
- # Offense count: 1
26
- # This cop supports safe autocorrection (--autocorrect).
27
- Layout/BlockEndNewline:
28
- Exclude:
29
- - 'spec/factories/messages.rb'
30
-
31
25
  # Offense count: 1
32
26
  # This cop supports safe autocorrection (--autocorrect).
33
27
  Layout/ClosingParenthesisIndentation:
34
28
  Exclude:
35
29
  - 'spec/lib/dispatch-rider/publisher_spec.rb'
36
30
 
37
- # Offense count: 3
38
- # This cop supports safe autocorrection (--autocorrect).
39
- Layout/EmptyLineAfterGuardClause:
40
- Exclude:
41
- - 'lib/dispatch-rider/message.rb'
42
- - 'lib/dispatch-rider/queue_services/aws_sqs.rb'
43
- - 'lib/dispatch-rider/queue_services/file_system/queue.rb'
44
-
45
- # Offense count: 1
46
- # This cop supports safe autocorrection (--autocorrect).
47
- # Configuration parameters: EmptyLineBetweenMethodDefs, EmptyLineBetweenClassDefs, EmptyLineBetweenModuleDefs, AllowAdjacentOneLineDefs, NumberOfEmptyLines.
48
- Layout/EmptyLineBetweenDefs:
49
- Exclude:
50
- - 'lib/dispatch-rider/queue_services/base.rb'
51
-
52
- # Offense count: 45
31
+ # Offense count: 53
53
32
  # This cop supports safe autocorrection (--autocorrect).
54
33
  # Configuration parameters: EnforcedStyle.
55
34
  # SupportedStyles: empty_lines, no_empty_lines
@@ -63,7 +42,7 @@ Layout/ExtraSpacing:
63
42
  Exclude:
64
43
  - 'spec/factories/messages.rb'
65
44
 
66
- # Offense count: 2
45
+ # Offense count: 4
67
46
  # This cop supports safe autocorrection (--autocorrect).
68
47
  # Configuration parameters: Width, AllowedPatterns, IgnoredPatterns.
69
48
  Layout/IndentationWidth:
@@ -82,7 +61,7 @@ Layout/LeadingCommentSpace:
82
61
  - 'lib/dispatch-rider/queue_services/received_message.rb'
83
62
  - 'spec/lib/dispatch-rider/configuration_spec.rb'
84
63
 
85
- # Offense count: 2
64
+ # Offense count: 3
86
65
  # This cop supports safe autocorrection (--autocorrect).
87
66
  # Configuration parameters: EnforcedStyle.
88
67
  # SupportedStyles: symmetrical, new_line, same_line
@@ -91,12 +70,6 @@ Layout/MultilineMethodCallBraceLayout:
91
70
  - 'spec/lib/dispatch-rider/logging/lifecycle_logger_spec.rb'
92
71
  - 'spec/lib/dispatch-rider/publisher_spec.rb'
93
72
 
94
- # Offense count: 2
95
- # This cop supports safe autocorrection (--autocorrect).
96
- Layout/SpaceAfterColon:
97
- Exclude:
98
- - 'spec/lib/dispatch-rider/queue_services/aws_sqs_spec.rb'
99
-
100
73
  # Offense count: 3
101
74
  # This cop supports safe autocorrection (--autocorrect).
102
75
  Layout/SpaceAfterComma:
@@ -119,15 +92,6 @@ Layout/SpaceAroundOperators:
119
92
  Exclude:
120
93
  - 'spec/lib/dispatch-rider/queue_services/aws_sqs_spec.rb'
121
94
 
122
- # Offense count: 1
123
- # This cop supports safe autocorrection (--autocorrect).
124
- # Configuration parameters: EnforcedStyle, EnforcedStyleForEmptyBraces.
125
- # SupportedStyles: space, no_space
126
- # SupportedStylesForEmptyBraces: space, no_space
127
- Layout/SpaceBeforeBlockBraces:
128
- Exclude:
129
- - 'lib/dispatch-rider/queue_services/file_system/queue.rb'
130
-
131
95
  # Offense count: 4
132
96
  # This cop supports safe autocorrection (--autocorrect).
133
97
  # Configuration parameters: EnforcedStyle.
@@ -147,7 +111,7 @@ Layout/SpaceInsideBlockBraces:
147
111
  Exclude:
148
112
  - 'lib/dispatch-rider/subscriber.rb'
149
113
 
150
- # Offense count: 41
114
+ # Offense count: 43
151
115
  # This cop supports safe autocorrection (--autocorrect).
152
116
  # Configuration parameters: EnforcedStyle, EnforcedStyleForEmptyBraces.
153
117
  # SupportedStyles: space, no_space, compact
@@ -177,22 +141,6 @@ Layout/TrailingEmptyLines:
177
141
  Exclude:
178
142
  - 'spec/lib/dispatch-rider/notification_services/file_system/notifier_spec.rb'
179
143
 
180
- # Offense count: 15
181
- # This cop supports safe autocorrection (--autocorrect).
182
- # Configuration parameters: AllowInHeredoc.
183
- Layout/TrailingWhitespace:
184
- Exclude:
185
- - 'lib/dispatch-rider/handlers/base.rb'
186
- - 'lib/dispatch-rider/queue_services/base.rb'
187
- - 'lib/dispatch-rider/queue_services/file_system.rb'
188
- - 'lib/dispatch-rider/queue_services/file_system/fs_received_message.rb'
189
-
190
- # Offense count: 1
191
- # This cop supports safe autocorrection (--autocorrect).
192
- Lint/AmbiguousOperator:
193
- Exclude:
194
- - 'Rakefile'
195
-
196
144
  # Offense count: 13
197
145
  # Configuration parameters: AllowedMethods.
198
146
  # AllowedMethods: enums
@@ -205,20 +153,13 @@ Lint/ConstantDefinitionInBlock:
205
153
  - 'spec/lib/dispatch-rider/publisher/base_spec.rb'
206
154
  - 'spec/lib/dispatch-rider/registrars/handler_spec.rb'
207
155
 
208
- # Offense count: 3
156
+ # Offense count: 2
209
157
  # Configuration parameters: AllowComments, AllowEmptyLambdas.
210
158
  Lint/EmptyBlock:
211
159
  Exclude:
212
160
  - 'spec/lib/dispatch-rider/notification_services_spec.rb'
213
- - 'spec/lib/dispatch-rider/queue_services_spec.rb'
214
161
  - 'spec/lib/dispatch-rider/registrars_spec.rb'
215
162
 
216
- # Offense count: 1
217
- # This cop supports unsafe autocorrection (--autocorrect-all).
218
- Lint/NonDeterministicRequireOrder:
219
- Exclude:
220
- - 'spec/spec_helper.rb'
221
-
222
163
  # Offense count: 2
223
164
  # This cop supports safe autocorrection (--autocorrect).
224
165
  Lint/RedundantStringCoercion:
@@ -241,26 +182,6 @@ Lint/ShadowingOuterLocalVariable:
241
182
  Exclude:
242
183
  - 'lib/dispatch-rider/command.rb'
243
184
 
244
- # Offense count: 7
245
- # This cop supports safe autocorrection (--autocorrect).
246
- # Configuration parameters: AllowUnusedKeywordArguments, IgnoreEmptyMethods, IgnoreNotImplementedMethods.
247
- Lint/UnusedMethodArgument:
248
- Exclude:
249
- - 'lib/dispatch-rider/error_handlers.rb'
250
- - 'lib/dispatch-rider/queue_services/simple.rb'
251
- - 'lib/dispatch-rider/registrars/file_system_channel.rb'
252
- - 'lib/dispatch-rider/registrars/handler.rb'
253
- - 'lib/dispatch-rider/registrars/publishing_destination.rb'
254
- - 'lib/dispatch-rider/registrars/sns_channel.rb'
255
- - 'spec/lib/dispatch-rider/subscriber_spec.rb'
256
-
257
- # Offense count: 1
258
- # This cop supports safe autocorrection (--autocorrect).
259
- # Configuration parameters: ContextCreatingMethods, MethodCreatingMethods.
260
- Lint/UselessAccessModifier:
261
- Exclude:
262
- - 'lib/dispatch-rider/scheduled_job.rb'
263
-
264
185
  # Offense count: 1
265
186
  # Configuration parameters: AllowedMethods, AllowedPatterns, IgnoredMethods.
266
187
  Metrics/CyclomaticComplexity:
@@ -285,13 +206,6 @@ Naming/RescuedExceptionsVariableName:
285
206
  - 'lib/dispatch-rider/demultiplexer.rb'
286
207
  - 'lib/dispatch-rider/logging/lifecycle_logger.rb'
287
208
 
288
- # Offense count: 2
289
- # This cop supports safe autocorrection (--autocorrect).
290
- Performance/RedundantBlockCall:
291
- Exclude:
292
- - 'lib/dispatch-rider/command.rb'
293
- - 'lib/dispatch-rider/queue_services/base.rb'
294
-
295
209
  # Offense count: 10
296
210
  RSpec/AnyInstance:
297
211
  Exclude:
@@ -311,21 +225,6 @@ RSpec/ContextWording:
311
225
  - 'spec/lib/dispatch-rider/publisher/base_spec.rb'
312
226
  - 'spec/lib/dispatch-rider/publisher/configuration/notification_service_spec.rb'
313
227
 
314
- # Offense count: 13
315
- # This cop supports unsafe autocorrection (--autocorrect-all).
316
- # Configuration parameters: SkipBlocks, EnforcedStyle.
317
- # SupportedStyles: described_class, explicit
318
- RSpec/DescribedClass:
319
- Exclude:
320
- - 'spec/lib/dispatch-rider/demultiplexer_spec.rb'
321
- - 'spec/lib/dispatch-rider/logging/lifecycle_logger_spec.rb'
322
- - 'spec/lib/dispatch-rider/message_spec.rb'
323
- - 'spec/lib/dispatch-rider/notification_services/base_spec.rb'
324
- - 'spec/lib/dispatch-rider/queue_services/aws_sqs_spec.rb'
325
- - 'spec/lib/dispatch-rider/queue_services/base_spec.rb'
326
- - 'spec/lib/dispatch-rider/queue_services/file_system_spec.rb'
327
- - 'spec/lib/dispatch-rider/queue_services/simple_spec.rb'
328
-
329
228
  # Offense count: 2
330
229
  # This cop supports unsafe autocorrection (--autocorrect-all).
331
230
  RSpec/EmptyExampleGroup:
@@ -340,14 +239,6 @@ RSpec/EmptyLineAfterExample:
340
239
  Exclude:
341
240
  - 'spec/lib/dispatch-rider/demultiplexer_spec.rb'
342
241
 
343
- # Offense count: 2
344
- # This cop supports safe autocorrection (--autocorrect).
345
- # Configuration parameters: AllowConsecutiveOneLiners.
346
- RSpec/EmptyLineAfterHook:
347
- Exclude:
348
- - 'spec/lib/dispatch-rider/dispatcher_spec.rb'
349
- - 'spec/lib/dispatch-rider/subscriber_spec.rb'
350
-
351
242
  # Offense count: 14
352
243
  # This cop supports safe autocorrection (--autocorrect).
353
244
  RSpec/EmptyLineAfterSubject:
@@ -356,14 +247,15 @@ RSpec/EmptyLineAfterSubject:
356
247
  - 'spec/lib/dispatch-rider/publisher/configuration/destination_spec.rb'
357
248
  - 'spec/lib/dispatch-rider/publisher/configuration/notification_service_spec.rb'
358
249
 
359
- # Offense count: 19
250
+ # Offense count: 21
360
251
  # Configuration parameters: CountAsOne.
361
252
  RSpec/ExampleLength:
362
253
  Max: 31
363
254
 
364
- # Offense count: 66
255
+ # Offense count: 65
365
256
  # This cop supports safe autocorrection (--autocorrect).
366
- # Configuration parameters: CustomTransform, IgnoredWords.
257
+ # Configuration parameters: CustomTransform, IgnoredWords, DisallowedExamples.
258
+ # DisallowedExamples: works
367
259
  RSpec/ExampleWording:
368
260
  Exclude:
369
261
  - 'spec/lib/dispatch-rider/demultiplexer_spec.rb'
@@ -374,40 +266,19 @@ RSpec/ExampleWording:
374
266
  - 'spec/lib/dispatch-rider/queue_services/base_spec.rb'
375
267
  - 'spec/lib/dispatch-rider/queue_services/file_system_spec.rb'
376
268
  - 'spec/lib/dispatch-rider/queue_services/simple_spec.rb'
377
- - 'spec/lib/dispatch-rider/queue_services_spec.rb'
378
269
  - 'spec/lib/dispatch-rider/registrars/base_spec.rb'
379
270
  - 'spec/lib/dispatch-rider/subscriber_spec.rb'
380
271
 
381
- # Offense count: 45
272
+ # Offense count: 44
382
273
  # Configuration parameters: Include, CustomTransform, IgnoreMethods, SpecSuffixOnly.
383
274
  # Include: **/*_spec*rb*, **/spec/**/*
384
275
  RSpec/FilePath:
385
276
  Enabled: false
386
277
 
387
- # Offense count: 30
388
- # This cop supports safe autocorrection (--autocorrect).
389
- # Configuration parameters: EnforcedStyle.
390
- # SupportedStyles: implicit, each, example
391
- RSpec/HookArgument:
392
- Exclude:
393
- - 'spec/lib/dispatch-rider/configuration_spec.rb'
394
- - 'spec/lib/dispatch-rider/dispatcher_spec.rb'
395
- - 'spec/lib/dispatch-rider/notification_services/base_spec.rb'
396
- - 'spec/lib/dispatch-rider/publisher/configuration_spec.rb'
397
- - 'spec/lib/dispatch-rider/publisher/configuration_support_spec.rb'
398
- - 'spec/lib/dispatch-rider/publisher_spec.rb'
399
- - 'spec/lib/dispatch-rider/queue_services/aws_sqs_spec.rb'
400
- - 'spec/lib/dispatch-rider/queue_services/base_spec.rb'
401
- - 'spec/lib/dispatch-rider/queue_services/file_system_spec.rb'
402
- - 'spec/lib/dispatch-rider/queue_services/simple_spec.rb'
403
- - 'spec/lib/dispatch-rider/registrars/base_spec.rb'
404
- - 'spec/lib/dispatch-rider/runner_spec.rb'
405
- - 'spec/lib/dispatch-rider/subscriber_spec.rb'
406
-
407
278
  # Offense count: 1
408
279
  # This cop supports safe autocorrection (--autocorrect).
409
280
  # Configuration parameters: EnforcedStyle.
410
- # SupportedStyles: single_line_only, single_statement_only, disallow
281
+ # SupportedStyles: single_line_only, single_statement_only, disallow, require_implicit
411
282
  RSpec/ImplicitSubject:
412
283
  Exclude:
413
284
  - 'spec/lib/dispatch-rider/scheduled_job_spec.rb'
@@ -422,13 +293,13 @@ RSpec/LeakyConstantDeclaration:
422
293
  - 'spec/lib/dispatch-rider/publisher/base_spec.rb'
423
294
  - 'spec/lib/dispatch-rider/registrars/handler_spec.rb'
424
295
 
425
- # Offense count: 62
296
+ # Offense count: 65
426
297
  # Configuration parameters: .
427
298
  # SupportedStyles: have_received, receive
428
299
  RSpec/MessageSpies:
429
300
  EnforcedStyle: receive
430
301
 
431
- # Offense count: 50
302
+ # Offense count: 51
432
303
  RSpec/MultipleExpectations:
433
304
  Max: 6
434
305
 
@@ -438,7 +309,8 @@ RSpec/MultipleMemoizedHelpers:
438
309
  Max: 12
439
310
 
440
311
  # Offense count: 173
441
- # Configuration parameters: IgnoreSharedExamples.
312
+ # Configuration parameters: EnforcedStyle, IgnoreSharedExamples.
313
+ # SupportedStyles: always, named_only
442
314
  RSpec/NamedSubject:
443
315
  Enabled: false
444
316
 
@@ -457,13 +329,6 @@ RSpec/NotToNot:
457
329
  - 'spec/lib/dispatch-rider/publisher/configuration_reader_spec.rb'
458
330
  - 'spec/lib/dispatch-rider/scheduled_job_spec.rb'
459
331
 
460
- # Offense count: 2
461
- # This cop supports safe autocorrection (--autocorrect).
462
- RSpec/ReceiveCounts:
463
- Exclude:
464
- - 'spec/lib/dispatch-rider/demultiplexer_spec.rb'
465
- - 'spec/lib/dispatch-rider/publisher/configuration_reader_spec.rb'
466
-
467
332
  # Offense count: 2
468
333
  RSpec/RepeatedExampleGroupDescription:
469
334
  Exclude:
@@ -510,21 +375,6 @@ RSpec/VerifiedDoubles:
510
375
  - 'spec/lib/dispatch-rider/runner_spec.rb'
511
376
  - 'spec/lib/dispatch-rider/subscriber_spec.rb'
512
377
 
513
- # Offense count: 1
514
- # This cop supports unsafe autocorrection (--autocorrect-all).
515
- Rails/ApplicationRecord:
516
- Exclude:
517
- - 'lib/dispatch-rider/scheduled_job.rb'
518
-
519
- # Offense count: 5
520
- # This cop supports safe autocorrection (--autocorrect).
521
- # Configuration parameters: EnforceForPrefixed.
522
- Rails/Delegate:
523
- Exclude:
524
- - 'lib/dispatch-rider/queue_services/file_system.rb'
525
- - 'lib/dispatch-rider/queue_services/file_system/queue.rb'
526
- - 'lib/dispatch-rider/queue_services/simple.rb'
527
-
528
378
  # Offense count: 2
529
379
  # Configuration parameters: Include.
530
380
  # Include: app/**/*.rb, config/**/*.rb, lib/**/*.rb
@@ -580,15 +430,6 @@ Security/JSONLoad:
580
430
  - 'spec/integration/logging_spec.rb'
581
431
  - 'spec/lib/dispatch-rider/publisher_spec.rb'
582
432
 
583
- # Offense count: 2
584
- # This cop supports safe autocorrection (--autocorrect).
585
- # Configuration parameters: EnforcedStyle.
586
- # SupportedStyles: prefer_alias, prefer_alias_method
587
- Style/Alias:
588
- Exclude:
589
- - 'lib/dispatch-rider.rb'
590
- - 'lib/dispatch-rider/publisher/configuration_support.rb'
591
-
592
433
  # Offense count: 7
593
434
  # This cop supports unsafe autocorrection (--autocorrect-all).
594
435
  # Configuration parameters: EnforcedStyle.
@@ -608,23 +449,11 @@ Style/ClassVars:
608
449
  Exclude:
609
450
  - 'lib/dispatch-rider/publisher/base.rb'
610
451
 
611
- # Offense count: 1
612
- # This cop supports unsafe autocorrection (--autocorrect-all).
613
- Style/CommentedKeyword:
614
- Exclude:
615
- - 'spec/lib/dispatch-rider/publisher/configuration_reader_spec.rb'
616
-
617
452
  # Offense count: 63
618
453
  # Configuration parameters: AllowedConstants.
619
454
  Style/Documentation:
620
455
  Enabled: false
621
456
 
622
- # Offense count: 1
623
- # This cop supports safe autocorrection (--autocorrect).
624
- Style/EachWithObject:
625
- Exclude:
626
- - 'lib/dispatch-rider/publisher.rb'
627
-
628
457
  # Offense count: 1
629
458
  # This cop supports safe autocorrection (--autocorrect).
630
459
  # Configuration parameters: EnforcedStyle.
@@ -648,36 +477,9 @@ Style/ExpandPathArguments:
648
477
 
649
478
  # Offense count: 1
650
479
  # This cop supports safe autocorrection (--autocorrect).
651
- Style/FileWrite:
652
- Exclude:
653
- - 'lib/dispatch-rider/queue_services/file_system/queue.rb'
654
-
655
- # Offense count: 1
656
- # This cop supports safe autocorrection (--autocorrect).
657
- # Configuration parameters: EnforcedStyle.
658
- # SupportedStyles: format, sprintf, percent
659
- Style/FormatString:
660
- Exclude:
661
- - 'lib/dispatch-rider/logging/text_formatter.rb'
662
-
663
- # Offense count: 123
664
- # This cop supports unsafe autocorrection (--autocorrect-all).
665
- # Configuration parameters: EnforcedStyle.
666
- # SupportedStyles: always, always_true, never
667
- Style/FrozenStringLiteralComment:
668
- Enabled: false
669
-
670
- # Offense count: 1
671
- # This cop supports unsafe autocorrection (--autocorrect-all).
672
- Style/GlobalStdStream:
673
- Exclude:
674
- - 'lib/dispatch-rider/configuration.rb'
675
-
676
- # Offense count: 2
677
480
  # Configuration parameters: MinBodyLength, AllowConsecutiveConditionals.
678
481
  Style/GuardClause:
679
482
  Exclude:
680
- - 'lib/dispatch-rider/queue_services/aws_sqs/sqs_received_message.rb'
681
483
  - 'lib/dispatch-rider/queue_services/base.rb'
682
484
 
683
485
  # Offense count: 2
@@ -709,12 +511,6 @@ Style/HashSyntax:
709
511
  - 'spec/lib/dispatch-rider/queue_services/file_system_spec.rb'
710
512
  - 'spec/lib/dispatch-rider/registrars/publishing_destination_spec.rb'
711
513
 
712
- # Offense count: 1
713
- # This cop supports safe autocorrection (--autocorrect).
714
- Style/IfUnlessModifier:
715
- Exclude:
716
- - 'lib/dispatch-rider/queue_services/aws_sqs/sqs_received_message.rb'
717
-
718
514
  # Offense count: 1
719
515
  # This cop supports safe autocorrection (--autocorrect).
720
516
  # Configuration parameters: EnforcedStyle.
@@ -723,21 +519,12 @@ Style/Lambda:
723
519
  Exclude:
724
520
  - 'spec/lib/dispatch-rider/logging/lifecycle_logger_spec.rb'
725
521
 
726
- # Offense count: 1
727
- # This cop supports unsafe autocorrection (--autocorrect-all).
728
- # Configuration parameters: EnforcedStyle.
729
- # SupportedStyles: literals, strict
730
- Style/MutableConstant:
731
- Exclude:
732
- - 'lib/dispatch-rider/version.rb'
733
-
734
- # Offense count: 3
522
+ # Offense count: 2
735
523
  # This cop supports safe autocorrection (--autocorrect).
736
524
  # Configuration parameters: AllowedMethods.
737
525
  # AllowedMethods: be, be_a, be_an, be_between, be_falsey, be_kind_of, be_instance_of, be_truthy, be_within, eq, eql, end_with, include, match, raise_error, respond_to, start_with
738
526
  Style/NestedParenthesizedCalls:
739
527
  Exclude:
740
- - 'lib/dispatch-rider/publisher.rb'
741
528
  - 'spec/lib/dispatch-rider/notification_services/aws_sns_spec.rb'
742
529
  - 'spec/lib/dispatch-rider/notification_services/base_spec.rb'
743
530
 
@@ -771,14 +558,6 @@ Style/OpenStructUse:
771
558
  - 'spec/lib/dispatch-rider/queue_services/aws_sqs_spec.rb'
772
559
  - 'spec/lib/dispatch-rider/queue_services/base_spec.rb'
773
560
 
774
- # Offense count: 2
775
- # This cop supports safe autocorrection (--autocorrect).
776
- # Configuration parameters: PreferredDelimiters.
777
- Style/PercentLiteralDelimiters:
778
- Exclude:
779
- - 'spec/lib/dispatch-rider/logging/json_formatter_spec.rb'
780
- - 'spec/spec_helper.rb'
781
-
782
561
  # Offense count: 2
783
562
  # This cop supports unsafe autocorrection (--autocorrect-all).
784
563
  # Configuration parameters: EnforcedStyle.
@@ -788,35 +567,6 @@ Style/PreferredHashMethods:
788
567
  - 'lib/dispatch-rider/publisher.rb'
789
568
  - 'lib/dispatch-rider/queue_services/aws_sqs/message_body_extractor.rb'
790
569
 
791
- # Offense count: 1
792
- # This cop supports safe autocorrection (--autocorrect).
793
- # Configuration parameters: .
794
- # SupportedStyles: same_as_string_literals, single_quotes, double_quotes
795
- Style/QuotedSymbols:
796
- EnforcedStyle: double_quotes
797
-
798
- # Offense count: 8
799
- # This cop supports safe autocorrection (--autocorrect).
800
- Style/RedundantBegin:
801
- Exclude:
802
- - 'lib/dispatch-rider/callbacks/storage.rb'
803
- - 'lib/dispatch-rider/demultiplexer.rb'
804
- - 'lib/dispatch-rider/queue_services/file_system.rb'
805
- - 'lib/dispatch-rider/registrars/base.rb'
806
- - 'spec/lib/dispatch-rider/dispatcher_spec.rb'
807
- - 'spec/lib/dispatch-rider/publisher_spec.rb'
808
-
809
- # Offense count: 11
810
- # This cop supports safe autocorrection (--autocorrect).
811
- Style/RedundantSelf:
812
- Exclude:
813
- - 'lib/dispatch-rider/handlers/base.rb'
814
- - 'lib/dispatch-rider/notification_services/aws_sns.rb'
815
- - 'lib/dispatch-rider/notification_services/file_system.rb'
816
- - 'lib/dispatch-rider/publisher/configuration/destination.rb'
817
- - 'lib/dispatch-rider/publisher/configuration/notification_service.rb'
818
- - 'lib/dispatch-rider/queue_services/received_message.rb'
819
-
820
570
  # Offense count: 1
821
571
  # This cop supports safe autocorrection (--autocorrect).
822
572
  # Configuration parameters: EnforcedStyle, AllowInnerSlashes.
@@ -825,15 +575,6 @@ Style/RegexpLiteral:
825
575
  Exclude:
826
576
  - 'spec/lib/dispatch-rider/configuration_spec.rb'
827
577
 
828
- # Offense count: 4
829
- # This cop supports safe autocorrection (--autocorrect).
830
- # Configuration parameters: EnforcedStyle.
831
- # SupportedStyles: implicit, explicit
832
- Style/RescueStandardError:
833
- Exclude:
834
- - 'lib/dispatch-rider/demultiplexer.rb'
835
- - 'lib/dispatch-rider/logging/lifecycle_logger.rb'
836
-
837
578
  # Offense count: 2
838
579
  # This cop supports unsafe autocorrection (--autocorrect-all).
839
580
  # Configuration parameters: RequireEnglish.
@@ -852,30 +593,6 @@ Style/StringConcatenation:
852
593
  - 'lib/generators/dispatch_rider/job/dispatch_job_generator.rb'
853
594
  - 'spec/spec_helper.rb'
854
595
 
855
- # Offense count: 1
856
- # This cop supports unsafe autocorrection (--autocorrect-all).
857
- # Configuration parameters: AllowMethodsWithArguments, AllowedMethods, AllowedPatterns, IgnoredMethods, AllowComments.
858
- # AllowedMethods: respond_to, define_method
859
- Style/SymbolProc:
860
- Exclude:
861
- - 'spec/lib/dispatch-rider/queue_services/base_spec.rb'
862
-
863
- # Offense count: 1
864
- # This cop supports safe autocorrection (--autocorrect).
865
- # Configuration parameters: EnforcedStyleForMultiline.
866
- # SupportedStylesForMultiline: comma, consistent_comma, no_comma
867
- Style/TrailingCommaInArguments:
868
- Exclude:
869
- - 'lib/dispatch-rider/integrations/appsignal.rb'
870
-
871
- # Offense count: 1
872
- # This cop supports safe autocorrection (--autocorrect).
873
- # Configuration parameters: EnforcedStyleForMultiline.
874
- # SupportedStylesForMultiline: comma, consistent_comma, no_comma
875
- Style/TrailingCommaInArrayLiteral:
876
- Exclude:
877
- - 'spec/lib/dispatch-rider/airbrake_error_handler_spec.rb'
878
-
879
596
  # Offense count: 37
880
597
  # This cop supports safe autocorrection (--autocorrect).
881
598
  # Configuration parameters: EnforcedStyleForMultiline.
data/Rakefile CHANGED
@@ -1,4 +1,5 @@
1
1
  # encoding: utf-8
2
+ # frozen_string_literal: true
2
3
 
3
4
  require 'rubygems'
4
5
 
@@ -7,7 +8,7 @@ begin
7
8
  rescue LoadError => e
8
9
  warn e.message
9
10
  warn "Run `gem install bundler` to install Bundler."
10
- exit -1
11
+ exit(-1)
11
12
  end
12
13
 
13
14
  begin
@@ -44,14 +44,14 @@ Gem::Specification.new do |gem|
44
44
  gem.add_runtime_dependency 'activesupport', '>= 5.2.0'
45
45
  gem.add_runtime_dependency 'activemodel', '>= 5.2.0'
46
46
  gem.add_runtime_dependency 'activerecord', '>= 5.2.0'
47
+ gem.add_runtime_dependency 'aws-sdk-sqs', '~> 1.30'
48
+ gem.add_runtime_dependency 'aws-sdk-sns', '~> 1.30'
47
49
  gem.add_runtime_dependency 'daemons', '~> 1.2'
48
50
  gem.add_runtime_dependency 'retriable', '~> 3.1', '>= 3.1.2'
49
51
  # appsignal is an optional runtime dependency,
50
52
  # I am marking it as development for those that don't need it
51
53
  gem.add_development_dependency 'appsignal', '~> 1.0'
52
54
 
53
- gem.add_development_dependency 'aws-sdk-sqs', '~> 1.30'
54
- gem.add_development_dependency 'aws-sdk-sns', '~> 1.30'
55
55
  gem.add_development_dependency 'bundler', '< 3.0'
56
56
  gem.add_development_dependency 'coveralls_reborn', '~> 0.25'
57
57
  gem.add_development_dependency 'simplecov-lcov'
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module DispatchRider
2
4
  module Callbacks
3
5
  # Provides access for invoking callbacks.
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module DispatchRider
2
4
  module Callbacks
3
5
  # Storage for callbacks.
@@ -21,11 +23,11 @@ module DispatchRider
21
23
  # @param [Proc] &block
22
24
  def after(event, block_param = nil, &block)
23
25
  around(event) do |job, *args|
24
- begin
25
- job.call
26
- ensure
27
- (block_param || block).call(*args)
28
- end
26
+
27
+ job.call
28
+ ensure
29
+ (block_param || block).call(*args)
30
+
29
31
  end
30
32
  end
31
33
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module DispatchRider
2
4
  module Callbacks
3
5
  # Adds callback support to an object.
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module DispatchRider
2
4
  module Callbacks
3
5
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'daemons'
2
4
  require 'pathname'
3
5
  require 'optparse'
@@ -23,9 +25,7 @@ module DispatchRider
23
25
  process_name = "dispatch_rider.#{@options[:identifier]}"
24
26
  Daemons.run_proc(process_name, @options) do
25
27
  $0 = File.join(@options[:prefix], process_name) if @options[:prefix]
26
- Dir.chdir(@app_home.to_s) do
27
- block.call
28
- end
28
+ Dir.chdir(@app_home.to_s, &block)
29
29
  end
30
30
  end
31
31