msgr 0.6.0 → 0.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/msgr/railtie.rb +12 -7
- data/lib/msgr/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 74bc282f2c3490019c1352247ed06139fc418d18
|
4
|
+
data.tar.gz: c83b3e95b5d586dcf50523b9ccee1640e00ac107
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 65d7bffc592f29c546a64f509707060696226b935fac93b83662131025a7d52832c0970fcd71e092743917639a18f76f40ca07eec2075cafd94ef231485fd19b
|
7
|
+
data.tar.gz: 9bca32dc98f02eb2802b3ef22be407666d5ebc8ea029ad3fdc813344886923c1e0a41c95c6d9f5975136875aaa3fa2f1defc2d54346d75623023051f3d279f5f
|
data/lib/msgr/railtie.rb
CHANGED
@@ -32,23 +32,28 @@ module Msgr
|
|
32
32
|
|
33
33
|
def parse_config(cfg)
|
34
34
|
unless cfg.is_a? Hash
|
35
|
-
|
35
|
+
Rails.logger.wanr '[Msgr] Could not load rabbitmq config: Config must be a Hash'
|
36
|
+
return nil
|
36
37
|
end
|
38
|
+
|
37
39
|
unless cfg[Rails.env].is_a?(Hash)
|
38
40
|
raise ArgumentError, "Could not load rabbitmq config for environment \"#{Rails.env}\": is not a Hash"
|
39
41
|
end
|
42
|
+
|
40
43
|
cfg = HashWithIndifferentAccess.new cfg[Rails.env]
|
41
44
|
unless cfg[:uri]
|
42
45
|
raise ArgumentError, 'Could not load rabbitmq environment config: URI missing.'
|
43
46
|
end
|
47
|
+
|
44
48
|
case cfg[:autostart]
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
49
|
+
when true, 'true', 'enabled', nil
|
50
|
+
cfg[:autostart] = true
|
51
|
+
when false, 'false', 'disabled'
|
52
|
+
cfg[:autostart] = false
|
53
|
+
else
|
54
|
+
raise ArgumentError, "Invalid value for rabbitmq config autostart: \"#{cfg[:autostart]}\""
|
51
55
|
end
|
56
|
+
|
52
57
|
cfg[:routing_file] ||= Rails.root.join('config/msgr.rb').to_s
|
53
58
|
cfg
|
54
59
|
end
|
data/lib/msgr/version.rb
CHANGED