spacebunny 1.5.1 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fe4680375b3b128efbc35c538afe1a3773b1efcb143948fd347a5748080f4042
4
- data.tar.gz: 6dc83ba64745a3f7cdbb6e585180221fb884d5d425684bbdf94788ef06923735
3
+ metadata.gz: 79423177a33673d1ef8d2bdea8a209fe1fbe838213098906face4e1b0c67b412
4
+ data.tar.gz: 14ee534f9d8b5a599e3fc7d61a8e1060328d2047f06ee4b8a6945858d9b33ee2
5
5
  SHA512:
6
- metadata.gz: 2143d429591141aa6564b0234867193f279ab68faecfd11f7e5e063956a709f10024d7f8b535cb52721e66b446baa48c6bcb05619d3f9d29bdb548121023ff20
7
- data.tar.gz: 85805efff5c1362d8b5c204927a901868704c7c1c1f215e5dacf24d89cc89923696d832a82a8dbae483ba74f2be3b459c4f7ba313fded78101a3623616bd6b13
6
+ metadata.gz: 5207bc0ce5f25cd8e998908fa71439e1f7d013ecc90f436e123c4a39aa1ebcecb29471acb7109a5d390a0ea1e340ae52058b53b876d1a56155d0d82a3561d378
7
+ data.tar.gz: 5fedc47a561d2dab28275d1e4348bd0cd986aeb946a177906c3a102c90d62117be55b6c86382070dfe26fefe8e86fb8f75f93839c85682c53793c69d1b370ada
@@ -1,4 +1,9 @@
1
- ## Changes betwen 1.1.0 and 1.2.0
1
+ ## Changes between 1.5.1 and 2.0.0
2
+
3
+ **This release uses the new SpaceBunny API and is incompatible with previous versions**
4
+
5
+
6
+ ## Changes between 1.1.0 and 1.2.0
2
7
 
3
8
  **This release includes minor breaking API changes**
4
9
 
@@ -169,7 +169,6 @@ module Spacebunny
169
169
  # @private
170
170
  # Check for required params presence
171
171
  def check_connection_configs
172
- puts @connection_configs.inspect
173
172
  raise DeviceIdMissing unless @connection_configs[:device_id]
174
173
  end
175
174
 
@@ -9,14 +9,13 @@ module Spacebunny
9
9
  scheme: 'https',
10
10
  host: 'api.spacebunny.io',
11
11
  port: 443,
12
- api_version: '/v1',
13
12
  configs_path: {
14
13
  device: '/device_configurations',
15
14
  live_stream: '/live_stream_key_configurations'
16
15
  }
17
16
  }.freeze
18
17
 
19
- attr_accessor :scheme, :host, :port, :api_version, :configs_path
18
+ attr_accessor :scheme, :host, :port, :configs_path
20
19
  attr_reader :logger
21
20
 
22
21
  def initialize(options = {})
@@ -33,7 +32,6 @@ module Spacebunny
33
32
  @scheme = options[:scheme]
34
33
  @host = options[:host]
35
34
  @port = options[:port]
36
- @api_version = options[:api_version]
37
35
  @configs_path = options[:configs_path]
38
36
  @logger = options.fetch :logger
39
37
  end
@@ -66,7 +64,7 @@ module Spacebunny
66
64
  URI::HTTPS
67
65
  end
68
66
 
69
- unless uri = uri_builder.build(host: host, port: port, path: "#{api_version}#{configs_path}")
67
+ unless uri = uri_builder.build(host: host, port: port, path: "#{configs_path}")
70
68
  raise SchemeNotValid.new(scheme)
71
69
  end
72
70
 
@@ -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_live_streams options[:live_streams]
34
34
  end
35
35
 
@@ -73,7 +73,7 @@ module Spacebunny
73
73
  unless options.is_a? Hash
74
74
  raise ArgumentError, 'connection_options must be an Hash. See doc for further info'
75
75
  end
76
- extract_custom_connection_configs_from options.with_indifferent_access
76
+ extract_and_normalize_custom_connection_configs_from options.with_indifferent_access
77
77
  end
78
78
 
79
79
  def disconnect
@@ -152,18 +152,21 @@ module Spacebunny
152
152
  end
153
153
 
154
154
  # @private
155
- def extract_custom_connection_configs_from(options)
155
+ def extract_and_normalize_custom_connection_configs_from(options)
156
156
  @custom_connection_configs = options
157
- # Auto_recover from connection.close by default
158
- @custom_connection_configs[:host] = @custom_connection_configs.delete :host
159
- if @custom_connection_configs[:protocols] && custom_connection_configs[:protocols][@protocol]
160
- @custom_connection_configs[:port] = @custom_connection_configs[:protocols][@protocol].delete :port
161
- @custom_connection_configs[:tls_port] = @custom_connection_configs[:protocols][@protocol].delete :tls_port
162
- end
163
- @custom_connection_configs[:vhost] = @custom_connection_configs.delete :vhost
164
- @custom_connection_configs[:client] = @custom_connection_configs.delete :client
165
- @custom_connection_configs[:secret] = @custom_connection_configs.delete :secret
157
+
166
158
  @custom_connection_configs[:logger] = @custom_connection_configs.delete(:logger) || @logger
159
+
160
+ if conn_options = @custom_connection_configs[:connection]
161
+ @custom_connection_configs[:host] = conn_options.delete :host
162
+ if conn_options[:protocols] && conn_options[:protocols][@protocol]
163
+ @custom_connection_configs[:port] = conn_options[:protocols][@protocol].delete :port
164
+ @custom_connection_configs[:tls_port] = conn_options[:protocols][@protocol].delete :tls_port
165
+ end
166
+ @custom_connection_configs[:vhost] = conn_options.delete :vhost
167
+ @custom_connection_configs[:client] = conn_options.delete :client
168
+ @custom_connection_configs[:secret] = conn_options.delete :secret
169
+ end
167
170
  end
168
171
 
169
172
  # @private
@@ -1,3 +1,3 @@
1
1
  module Spacebunny
2
- VERSION = '1.5.1'
2
+ VERSION = '2.0.0'
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.1
4
+ version: 2.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alessandro Verlato
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-04-24 00:00:00.000000000 Z
11
+ date: 2018-07-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: http