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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2b46ec93076bc0466fca8997a602a3faa7079309
4
- data.tar.gz: 5220d114d91e877930eecb202d1f0520a7c6b75d
3
+ metadata.gz: d458575d2c820f8067d55339aa9629c621932be8
4
+ data.tar.gz: da5b81b623736ee9cacbcf73ad540306ede0ea99
5
5
  SHA512:
6
- metadata.gz: c07893c443c2ca6b17d8b28688926b4cf0eaf6e8a7de81a2ac4cafb5b56af6abfc27a1adcdc92f7266c326ae18781fa4cb191e56a5e13c728bf4d2b34f2db526
7
- data.tar.gz: 7bf927fcad5585286d18f35df92adc8a2a38a3df1a43b726fee86bd45983cf263a418c6a4b1de5f191d01c9dbf10196e67e7089479bf7ef69e8f46b1eee5a6e9
6
+ metadata.gz: 1c8b5034a0b022d8aa3843fb05da38dee33b71d05824ac21816cad8f65ce010ec0dd3ec4b643814634ef268bdb0fa0106eaba8b9e0ec0970e9a663695711f25b
7
+ data.tar.gz: 28db93644294d41a221358c8268b2195b903ee2fc97fe4f5d4559097385cd7048fb6191c7560569c7edc5f0c50e6a3190af22f50ac6d4c4c72600bbe0e8e96fb
@@ -2,12 +2,16 @@ module RabidMQ
2
2
  module Config
3
3
  class << self
4
4
  def load_config
5
- @config ||= YAML.load(ERB.new(File.read(file_name)).result)[Rails.env].symbolize_keys
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
 
@@ -1,3 +1,3 @@
1
1
  module RabidMQ
2
- VERSION = "0.1.15"
2
+ VERSION = "0.1.16"
3
3
  end
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.15
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-29 00:00:00.000000000 Z
11
+ date: 2017-11-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bunny