rabbit_messaging 0.11.0 → 0.12.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: b8542a34d9178bfbaa0b060bedeabcd4811473def27cae7a52bafb34d6706939
4
- data.tar.gz: da404d62299855fbdd94c037487e3ccd177818d1d684ce5db74ebad17dfad1dd
3
+ metadata.gz: 7bc319672450b1eac69256139e858e4c2d3d1f26e3427d727bebd48713990b97
4
+ data.tar.gz: 927a86a73c692dde6610000b62ef008e6eb1bbc9a425dac655f12d1f95d380f7
5
5
  SHA512:
6
- metadata.gz: 06b75c450a69a43b4926b5fa4c1581a3bcb3d728ce826050d4ea4e002dbb38f5729d3c3203d9c4fc916d843e2bd8cf0f1c14fc6b58ac670b0a58a821408f9c9f
7
- data.tar.gz: 34ac8124872567403c219a98d682644c80f43f2be201d085b9c7c58258b852a4624b67b64a78ad0b1eb99069734efa3af602db0c0ae566a3175fefb56b774a28
6
+ metadata.gz: fb7d00985eb4964c6e1588591ed61d024b78a273b571dde4a3cccabfe8c4aeb798b45aec8290dc86eb3e140afa076c9bf75d21344873fda8084e3465ad670235
7
+ data.tar.gz: 943a61798405d733309df200bca51615fdc3653b4d546dfb2ef77a3642f02de413b2ce56af7f2b724d7f77b49e075198d0e540a891f71fbe108aa6cd096796f9
@@ -13,7 +13,7 @@ jobs:
13
13
  - uses: actions/checkout@v2
14
14
  - uses: ruby/setup-ruby@v1
15
15
  with:
16
- ruby-version: 3.0
16
+ ruby-version: "3.0"
17
17
  bundler-cache: true
18
18
  - name: Create log dir
19
19
  run: mkdir -p log
@@ -37,7 +37,7 @@ jobs:
37
37
  strategy:
38
38
  fail-fast: false
39
39
  matrix:
40
- ruby: [2.5, 2.6, 2.7]
40
+ ruby: ["2.5", "2.6", "2.7"]
41
41
  experimental: [false]
42
42
  include:
43
43
  - ruby: head
data/.gitignore CHANGED
@@ -6,7 +6,6 @@
6
6
  /pkg/
7
7
  /spec/reports/
8
8
  /tmp/
9
- Gemfile.lock
10
9
  .ruby-version
11
10
  /log/
12
11
  *.gem
data/Gemfile.lock ADDED
@@ -0,0 +1,256 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ rabbit_messaging (0.11.0)
5
+ bunny (~> 2.0)
6
+ exception_notification
7
+ lamian
8
+ rails (>= 5.2)
9
+ sneakers (~> 2.0)
10
+ tainbox
11
+
12
+ GEM
13
+ remote: https://rubygems.org/
14
+ specs:
15
+ actioncable (6.1.3.2)
16
+ actionpack (= 6.1.3.2)
17
+ activesupport (= 6.1.3.2)
18
+ nio4r (~> 2.0)
19
+ websocket-driver (>= 0.6.1)
20
+ actionmailbox (6.1.3.2)
21
+ actionpack (= 6.1.3.2)
22
+ activejob (= 6.1.3.2)
23
+ activerecord (= 6.1.3.2)
24
+ activestorage (= 6.1.3.2)
25
+ activesupport (= 6.1.3.2)
26
+ mail (>= 2.7.1)
27
+ actionmailer (6.1.3.2)
28
+ actionpack (= 6.1.3.2)
29
+ actionview (= 6.1.3.2)
30
+ activejob (= 6.1.3.2)
31
+ activesupport (= 6.1.3.2)
32
+ mail (~> 2.5, >= 2.5.4)
33
+ rails-dom-testing (~> 2.0)
34
+ actionpack (6.1.3.2)
35
+ actionview (= 6.1.3.2)
36
+ activesupport (= 6.1.3.2)
37
+ rack (~> 2.0, >= 2.0.9)
38
+ rack-test (>= 0.6.3)
39
+ rails-dom-testing (~> 2.0)
40
+ rails-html-sanitizer (~> 1.0, >= 1.2.0)
41
+ actiontext (6.1.3.2)
42
+ actionpack (= 6.1.3.2)
43
+ activerecord (= 6.1.3.2)
44
+ activestorage (= 6.1.3.2)
45
+ activesupport (= 6.1.3.2)
46
+ nokogiri (>= 1.8.5)
47
+ actionview (6.1.3.2)
48
+ activesupport (= 6.1.3.2)
49
+ builder (~> 3.1)
50
+ erubi (~> 1.4)
51
+ rails-dom-testing (~> 2.0)
52
+ rails-html-sanitizer (~> 1.1, >= 1.2.0)
53
+ activejob (6.1.3.2)
54
+ activesupport (= 6.1.3.2)
55
+ globalid (>= 0.3.6)
56
+ activemodel (6.1.3.2)
57
+ activesupport (= 6.1.3.2)
58
+ activerecord (6.1.3.2)
59
+ activemodel (= 6.1.3.2)
60
+ activesupport (= 6.1.3.2)
61
+ activestorage (6.1.3.2)
62
+ actionpack (= 6.1.3.2)
63
+ activejob (= 6.1.3.2)
64
+ activerecord (= 6.1.3.2)
65
+ activesupport (= 6.1.3.2)
66
+ marcel (~> 1.0.0)
67
+ mini_mime (~> 1.0.2)
68
+ activesupport (6.1.3.2)
69
+ concurrent-ruby (~> 1.0, >= 1.0.2)
70
+ i18n (>= 1.6, < 2)
71
+ minitest (>= 5.1)
72
+ tzinfo (~> 2.0)
73
+ zeitwerk (~> 2.3)
74
+ amq-protocol (2.3.2)
75
+ ast (2.4.2)
76
+ builder (3.2.4)
77
+ bundler-audit (0.8.0)
78
+ bundler (>= 1.2.0, < 3)
79
+ thor (~> 1.0)
80
+ bunny (2.18.0)
81
+ amq-protocol (~> 2.3, >= 2.3.1)
82
+ sorted_set (~> 1, >= 1.0.2)
83
+ coderay (1.1.3)
84
+ concurrent-ruby (1.1.8)
85
+ crass (1.0.6)
86
+ diff-lcs (1.4.4)
87
+ docile (1.4.0)
88
+ erubi (1.10.0)
89
+ exception_notification (4.4.3)
90
+ actionmailer (>= 4.0, < 7)
91
+ activesupport (>= 4.0, < 7)
92
+ globalid (0.4.2)
93
+ activesupport (>= 4.2.0)
94
+ i18n (1.8.10)
95
+ concurrent-ruby (~> 1.0)
96
+ lamian (1.2.0)
97
+ rails (>= 4.2)
98
+ loofah (2.9.1)
99
+ crass (~> 1.0.2)
100
+ nokogiri (>= 1.5.9)
101
+ mail (2.7.1)
102
+ mini_mime (>= 0.1.1)
103
+ marcel (1.0.1)
104
+ method_source (1.0.0)
105
+ mini_mime (1.0.3)
106
+ mini_portile2 (2.5.1)
107
+ minitest (5.14.4)
108
+ nio4r (2.5.7)
109
+ nokogiri (1.11.6)
110
+ mini_portile2 (~> 2.5.0)
111
+ racc (~> 1.4)
112
+ parallel (1.20.1)
113
+ parser (3.0.1.1)
114
+ ast (~> 2.4.1)
115
+ pry (0.14.1)
116
+ coderay (~> 1.1)
117
+ method_source (~> 1.0)
118
+ racc (1.5.2)
119
+ rack (2.2.3)
120
+ rack-test (1.1.0)
121
+ rack (>= 1.0, < 3)
122
+ rails (6.1.3.2)
123
+ actioncable (= 6.1.3.2)
124
+ actionmailbox (= 6.1.3.2)
125
+ actionmailer (= 6.1.3.2)
126
+ actionpack (= 6.1.3.2)
127
+ actiontext (= 6.1.3.2)
128
+ actionview (= 6.1.3.2)
129
+ activejob (= 6.1.3.2)
130
+ activemodel (= 6.1.3.2)
131
+ activerecord (= 6.1.3.2)
132
+ activestorage (= 6.1.3.2)
133
+ activesupport (= 6.1.3.2)
134
+ bundler (>= 1.15.0)
135
+ railties (= 6.1.3.2)
136
+ sprockets-rails (>= 2.0.0)
137
+ rails-dom-testing (2.0.3)
138
+ activesupport (>= 4.2.0)
139
+ nokogiri (>= 1.6)
140
+ rails-html-sanitizer (1.3.0)
141
+ loofah (~> 2.3)
142
+ railties (6.1.3.2)
143
+ actionpack (= 6.1.3.2)
144
+ activesupport (= 6.1.3.2)
145
+ method_source
146
+ rake (>= 0.8.7)
147
+ thor (~> 1.0)
148
+ rainbow (3.0.0)
149
+ rake (13.0.3)
150
+ rbtree (0.4.4)
151
+ regexp_parser (2.1.1)
152
+ rexml (3.2.5)
153
+ rspec (3.10.0)
154
+ rspec-core (~> 3.10.0)
155
+ rspec-expectations (~> 3.10.0)
156
+ rspec-mocks (~> 3.10.0)
157
+ rspec-core (3.10.1)
158
+ rspec-support (~> 3.10.0)
159
+ rspec-expectations (3.10.1)
160
+ diff-lcs (>= 1.2.0, < 2.0)
161
+ rspec-support (~> 3.10.0)
162
+ rspec-its (1.3.0)
163
+ rspec-core (>= 3.0.0)
164
+ rspec-expectations (>= 3.0.0)
165
+ rspec-mocks (3.10.2)
166
+ diff-lcs (>= 1.2.0, < 2.0)
167
+ rspec-support (~> 3.10.0)
168
+ rspec-support (3.10.2)
169
+ rubocop (1.11.0)
170
+ parallel (~> 1.10)
171
+ parser (>= 3.0.0.0)
172
+ rainbow (>= 2.2.2, < 4.0)
173
+ regexp_parser (>= 1.8, < 3.0)
174
+ rexml
175
+ rubocop-ast (>= 1.2.0, < 2.0)
176
+ ruby-progressbar (~> 1.7)
177
+ unicode-display_width (>= 1.4.0, < 3.0)
178
+ rubocop-ast (1.6.0)
179
+ parser (>= 3.0.1.1)
180
+ rubocop-config-umbrellio (1.11.0.40)
181
+ rubocop (= 1.11.0)
182
+ rubocop-performance (= 1.10.0)
183
+ rubocop-rails (= 2.9.1)
184
+ rubocop-rake (= 0.5.1)
185
+ rubocop-rspec (= 2.2.0)
186
+ rubocop-sequel (= 0.2.0)
187
+ rubocop-performance (1.10.0)
188
+ rubocop (>= 0.90.0, < 2.0)
189
+ rubocop-ast (>= 0.4.0)
190
+ rubocop-rails (2.9.1)
191
+ activesupport (>= 4.2.0)
192
+ rack (>= 1.1)
193
+ rubocop (>= 0.90.0, < 2.0)
194
+ rubocop-rake (0.5.1)
195
+ rubocop
196
+ rubocop-rspec (2.2.0)
197
+ rubocop (~> 1.0)
198
+ rubocop-ast (>= 1.1.0)
199
+ rubocop-sequel (0.2.0)
200
+ rubocop (~> 1.0)
201
+ ruby-progressbar (1.11.0)
202
+ serverengine (2.0.7)
203
+ sigdump (~> 0.2.2)
204
+ set (1.0.1)
205
+ sigdump (0.2.4)
206
+ simplecov (0.21.2)
207
+ docile (~> 1.1)
208
+ simplecov-html (~> 0.11)
209
+ simplecov_json_formatter (~> 0.1)
210
+ simplecov-html (0.12.3)
211
+ simplecov-lcov (0.8.0)
212
+ simplecov_json_formatter (0.1.3)
213
+ sneakers (2.11.0)
214
+ bunny (~> 2.12)
215
+ concurrent-ruby (~> 1.0)
216
+ rake
217
+ serverengine (~> 2.0.5)
218
+ thor
219
+ sorted_set (1.0.3)
220
+ rbtree
221
+ set (~> 1.0)
222
+ sprockets (4.0.2)
223
+ concurrent-ruby (~> 1.0)
224
+ rack (> 1, < 3)
225
+ sprockets-rails (3.2.2)
226
+ actionpack (>= 4.0)
227
+ activesupport (>= 4.0)
228
+ sprockets (>= 3.0.0)
229
+ tainbox (2.1.2)
230
+ activesupport
231
+ thor (1.1.0)
232
+ tzinfo (2.0.4)
233
+ concurrent-ruby (~> 1.0)
234
+ unicode-display_width (2.0.0)
235
+ websocket-driver (0.7.4)
236
+ websocket-extensions (>= 0.1.0)
237
+ websocket-extensions (0.1.5)
238
+ zeitwerk (2.4.2)
239
+
240
+ PLATFORMS
241
+ ruby
242
+
243
+ DEPENDENCIES
244
+ bundler
245
+ bundler-audit
246
+ pry
247
+ rabbit_messaging!
248
+ rake
249
+ rspec
250
+ rspec-its
251
+ rubocop-config-umbrellio
252
+ simplecov (>= 0.21)
253
+ simplecov-lcov
254
+
255
+ BUNDLED WITH
256
+ 2.2.17
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # Rabbit (Rabbit Messaging) &middot; [![Gem Version](https://badge.fury.io/rb/rabbit_messaging.svg)](https://badge.fury.io/rb/rabbit_messaging) [![Build Status](https://travis-ci.org/umbrellio/rabbit_messaging.svg?branch=master)](https://travis-ci.org/umbrellio/rabbit_messaging) [![Coverage Status](https://coveralls.io/repos/github/umbrellio/rabbit_messaging/badge.svg?branch=master)](https://coveralls.io/github/umbrellio/rabbit_messaging?branch=master)
1
+ # Rabbit (Rabbit Messaging) &middot; [![Gem Version](https://badge.fury.io/rb/rabbit_messaging.svg)](https://badge.fury.io/rb/rabbit_messaging) [![Coverage Status](https://coveralls.io/repos/github/umbrellio/rabbit_messaging/badge.svg?branch=master)](https://coveralls.io/github/umbrellio/rabbit_messaging?branch=master)
2
2
 
3
3
  Provides client and server support for RabbitMQ
4
4
 
@@ -97,7 +97,7 @@ require "rabbit_messaging"
97
97
  * `before_receiving_hooks, after_receiving_hooks` (`Array of Procs`)
98
98
 
99
99
  Before and after hooks with message processing in the middle. Where `before_receiving_hooks` and `after_receiving_hooks` are empty arrays by default.
100
-
100
+
101
101
  It's advised to NOT place procs with long execution time inside.
102
102
 
103
103
  Setup:
data/lib/rabbit/daemon.rb CHANGED
@@ -11,30 +11,18 @@ module Rabbit
11
11
  module Daemon
12
12
  extend self
13
13
 
14
- def run
15
- Sneakers.configure(
16
- connection: connection,
17
- env: Rails.env,
18
- exchange_type: :direct,
19
- exchange: Rabbit.config.app_name,
20
- hooks: Rabbit.config.hooks,
21
- supervisor: true,
22
- daemonize: false,
23
- exit_on_detach: true,
24
- **config,
25
- )
26
-
27
- unless Sneakers.logger
28
- Sneakers.logger = Logger.new(Rails.root.join("log", "sneakers.log"))
29
- Sneakers.logger.level = Logger::DEBUG
30
- Lamian.extend_logger(Sneakers.logger)
14
+ 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)
31
19
  end
32
20
 
21
+ Sneakers.configure(**sneakers_config(logger: logger))
33
22
  Sneakers.server = true
34
23
 
35
24
  Rabbit.config.validate!
36
25
  Receiving::Worker.from_queue(Rabbit.config.read_queue)
37
-
38
26
  Sneakers::Runner.new([Receiving::Worker]).run
39
27
  end
40
28
 
@@ -46,5 +34,22 @@ module Rabbit
46
34
  bunny_config = config.delete(:bunny_options).to_h.symbolize_keys
47
35
  Bunny.new(bunny_config)
48
36
  end
37
+
38
+ private
39
+
40
+ def sneakers_config(logger:)
41
+ {
42
+ connection: connection,
43
+ env: Rails.env,
44
+ exchange_type: :direct,
45
+ exchange: Rabbit.config.app_name,
46
+ hooks: Rabbit.config.hooks,
47
+ supervisor: true,
48
+ daemonize: false,
49
+ exit_on_detach: true,
50
+ log: logger,
51
+ **config,
52
+ }
53
+ end
49
54
  end
50
55
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Rabbit
4
- VERSION = "0.11.0"
4
+ VERSION = "0.12.0"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rabbit_messaging
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.11.0
4
+ version: 0.12.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Umbrellio
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-05-05 00:00:00.000000000 Z
11
+ date: 2021-06-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bunny
@@ -233,6 +233,7 @@ files:
233
233
  - ".rubocop.yml"
234
234
  - CHANGELOG.md
235
235
  - Gemfile
236
+ - Gemfile.lock
236
237
  - LICENSE.md
237
238
  - README.md
238
239
  - Rakefile
@@ -277,7 +278,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
277
278
  - !ruby/object:Gem::Version
278
279
  version: '0'
279
280
  requirements: []
280
- rubygems_version: 3.2.3
281
+ rubygems_version: 3.2.17
281
282
  signing_key:
282
283
  specification_version: 4
283
284
  summary: Rabbit (Rabbit Messaging)