spacebunny 1.5.0 → 1.5.1

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
- SHA1:
3
- metadata.gz: 7374dde1dc5ef97f68a8896120f12ee9d84d88be
4
- data.tar.gz: 77dee2b92ec3fea47d0214925be32076f9c7637e
2
+ SHA256:
3
+ metadata.gz: fe4680375b3b128efbc35c538afe1a3773b1efcb143948fd347a5748080f4042
4
+ data.tar.gz: 6dc83ba64745a3f7cdbb6e585180221fb884d5d425684bbdf94788ef06923735
5
5
  SHA512:
6
- metadata.gz: b7e20c7aaf099bb1f07aed48096f965487b9348f977a207670ffe3e36afdcf614640316cd1a1d343548aab2d36e63943b16b8fb063e8231314bae50235394758
7
- data.tar.gz: e90a3c501960c2978c74a19b70f177572cf4eb3f681ab621f8ede136ed654a753244056ad791a480e8630e44a90f1efc3836c78702fa8931b827a39cea889aaa
6
+ metadata.gz: 2143d429591141aa6564b0234867193f279ab68faecfd11f7e5e063956a709f10024d7f8b535cb52721e66b446baa48c6bcb05619d3f9d29bdb548121023ff20
7
+ data.tar.gz: 85805efff5c1362d8b5c204927a901868704c7c1c1f215e5dacf24d89cc89923696d832a82a8dbae483ba74f2be3b459c4f7ba313fded78101a3623616bd6b13
@@ -29,7 +29,7 @@ module Spacebunny
29
29
  @log_level = options[:log_level] || ::Logger::ERROR
30
30
  @logger = options[:logger] || build_logger
31
31
 
32
- extract_custom_connection_configs_from options
32
+ extract_and_normalize_custom_connection_configs_from options
33
33
  set_channels options[:channels]
34
34
  end
35
35
 
@@ -71,7 +71,7 @@ module Spacebunny
71
71
  unless options.is_a? Hash
72
72
  raise ArgumentError, 'connection_options must be an Hash. See doc for further info'
73
73
  end
74
- extract_custom_connection_configs_from options.with_indifferent_access
74
+ extract_and_normalize_custom_connection_configs_from options.with_indifferent_access
75
75
  end
76
76
 
77
77
  def disconnect
@@ -169,6 +169,7 @@ module Spacebunny
169
169
  # @private
170
170
  # Check for required params presence
171
171
  def check_connection_configs
172
+ puts @connection_configs.inspect
172
173
  raise DeviceIdMissing unless @connection_configs[:device_id]
173
174
  end
174
175
 
@@ -194,19 +195,22 @@ module Spacebunny
194
195
 
195
196
  # @private
196
197
  # Copy options to custom_connection_configs and normalize some of the attributes overwriting it
197
- def extract_custom_connection_configs_from(options)
198
+ def extract_and_normalize_custom_connection_configs_from(options)
198
199
  @custom_connection_configs = options
199
- # Auto_recover from connection.close by default
200
- @custom_connection_configs[:host] = @custom_connection_configs.delete :host
201
- if @custom_connection_configs[:protocols] && custom_connection_configs[:protocols][@protocol]
202
- @custom_connection_configs[:port] = @custom_connection_configs[:protocols][@protocol].delete :port
203
- @custom_connection_configs[:tls_port] = @custom_connection_configs[:protocols][@protocol].delete :tls_port
204
- end
205
- @custom_connection_configs[:vhost] = @custom_connection_configs.delete :vhost
206
- @custom_connection_configs[:device_id] = @custom_connection_configs.delete :device_id
207
- @custom_connection_configs[:device_name] = @custom_connection_configs.delete :device_name
208
- @custom_connection_configs[:secret] = @custom_connection_configs.delete :secret
200
+
209
201
  @custom_connection_configs[:logger] = @custom_connection_configs.delete(:logger) || @logger
202
+
203
+ if conn_options = @custom_connection_configs[:connection]
204
+ @custom_connection_configs[:host] = conn_options.delete :host
205
+ if conn_options[:protocols] && conn_options[:protocols][@protocol]
206
+ @custom_connection_configs[:port] = conn_options[:protocols][@protocol].delete :port
207
+ @custom_connection_configs[:tls_port] = conn_options[:protocols][@protocol].delete :tls_port
208
+ end
209
+ @custom_connection_configs[:vhost] = conn_options.delete :vhost
210
+ @custom_connection_configs[:device_id] = conn_options.delete :device_id
211
+ @custom_connection_configs[:device_name] = conn_options.delete :device_name
212
+ @custom_connection_configs[:secret] = conn_options.delete :secret
213
+ end
210
214
  end
211
215
 
212
216
  # @private
@@ -1,3 +1,3 @@
1
1
  module Spacebunny
2
- VERSION = '1.5.0'
2
+ VERSION = '1.5.1'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spacebunny
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.0
4
+ version: 1.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alessandro Verlato
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-10-09 00:00:00.000000000 Z
11
+ date: 2018-04-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: http
@@ -139,7 +139,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
139
139
  version: '0'
140
140
  requirements: []
141
141
  rubyforge_project:
142
- rubygems_version: 2.6.12
142
+ rubygems_version: 2.7.3
143
143
  signing_key:
144
144
  specification_version: 4
145
145
  summary: Space Bunny platform SDK