spacebunny 1.2.1 → 1.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/spacebunny/device/amqp.rb +4 -7
- data/lib/spacebunny/device/base.rb +6 -5
- data/lib/spacebunny/live_stream/amqp.rb +4 -10
- data/lib/spacebunny/live_stream/base.rb +6 -5
- data/lib/spacebunny/version.rb +1 -1
- data/spacebunny.gemspec +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 892d8bf97ea06186b2d57513dbbd19af079af1a5
|
4
|
+
data.tar.gz: 5588c10bc31b8506431961d45d9667754bb71edf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 36bd68143b81a475e91044c1e86fa29c986bbb8ad0059c971fe9f45584127f6cd160fb9a85b91cc27c537b9a6202316c28bc7f4c3f1e48116d846eff3dedbadb
|
7
|
+
data.tar.gz: f71344d65f2e367a80b5992ebc60e3c10847137e746c1abf3cededdbd521f1cb28c39cbd0653dad77f1fa7a2ef206bdb8d21089732f9eb0ceb7f3b0560eec50b
|
@@ -26,18 +26,15 @@ module Spacebunny
|
|
26
26
|
# Re-create client every time connect is called
|
27
27
|
@client = Bunny.new(connection_params)
|
28
28
|
@client.start
|
29
|
-
|
30
|
-
|
31
|
-
def channel_from_name(name)
|
32
|
-
# In @built_channels in fact we have exchanges
|
33
|
-
with_channel_check name do
|
34
|
-
@built_exchanges[name]
|
35
|
-
end
|
29
|
+
logger.info 'Connected to SpaceBunny'
|
36
30
|
end
|
37
31
|
|
38
32
|
def disconnect
|
39
33
|
super
|
34
|
+
@built_exchanges = {}
|
35
|
+
@built_channels = {}
|
40
36
|
client.stop if client
|
37
|
+
logger.info 'Disconnected from SpaceBunny'
|
41
38
|
end
|
42
39
|
|
43
40
|
def input_channel
|
@@ -24,13 +24,13 @@ module Spacebunny
|
|
24
24
|
@key = key || options[:key]
|
25
25
|
@api_endpoint = options[:api_endpoint] || {}
|
26
26
|
|
27
|
-
extract_custom_connection_configs_from options
|
28
|
-
set_channels options[:channels]
|
29
|
-
|
30
27
|
@raise_on_error = options[:raise_on_error]
|
31
28
|
@log_to = options[:log_to] || STDOUT
|
32
|
-
@log_level = options[:log_level] || ::Logger::
|
29
|
+
@log_level = options[:log_level] || ::Logger::ERROR
|
33
30
|
@logger = options[:logger] || build_logger
|
31
|
+
|
32
|
+
extract_custom_connection_configs_from options
|
33
|
+
set_channels options[:channels]
|
34
34
|
end
|
35
35
|
|
36
36
|
def api_endpoint=(options)
|
@@ -199,6 +199,7 @@ module Spacebunny
|
|
199
199
|
@custom_connection_configs[:device_id] = @custom_connection_configs.delete :device_id
|
200
200
|
@custom_connection_configs[:device_name] = @custom_connection_configs.delete :device_name
|
201
201
|
@custom_connection_configs[:secret] = @custom_connection_configs.delete :secret
|
202
|
+
@custom_connection_configs[:logger] = @custom_connection_configs.delete(:logger) || @logger
|
202
203
|
end
|
203
204
|
|
204
205
|
# @private
|
@@ -238,7 +239,7 @@ module Spacebunny
|
|
238
239
|
when :error, ::Logger::ERROR, 'error' then ::Logger::ERROR
|
239
240
|
when :fatal, ::Logger::FATAL, 'fatal' then ::Logger::FATAL
|
240
241
|
else
|
241
|
-
Logger::
|
242
|
+
Logger::ERROR
|
242
243
|
end
|
243
244
|
end
|
244
245
|
end
|
@@ -7,11 +7,10 @@ module Spacebunny
|
|
7
7
|
DEFAULT_EXCHANGE_OPTIONS = { passive: true }
|
8
8
|
ACK_TYPES = [:manual, :auto]
|
9
9
|
|
10
|
-
attr_reader :
|
10
|
+
attr_reader :client
|
11
11
|
|
12
12
|
def initialize(*args)
|
13
13
|
super(:amqp, *args)
|
14
|
-
@built_live_streams = {}
|
15
14
|
end
|
16
15
|
|
17
16
|
def connect
|
@@ -26,18 +25,13 @@ module Spacebunny
|
|
26
25
|
# Re-create client every time connect is called
|
27
26
|
@client = Bunny.new(connection_params)
|
28
27
|
@client.start
|
29
|
-
|
30
|
-
|
31
|
-
def channel_from_name(name)
|
32
|
-
# In @built_channels in fact we have exchanges
|
33
|
-
with_channel_check name do
|
34
|
-
@built_exchanges[name]
|
35
|
-
end
|
28
|
+
logger.info 'Connected to SpaceBunny'
|
36
29
|
end
|
37
30
|
|
38
31
|
def disconnect
|
39
32
|
super
|
40
|
-
client.stop
|
33
|
+
client.stop if client
|
34
|
+
logger.info 'Disconnected from SpaceBunny'
|
41
35
|
end
|
42
36
|
|
43
37
|
# Subscribe for messages coming from Live Stream with name 'name'
|
@@ -24,13 +24,13 @@ module Spacebunny
|
|
24
24
|
@secret = options[:secret] || raise(SecretRequired)
|
25
25
|
@api_endpoint = options[:api_endpoint] || {}
|
26
26
|
|
27
|
-
extract_custom_connection_configs_from options
|
28
|
-
set_live_streams options[:live_streams]
|
29
|
-
|
30
27
|
@raise_on_error = options[:raise_on_error]
|
31
28
|
@log_to = options[:log_to] || STDOUT
|
32
|
-
@log_level = options[:log_level] || ::Logger::
|
29
|
+
@log_level = options[:log_level] || ::Logger::ERROR
|
33
30
|
@logger = options[:logger] || build_logger
|
31
|
+
|
32
|
+
extract_custom_connection_configs_from options
|
33
|
+
set_live_streams options[:live_streams]
|
34
34
|
end
|
35
35
|
|
36
36
|
def api_endpoint=(options)
|
@@ -157,6 +157,7 @@ module Spacebunny
|
|
157
157
|
@custom_connection_configs[:vhost] = @custom_connection_configs.delete :vhost
|
158
158
|
@custom_connection_configs[:client] = @custom_connection_configs.delete :client
|
159
159
|
@custom_connection_configs[:secret] = @custom_connection_configs.delete :secret
|
160
|
+
@custom_connection_configs[:logger] = @custom_connection_configs.delete(:logger) || @logger
|
160
161
|
end
|
161
162
|
|
162
163
|
# @private
|
@@ -202,7 +203,7 @@ module Spacebunny
|
|
202
203
|
when :error, ::Logger::ERROR, 'error' then ::Logger::ERROR
|
203
204
|
when :fatal, ::Logger::FATAL, 'fatal' then ::Logger::FATAL
|
204
205
|
else
|
205
|
-
Logger::
|
206
|
+
Logger::ERROR
|
206
207
|
end
|
207
208
|
end
|
208
209
|
end
|
data/lib/spacebunny/version.rb
CHANGED
data/spacebunny.gemspec
CHANGED
@@ -19,7 +19,7 @@ Gem::Specification.new do |spec|
|
|
19
19
|
spec.require_paths = ['lib']
|
20
20
|
spec.required_ruby_version = '>= 1.9.3'
|
21
21
|
spec.add_runtime_dependency 'http', '~> 2.0.3', '>= 1.0.4'
|
22
|
-
spec.add_runtime_dependency 'bunny', '~> 2.6.
|
22
|
+
spec.add_runtime_dependency 'bunny', '~> 2.6.4', '>= 2.3.0'
|
23
23
|
|
24
24
|
spec.add_development_dependency 'bundler', '~> 1.10'
|
25
25
|
spec.add_development_dependency 'rake', '~> 10.0'
|
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.2.
|
4
|
+
version: 1.2.2
|
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-
|
11
|
+
date: 2017-03-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: http
|
@@ -36,7 +36,7 @@ dependencies:
|
|
36
36
|
requirements:
|
37
37
|
- - "~>"
|
38
38
|
- !ruby/object:Gem::Version
|
39
|
-
version: 2.6.
|
39
|
+
version: 2.6.4
|
40
40
|
- - ">="
|
41
41
|
- !ruby/object:Gem::Version
|
42
42
|
version: 2.3.0
|
@@ -46,7 +46,7 @@ dependencies:
|
|
46
46
|
requirements:
|
47
47
|
- - "~>"
|
48
48
|
- !ruby/object:Gem::Version
|
49
|
-
version: 2.6.
|
49
|
+
version: 2.6.4
|
50
50
|
- - ">="
|
51
51
|
- !ruby/object:Gem::Version
|
52
52
|
version: 2.3.0
|