msgr 0.6.0 → 0.7.0

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: 572b27112d6f49732b12fb01d025b7786833b320
4
- data.tar.gz: 69a1907ae06670f7f3f214e913ac90667d259e68
3
+ metadata.gz: 74bc282f2c3490019c1352247ed06139fc418d18
4
+ data.tar.gz: c83b3e95b5d586dcf50523b9ccee1640e00ac107
5
5
  SHA512:
6
- metadata.gz: 10cb2bd0d31d479d2169a07d71be51467ecd8e197e2a1d18cf3a4757c8fc7a4e40607335f1cbda668af85c6469bfdc10472502fb06a1efb4b0769217b0b9f0ff
7
- data.tar.gz: ed6f1cf62d4ae65435f2fa88f338e9e5107e18d0c4b3d5b16f7aaaec4d31d501cf79c309d6a12943bd2ce6ee58923b6c9231d4f5351331f7f22a8c89a0833c50
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
- raise ArgumentError, 'Could not load rabbitmq config: Config must be a Hash'
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
- when true, 'true', 'enabled', nil
46
- cfg[:autostart] = true
47
- when false, 'false', 'disabled'
48
- cfg[:autostart] = false
49
- else
50
- raise ArgumentError, "Invalid value for rabbitmq config autostart: \"#{cfg[:autostart]}\""
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
@@ -1,7 +1,7 @@
1
1
  module Msgr
2
2
  module VERSION
3
3
  MAJOR = 0
4
- MINOR = 6
4
+ MINOR = 7
5
5
  PATCH = 0
6
6
  STAGE = nil
7
7
  STRING = [MAJOR, MINOR, PATCH, STAGE].reject(&:nil?).join('.')
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: msgr
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 0.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jan Graichen