rabid_mq 0.1.15 → 0.1.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/rabid_mq/config.rb +7 -2
- data/lib/rabid_mq/version.rb +1 -1
- data/lib/rabid_mq.rb +2 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d458575d2c820f8067d55339aa9629c621932be8
|
4
|
+
data.tar.gz: da5b81b623736ee9cacbcf73ad540306ede0ea99
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1c8b5034a0b022d8aa3843fb05da38dee33b71d05824ac21816cad8f65ce010ec0dd3ec4b643814634ef268bdb0fa0106eaba8b9e0ec0970e9a663695711f25b
|
7
|
+
data.tar.gz: 28db93644294d41a221358c8268b2195b903ee2fc97fe4f5d4559097385cd7048fb6191c7560569c7edc5f0c50e6a3190af22f50ac6d4c4c72600bbe0e8e96fb
|
data/lib/rabid_mq/config.rb
CHANGED
@@ -2,12 +2,16 @@ module RabidMQ
|
|
2
2
|
module Config
|
3
3
|
class << self
|
4
4
|
def load_config
|
5
|
-
@config ||=
|
5
|
+
@config ||= default_config.merge custom_config
|
6
6
|
rescue Errno::ENOENT, NameError => e
|
7
7
|
puts "[WARN] #{e.message} in #{__FILE__}. Falling back to default config"
|
8
8
|
default_config
|
9
9
|
end
|
10
10
|
|
11
|
+
def custom_config
|
12
|
+
YAML.load(ERB.new(File.read(file_name)).result)[Rails.env].symbolize_keys || {}
|
13
|
+
end
|
14
|
+
|
11
15
|
def default_config
|
12
16
|
{
|
13
17
|
:host => "localhost",
|
@@ -18,7 +22,8 @@ module RabidMQ
|
|
18
22
|
:pass => "guest",
|
19
23
|
:heartbeat => :server, # will use RabbitMQ setting
|
20
24
|
:frame_max => 131072,
|
21
|
-
:auth_mechanism => "PLAIN"
|
25
|
+
:auth_mechanism => "PLAIN",
|
26
|
+
:recover_from_connection_close => false
|
22
27
|
}
|
23
28
|
end
|
24
29
|
|
data/lib/rabid_mq/version.rb
CHANGED
data/lib/rabid_mq.rb
CHANGED
@@ -7,6 +7,8 @@ require 'rabid_mq/railtie' if defined?(::Rails)
|
|
7
7
|
require 'rabid_mq/config'
|
8
8
|
require 'rabid_mq/listener'
|
9
9
|
require 'rabid_mq/publisher'
|
10
|
+
|
11
|
+
STDOUT.sync = true
|
10
12
|
# Module to abstract the boilerplate of connecting to rabbitMQ
|
11
13
|
# This will also abstract how the credentials are supplied etc
|
12
14
|
module RabidMQ
|
@@ -34,9 +36,6 @@ module RabidMQ
|
|
34
36
|
def connect
|
35
37
|
connection.tap do |c|
|
36
38
|
c.start
|
37
|
-
at_exit do
|
38
|
-
c.close
|
39
|
-
end
|
40
39
|
end
|
41
40
|
end
|
42
41
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rabid_mq
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.16
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tyrone Wilson
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-11-
|
11
|
+
date: 2017-11-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bunny
|