rabbit_messaging 1.2.0 → 1.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +4 -5
- data/Gemfile.lock +60 -194
- data/config/sneakers.yml +9 -0
- data/environments/development.rb +1 -5
- data/lib/rabbit/daemon.rb +2 -9
- data/lib/rabbit/publishing.rb +2 -2
- data/lib/rabbit/receiving/job.rb +7 -6
- data/lib/rabbit/version.rb +1 -1
- data/lib/rabbit.rb +21 -4
- data/rabbit_messaging.gemspec +1 -3
- metadata +3 -30
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e91522365755a8fd4311204e3419daed0e81cbc30a4e47d72e8db6ff7a1230b2
|
4
|
+
data.tar.gz: 470eecbf8666625d4ca314d01c24c4d1de2b8a3896838bd127d86bc9e43226b8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 35e7ba113d41de62dc9a5eceb5c7dc47e1398182889af1c54025d87f2c1bc05fc49d80d45a791151773843c23669720f5edc10f05cadc153820c6532b248186b
|
7
|
+
data.tar.gz: 75332f60efe6ed6485bf4dc8e36162f5e7d39f5df6134ca7a16c1ba9223ab06f790ee76a7a1892bfd3dd20411164abdf8d6947ca0fbbd7a670453ec3e9a9f8f0
|
data/Gemfile
CHANGED
@@ -3,15 +3,14 @@
|
|
3
3
|
source "https://rubygems.org"
|
4
4
|
gemspec
|
5
5
|
|
6
|
-
gem "benchmark"
|
7
|
-
gem "bundler"
|
8
|
-
gem "ostruct"
|
9
6
|
gem "pry"
|
10
|
-
gem "
|
11
|
-
gem "rake"
|
7
|
+
gem "reline"
|
12
8
|
gem "rspec"
|
13
9
|
gem "rspec-its"
|
14
10
|
gem "rubocop-config-umbrellio"
|
15
11
|
gem "simplecov"
|
16
12
|
gem "simplecov-lcov"
|
13
|
+
|
14
|
+
gem "activejob"
|
15
|
+
gem "activerecord"
|
17
16
|
gem "sneakers_handlers", github: "umbrellio/sneakers_handlers"
|
data/Gemfile.lock
CHANGED
@@ -8,268 +8,139 @@ GIT
|
|
8
8
|
PATH
|
9
9
|
remote: .
|
10
10
|
specs:
|
11
|
-
rabbit_messaging (1.
|
11
|
+
rabbit_messaging (1.3.0)
|
12
12
|
bunny (~> 2.0)
|
13
|
-
kicks
|
14
|
-
lamian
|
15
|
-
rails (>= 6.1)
|
13
|
+
kicks
|
16
14
|
tainbox
|
17
15
|
|
18
16
|
GEM
|
19
17
|
remote: https://rubygems.org/
|
20
18
|
specs:
|
21
|
-
|
22
|
-
|
23
|
-
activesupport (= 7.1.4.1)
|
24
|
-
nio4r (~> 2.0)
|
25
|
-
websocket-driver (>= 0.6.1)
|
26
|
-
zeitwerk (~> 2.6)
|
27
|
-
actionmailbox (7.1.4.1)
|
28
|
-
actionpack (= 7.1.4.1)
|
29
|
-
activejob (= 7.1.4.1)
|
30
|
-
activerecord (= 7.1.4.1)
|
31
|
-
activestorage (= 7.1.4.1)
|
32
|
-
activesupport (= 7.1.4.1)
|
33
|
-
mail (>= 2.7.1)
|
34
|
-
net-imap
|
35
|
-
net-pop
|
36
|
-
net-smtp
|
37
|
-
actionmailer (7.1.4.1)
|
38
|
-
actionpack (= 7.1.4.1)
|
39
|
-
actionview (= 7.1.4.1)
|
40
|
-
activejob (= 7.1.4.1)
|
41
|
-
activesupport (= 7.1.4.1)
|
42
|
-
mail (~> 2.5, >= 2.5.4)
|
43
|
-
net-imap
|
44
|
-
net-pop
|
45
|
-
net-smtp
|
46
|
-
rails-dom-testing (~> 2.2)
|
47
|
-
actionpack (7.1.4.1)
|
48
|
-
actionview (= 7.1.4.1)
|
49
|
-
activesupport (= 7.1.4.1)
|
50
|
-
nokogiri (>= 1.8.5)
|
51
|
-
racc
|
52
|
-
rack (>= 2.2.4)
|
53
|
-
rack-session (>= 1.0.1)
|
54
|
-
rack-test (>= 0.6.3)
|
55
|
-
rails-dom-testing (~> 2.2)
|
56
|
-
rails-html-sanitizer (~> 1.6)
|
57
|
-
actiontext (7.1.4.1)
|
58
|
-
actionpack (= 7.1.4.1)
|
59
|
-
activerecord (= 7.1.4.1)
|
60
|
-
activestorage (= 7.1.4.1)
|
61
|
-
activesupport (= 7.1.4.1)
|
62
|
-
globalid (>= 0.6.0)
|
63
|
-
nokogiri (>= 1.8.5)
|
64
|
-
actionview (7.1.4.1)
|
65
|
-
activesupport (= 7.1.4.1)
|
66
|
-
builder (~> 3.1)
|
67
|
-
erubi (~> 1.11)
|
68
|
-
rails-dom-testing (~> 2.2)
|
69
|
-
rails-html-sanitizer (~> 1.6)
|
70
|
-
activejob (7.1.4.1)
|
71
|
-
activesupport (= 7.1.4.1)
|
19
|
+
activejob (7.2.2.1)
|
20
|
+
activesupport (= 7.2.2.1)
|
72
21
|
globalid (>= 0.3.6)
|
73
|
-
activemodel (7.
|
74
|
-
activesupport (= 7.
|
75
|
-
activerecord (7.
|
76
|
-
activemodel (= 7.
|
77
|
-
activesupport (= 7.
|
22
|
+
activemodel (7.2.2.1)
|
23
|
+
activesupport (= 7.2.2.1)
|
24
|
+
activerecord (7.2.2.1)
|
25
|
+
activemodel (= 7.2.2.1)
|
26
|
+
activesupport (= 7.2.2.1)
|
78
27
|
timeout (>= 0.4.0)
|
79
|
-
|
80
|
-
actionpack (= 7.1.4.1)
|
81
|
-
activejob (= 7.1.4.1)
|
82
|
-
activerecord (= 7.1.4.1)
|
83
|
-
activesupport (= 7.1.4.1)
|
84
|
-
marcel (~> 1.0)
|
85
|
-
activesupport (7.1.4.1)
|
28
|
+
activesupport (7.2.2.1)
|
86
29
|
base64
|
30
|
+
benchmark (>= 0.3)
|
87
31
|
bigdecimal
|
88
|
-
concurrent-ruby (~> 1.0, >= 1.
|
32
|
+
concurrent-ruby (~> 1.0, >= 1.3.1)
|
89
33
|
connection_pool (>= 2.2.5)
|
90
34
|
drb
|
91
35
|
i18n (>= 1.6, < 2)
|
36
|
+
logger (>= 1.4.2)
|
92
37
|
minitest (>= 5.1)
|
93
|
-
|
94
|
-
tzinfo (~> 2.0)
|
38
|
+
securerandom (>= 0.3)
|
39
|
+
tzinfo (~> 2.0, >= 2.0.5)
|
95
40
|
amq-protocol (2.3.2)
|
96
41
|
ast (2.4.2)
|
97
42
|
base64 (0.2.0)
|
98
43
|
benchmark (0.4.0)
|
99
|
-
bigdecimal (3.1.
|
100
|
-
builder (3.3.0)
|
44
|
+
bigdecimal (3.1.9)
|
101
45
|
bunny (2.23.0)
|
102
46
|
amq-protocol (~> 2.3, >= 2.3.1)
|
103
47
|
sorted_set (~> 1, >= 1.0.2)
|
104
48
|
coderay (1.1.3)
|
105
|
-
concurrent-ruby (1.3.
|
106
|
-
connection_pool (2.
|
107
|
-
crass (1.0.6)
|
108
|
-
date (3.3.4)
|
49
|
+
concurrent-ruby (1.3.5)
|
50
|
+
connection_pool (2.5.0)
|
109
51
|
diff-lcs (1.5.1)
|
110
52
|
docile (1.4.1)
|
111
53
|
drb (2.2.1)
|
112
|
-
erubi (1.13.0)
|
113
54
|
globalid (1.2.1)
|
114
55
|
activesupport (>= 6.1)
|
115
|
-
i18n (1.14.
|
56
|
+
i18n (1.14.7)
|
116
57
|
concurrent-ruby (~> 1.0)
|
117
|
-
io-console (0.
|
118
|
-
|
119
|
-
|
120
|
-
reline (>= 0.4.2)
|
121
|
-
json (2.7.2)
|
122
|
-
kicks (3.1.0)
|
58
|
+
io-console (0.8.0)
|
59
|
+
json (2.10.0)
|
60
|
+
kicks (3.2.0)
|
123
61
|
bunny (~> 2.19)
|
124
62
|
concurrent-ruby (~> 1.0)
|
125
63
|
rake (>= 12.3, < 14.0)
|
126
64
|
serverengine (~> 2.1)
|
127
65
|
thor
|
128
|
-
|
129
|
-
|
130
|
-
language_server-protocol (3.17.0.3)
|
131
|
-
logger (1.6.1)
|
132
|
-
loofah (2.23.1)
|
133
|
-
crass (~> 1.0.2)
|
134
|
-
nokogiri (>= 1.12.0)
|
135
|
-
mail (2.8.1)
|
136
|
-
mini_mime (>= 0.1.1)
|
137
|
-
net-imap
|
138
|
-
net-pop
|
139
|
-
net-smtp
|
140
|
-
marcel (1.0.4)
|
66
|
+
language_server-protocol (3.17.0.4)
|
67
|
+
logger (1.6.5)
|
141
68
|
method_source (1.1.0)
|
142
|
-
|
143
|
-
mini_portile2 (2.8.8)
|
144
|
-
minitest (5.25.1)
|
145
|
-
mutex_m (0.2.0)
|
146
|
-
net-imap (0.4.17)
|
147
|
-
date
|
148
|
-
net-protocol
|
149
|
-
net-pop (0.1.2)
|
150
|
-
net-protocol
|
151
|
-
net-protocol (0.2.2)
|
152
|
-
timeout
|
153
|
-
net-smtp (0.5.0)
|
154
|
-
net-protocol
|
155
|
-
nio4r (2.7.3)
|
156
|
-
nokogiri (1.16.8)
|
157
|
-
mini_portile2 (~> 2.8.2)
|
158
|
-
racc (~> 1.4)
|
159
|
-
ostruct (0.6.1)
|
69
|
+
minitest (5.25.4)
|
160
70
|
parallel (1.26.3)
|
161
|
-
parser (3.3.
|
71
|
+
parser (3.3.7.1)
|
162
72
|
ast (~> 2.4.1)
|
163
73
|
racc
|
164
|
-
pry (0.
|
74
|
+
pry (0.15.2)
|
165
75
|
coderay (~> 1.1)
|
166
76
|
method_source (~> 1.0)
|
167
|
-
psych (5.1.2)
|
168
|
-
stringio
|
169
77
|
racc (1.8.1)
|
170
|
-
rack (3.1.
|
171
|
-
rack-session (2.0.0)
|
172
|
-
rack (>= 3.0.0)
|
173
|
-
rack-test (2.1.0)
|
174
|
-
rack (>= 1.3)
|
175
|
-
rackup (2.1.0)
|
176
|
-
rack (>= 3)
|
177
|
-
webrick (~> 1.8)
|
178
|
-
rails (7.1.4.1)
|
179
|
-
actioncable (= 7.1.4.1)
|
180
|
-
actionmailbox (= 7.1.4.1)
|
181
|
-
actionmailer (= 7.1.4.1)
|
182
|
-
actionpack (= 7.1.4.1)
|
183
|
-
actiontext (= 7.1.4.1)
|
184
|
-
actionview (= 7.1.4.1)
|
185
|
-
activejob (= 7.1.4.1)
|
186
|
-
activemodel (= 7.1.4.1)
|
187
|
-
activerecord (= 7.1.4.1)
|
188
|
-
activestorage (= 7.1.4.1)
|
189
|
-
activesupport (= 7.1.4.1)
|
190
|
-
bundler (>= 1.15.0)
|
191
|
-
railties (= 7.1.4.1)
|
192
|
-
rails-dom-testing (2.2.0)
|
193
|
-
activesupport (>= 5.0.0)
|
194
|
-
minitest
|
195
|
-
nokogiri (>= 1.6)
|
196
|
-
rails-html-sanitizer (1.6.1)
|
197
|
-
loofah (~> 2.21)
|
198
|
-
nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0)
|
199
|
-
railties (7.1.4.1)
|
200
|
-
actionpack (= 7.1.4.1)
|
201
|
-
activesupport (= 7.1.4.1)
|
202
|
-
irb
|
203
|
-
rackup (>= 1.0.0)
|
204
|
-
rake (>= 12.2)
|
205
|
-
thor (~> 1.0, >= 1.2.2)
|
206
|
-
zeitwerk (~> 2.6)
|
78
|
+
rack (3.1.9)
|
207
79
|
rainbow (3.1.1)
|
208
80
|
rake (13.2.1)
|
209
81
|
rbtree (0.4.6)
|
210
|
-
|
211
|
-
|
212
|
-
regexp_parser (2.9.2)
|
213
|
-
reline (0.5.10)
|
82
|
+
regexp_parser (2.10.0)
|
83
|
+
reline (0.6.0)
|
214
84
|
io-console (~> 0.5)
|
215
85
|
rspec (3.13.0)
|
216
86
|
rspec-core (~> 3.13.0)
|
217
87
|
rspec-expectations (~> 3.13.0)
|
218
88
|
rspec-mocks (~> 3.13.0)
|
219
|
-
rspec-core (3.13.
|
89
|
+
rspec-core (3.13.3)
|
220
90
|
rspec-support (~> 3.13.0)
|
221
91
|
rspec-expectations (3.13.3)
|
222
92
|
diff-lcs (>= 1.2.0, < 2.0)
|
223
93
|
rspec-support (~> 3.13.0)
|
224
|
-
rspec-its (
|
225
|
-
rspec-core (>= 3.
|
226
|
-
rspec-expectations (>= 3.
|
94
|
+
rspec-its (2.0.0)
|
95
|
+
rspec-core (>= 3.13.0)
|
96
|
+
rspec-expectations (>= 3.13.0)
|
227
97
|
rspec-mocks (3.13.2)
|
228
98
|
diff-lcs (>= 1.2.0, < 2.0)
|
229
99
|
rspec-support (~> 3.13.0)
|
230
|
-
rspec-support (3.13.
|
231
|
-
rubocop (1.
|
100
|
+
rspec-support (3.13.2)
|
101
|
+
rubocop (1.69.2)
|
232
102
|
json (~> 2.3)
|
233
103
|
language_server-protocol (>= 3.17.0)
|
234
104
|
parallel (~> 1.10)
|
235
105
|
parser (>= 3.3.0.2)
|
236
106
|
rainbow (>= 2.2.2, < 4.0)
|
237
|
-
regexp_parser (>= 2.
|
238
|
-
rubocop-ast (>= 1.
|
107
|
+
regexp_parser (>= 2.9.3, < 3.0)
|
108
|
+
rubocop-ast (>= 1.36.2, < 2.0)
|
239
109
|
ruby-progressbar (~> 1.7)
|
240
|
-
unicode-display_width (>= 2.4.0, <
|
241
|
-
rubocop-ast (1.
|
110
|
+
unicode-display_width (>= 2.4.0, < 4.0)
|
111
|
+
rubocop-ast (1.38.0)
|
242
112
|
parser (>= 3.3.1.0)
|
243
|
-
rubocop-config-umbrellio (1.
|
244
|
-
rubocop (~> 1.
|
113
|
+
rubocop-config-umbrellio (1.69.0.101)
|
114
|
+
rubocop (~> 1.69.0)
|
245
115
|
rubocop-factory_bot (~> 2.26.0)
|
246
|
-
rubocop-performance (~> 1.
|
247
|
-
rubocop-rails (~> 2.
|
116
|
+
rubocop-performance (~> 1.23.0)
|
117
|
+
rubocop-rails (~> 2.28.0)
|
248
118
|
rubocop-rake (~> 0.6.0)
|
249
|
-
rubocop-rspec (~> 3.
|
250
|
-
rubocop-sequel (~> 0.3.
|
119
|
+
rubocop-rspec (~> 3.3.0)
|
120
|
+
rubocop-sequel (~> 0.3.0)
|
251
121
|
rubocop-factory_bot (2.26.1)
|
252
122
|
rubocop (~> 1.61)
|
253
|
-
rubocop-performance (1.
|
123
|
+
rubocop-performance (1.23.1)
|
254
124
|
rubocop (>= 1.48.1, < 2.0)
|
255
125
|
rubocop-ast (>= 1.31.1, < 2.0)
|
256
|
-
rubocop-rails (2.
|
126
|
+
rubocop-rails (2.28.0)
|
257
127
|
activesupport (>= 4.2.0)
|
258
128
|
rack (>= 1.1)
|
259
129
|
rubocop (>= 1.52.0, < 2.0)
|
260
130
|
rubocop-ast (>= 1.31.1, < 2.0)
|
261
131
|
rubocop-rake (0.6.0)
|
262
132
|
rubocop (~> 1.0)
|
263
|
-
rubocop-rspec (3.0
|
133
|
+
rubocop-rspec (3.3.0)
|
264
134
|
rubocop (~> 1.61)
|
265
|
-
rubocop-sequel (0.3.
|
135
|
+
rubocop-sequel (0.3.8)
|
266
136
|
rubocop (~> 1.0)
|
267
137
|
ruby-progressbar (1.13.0)
|
138
|
+
securerandom (0.4.1)
|
268
139
|
serverengine (2.4.0)
|
269
140
|
base64 (~> 0.1)
|
270
141
|
logger (~> 1.4)
|
271
142
|
sigdump (~> 0.2.2)
|
272
|
-
set (1.1.
|
143
|
+
set (1.1.1)
|
273
144
|
sigdump (0.2.5)
|
274
145
|
simplecov (0.22.0)
|
275
146
|
docile (~> 1.1)
|
@@ -281,31 +152,26 @@ GEM
|
|
281
152
|
sorted_set (1.0.3)
|
282
153
|
rbtree
|
283
154
|
set (~> 1.0)
|
284
|
-
stringio (3.1.1)
|
285
155
|
tainbox (2.1.2)
|
286
156
|
activesupport
|
287
157
|
thor (1.3.2)
|
288
|
-
timeout (0.4.
|
158
|
+
timeout (0.4.3)
|
289
159
|
tzinfo (2.0.6)
|
290
160
|
concurrent-ruby (~> 1.0)
|
291
|
-
unicode-display_width (
|
292
|
-
|
293
|
-
|
294
|
-
websocket-extensions (>= 0.1.0)
|
295
|
-
websocket-extensions (0.1.5)
|
296
|
-
zeitwerk (2.6.18)
|
161
|
+
unicode-display_width (3.1.4)
|
162
|
+
unicode-emoji (~> 4.0, >= 4.0.4)
|
163
|
+
unicode-emoji (4.0.4)
|
297
164
|
|
298
165
|
PLATFORMS
|
166
|
+
arm64-darwin
|
299
167
|
ruby
|
300
168
|
|
301
169
|
DEPENDENCIES
|
302
|
-
|
303
|
-
|
304
|
-
ostruct
|
170
|
+
activejob
|
171
|
+
activerecord
|
305
172
|
pry
|
306
173
|
rabbit_messaging!
|
307
|
-
|
308
|
-
rake
|
174
|
+
reline
|
309
175
|
rspec
|
310
176
|
rspec-its
|
311
177
|
rubocop-config-umbrellio
|
data/config/sneakers.yml
ADDED
data/environments/development.rb
CHANGED
@@ -6,12 +6,8 @@ Bundler.require(:default, :development)
|
|
6
6
|
require "active_job"
|
7
7
|
require "active_record"
|
8
8
|
|
9
|
-
def Rails.root
|
10
|
-
Pathname.new(__dir__).join("..")
|
11
|
-
end
|
12
|
-
|
13
9
|
ActiveJob::Base.queue_adapter = :inline
|
14
|
-
ActiveJob::Base.logger = Logger.new(
|
10
|
+
ActiveJob::Base.logger = Logger.new(nil)
|
15
11
|
|
16
12
|
Rabbit.config.project_id = "test_project_id"
|
17
13
|
Rabbit.config.group_id = "test_group_id"
|
data/lib/rabbit/daemon.rb
CHANGED
@@ -1,7 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require "sneakers"
|
4
|
-
require "lamian"
|
5
4
|
require "sneakers/runner"
|
6
5
|
|
7
6
|
require "rabbit/extensions/bunny/channel"
|
@@ -12,12 +11,6 @@ module Rabbit
|
|
12
11
|
extend self
|
13
12
|
|
14
13
|
def run(logger: Sneakers.logger)
|
15
|
-
unless logger
|
16
|
-
logger = Logger.new(Rails.root.join("log", "sneakers.log"))
|
17
|
-
logger.level = Logger::DEBUG
|
18
|
-
Lamian.extend_logger(logger)
|
19
|
-
end
|
20
|
-
|
21
14
|
self.logger = logger
|
22
15
|
|
23
16
|
Sneakers.configure(**sneakers_config(logger: logger))
|
@@ -30,7 +23,7 @@ module Rabbit
|
|
30
23
|
end
|
31
24
|
|
32
25
|
def config
|
33
|
-
@config ||=
|
26
|
+
@config ||= Rabbit.sneakers_config
|
34
27
|
end
|
35
28
|
|
36
29
|
def connection
|
@@ -49,7 +42,7 @@ module Rabbit
|
|
49
42
|
def sneakers_config(logger:)
|
50
43
|
{
|
51
44
|
connection: connection,
|
52
|
-
env:
|
45
|
+
env: Rabbit.config.environment,
|
53
46
|
exchange_type: :direct,
|
54
47
|
exchange: Rabbit.config.app_name,
|
55
48
|
hooks: Rabbit.config.hooks,
|
data/lib/rabbit/publishing.rb
CHANGED
@@ -40,8 +40,8 @@ module Rabbit
|
|
40
40
|
end
|
41
41
|
|
42
42
|
def create_client
|
43
|
-
config =
|
44
|
-
config = config[
|
43
|
+
config = Rabbit.sneakers_config
|
44
|
+
config = config[:bunny_options].to_h.symbolize_keys
|
45
45
|
|
46
46
|
Bunny.new(config).start
|
47
47
|
end
|
data/lib/rabbit/receiving/job.rb
CHANGED
@@ -1,17 +1,16 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require "lamian"
|
4
|
-
require "active_job"
|
5
|
-
|
6
3
|
require "rabbit"
|
7
4
|
require "rabbit/receiving"
|
8
5
|
require "rabbit/receiving/message"
|
9
6
|
require "rabbit/receiving/handler_resolver"
|
10
7
|
require "rabbit/receiving/malformed_message"
|
11
8
|
|
12
|
-
|
13
|
-
|
14
|
-
|
9
|
+
begin
|
10
|
+
require "active_job"
|
11
|
+
|
12
|
+
class Rabbit::Receiving::Job < ActiveJob::Base
|
13
|
+
def perform(message, arguments)
|
15
14
|
message = Rabbit::Receiving::Message.build(message, arguments)
|
16
15
|
handler = Rabbit::Receiving::HandlerResolver.handler_for(message)
|
17
16
|
handler.new(message).call
|
@@ -20,4 +19,6 @@ class Rabbit::Receiving::Job < ActiveJob::Base
|
|
20
19
|
Rabbit.config.exception_notifier.call(error)
|
21
20
|
end
|
22
21
|
end
|
22
|
+
rescue LoadError
|
23
|
+
warn "ActiveJob not found! You will need to define Rabbit::Receiving::Job class by yourself."
|
23
24
|
end
|
data/lib/rabbit/version.rb
CHANGED
data/lib/rabbit.rb
CHANGED
@@ -32,15 +32,15 @@ module Rabbit
|
|
32
32
|
attribute :backoff_handler_max_retries, Integer, default: 6
|
33
33
|
|
34
34
|
attribute :receive_logger, default: lambda {
|
35
|
-
Logger.new(
|
35
|
+
Logger.new(Rabbit.root.join("log", "incoming_rabbit_messages.log"))
|
36
36
|
}
|
37
37
|
|
38
38
|
attribute :publish_logger, default: lambda {
|
39
|
-
Logger.new(
|
39
|
+
Logger.new(Rabbit.root.join("log", "rabbit.log"))
|
40
40
|
}
|
41
41
|
|
42
42
|
attribute :malformed_logger, default: lambda {
|
43
|
-
Logger.new(
|
43
|
+
Logger.new(Rabbit.root.join("log", "malformed_messages.log"))
|
44
44
|
}
|
45
45
|
|
46
46
|
def validate!
|
@@ -48,7 +48,7 @@ module Rabbit
|
|
48
48
|
raise InvalidConfig, "missing group_id" unless group_id
|
49
49
|
raise InvalidConfig, "missing exception_notifier" unless exception_notifier
|
50
50
|
|
51
|
-
unless
|
51
|
+
unless %i[test development production].include?(environment)
|
52
52
|
raise "environment should be one of (test, development, production)"
|
53
53
|
end
|
54
54
|
end
|
@@ -74,6 +74,23 @@ module Rabbit
|
|
74
74
|
@config
|
75
75
|
end
|
76
76
|
|
77
|
+
def root
|
78
|
+
if defined?(Rails)
|
79
|
+
Rails.root
|
80
|
+
else
|
81
|
+
Pathname.new(Dir.pwd)
|
82
|
+
end
|
83
|
+
end
|
84
|
+
|
85
|
+
def sneakers_config
|
86
|
+
if defined?(Rails)
|
87
|
+
Rails.application.config_for("sneakers")
|
88
|
+
else
|
89
|
+
config = YAML.load_file("config/sneakers.yml", aliases: true)
|
90
|
+
config[Rabbit.config.environment.to_s].to_h.symbolize_keys
|
91
|
+
end
|
92
|
+
end
|
93
|
+
|
77
94
|
def configure
|
78
95
|
yield(config)
|
79
96
|
config.validate!
|
data/rabbit_messaging.gemspec
CHANGED
@@ -20,8 +20,6 @@ Gem::Specification.new do |spec|
|
|
20
20
|
spec.require_paths = ["lib"]
|
21
21
|
|
22
22
|
spec.add_dependency "bunny", "~> 2.0"
|
23
|
-
spec.add_dependency "kicks"
|
24
|
-
spec.add_dependency "lamian"
|
25
|
-
spec.add_dependency "rails", ">= 6.1"
|
23
|
+
spec.add_dependency "kicks"
|
26
24
|
spec.add_dependency "tainbox"
|
27
25
|
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rabbit_messaging
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Umbrellio
|
8
8
|
bindir: bin
|
9
9
|
cert_chain: []
|
10
|
-
date: 2025-02-
|
10
|
+
date: 2025-02-11 00:00:00.000000000 Z
|
11
11
|
dependencies:
|
12
12
|
- !ruby/object:Gem::Dependency
|
13
13
|
name: bunny
|
@@ -25,20 +25,6 @@ dependencies:
|
|
25
25
|
version: '2.0'
|
26
26
|
- !ruby/object:Gem::Dependency
|
27
27
|
name: kicks
|
28
|
-
requirement: !ruby/object:Gem::Requirement
|
29
|
-
requirements:
|
30
|
-
- - "~>"
|
31
|
-
- !ruby/object:Gem::Version
|
32
|
-
version: '3'
|
33
|
-
type: :runtime
|
34
|
-
prerelease: false
|
35
|
-
version_requirements: !ruby/object:Gem::Requirement
|
36
|
-
requirements:
|
37
|
-
- - "~>"
|
38
|
-
- !ruby/object:Gem::Version
|
39
|
-
version: '3'
|
40
|
-
- !ruby/object:Gem::Dependency
|
41
|
-
name: lamian
|
42
28
|
requirement: !ruby/object:Gem::Requirement
|
43
29
|
requirements:
|
44
30
|
- - ">="
|
@@ -51,20 +37,6 @@ dependencies:
|
|
51
37
|
- - ">="
|
52
38
|
- !ruby/object:Gem::Version
|
53
39
|
version: '0'
|
54
|
-
- !ruby/object:Gem::Dependency
|
55
|
-
name: rails
|
56
|
-
requirement: !ruby/object:Gem::Requirement
|
57
|
-
requirements:
|
58
|
-
- - ">="
|
59
|
-
- !ruby/object:Gem::Version
|
60
|
-
version: '6.1'
|
61
|
-
type: :runtime
|
62
|
-
prerelease: false
|
63
|
-
version_requirements: !ruby/object:Gem::Requirement
|
64
|
-
requirements:
|
65
|
-
- - ">="
|
66
|
-
- !ruby/object:Gem::Version
|
67
|
-
version: '6.1'
|
68
40
|
- !ruby/object:Gem::Dependency
|
69
41
|
name: tainbox
|
70
42
|
requirement: !ruby/object:Gem::Requirement
|
@@ -98,6 +70,7 @@ files:
|
|
98
70
|
- Rakefile
|
99
71
|
- bin/console
|
100
72
|
- bin/setup
|
73
|
+
- config/sneakers.yml
|
101
74
|
- environments/development.rb
|
102
75
|
- lib/rabbit.rb
|
103
76
|
- lib/rabbit/daemon.rb
|