spacebunny 1.2.0 → 1.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +1 -1
- data/examples/device/publish_with_confirm.rb +1 -1
- data/lib/spacebunny/device/amqp.rb +1 -1
- data/lib/spacebunny/device/base.rb +1 -1
- data/lib/spacebunny/endpoint_connection.rb +3 -5
- data/lib/spacebunny/live_stream/base.rb +4 -1
- data/lib/spacebunny/logger.rb +0 -1
- data/lib/spacebunny/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 959545411cb9300660ebea4e3a98d763a53c60bb
|
4
|
+
data.tar.gz: d7c76db70d9bf229c930a8eab87223a2f94170d0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f15e9f4c2e7fc3312631e42b8d6a1f498447bb785c8cfdcb6c7d5f3dbc8308851c348a8375f9f6779ef3927365575757d0037760170206ef89ba8422401d0e5a
|
7
|
+
data.tar.gz: 5259d658d1b70bf4e0dea4fe4103ddb5bf3cbda9e76bdd1b4eb60de3af48fca4c70cf49f885ee1e9cb9d6ef3dd8c12a97f787f06345a62bf12eff1a8ac9db43b
|
data/CHANGELOG.md
CHANGED
@@ -6,6 +6,6 @@
|
|
6
6
|
|
7
7
|
This is an API break and if you previously used the option
|
8
8
|
now it will be ignored.
|
9
|
-
Use instead Bunny's `
|
9
|
+
Use instead Bunny's `recover_from_connection_close`
|
10
10
|
to obtain the same behaviour.
|
11
11
|
Take a look at [Bunny doc](http://rubybunny.info/articles/guides.html) for more details.
|
@@ -74,7 +74,7 @@ result = dev.wait_for_publish_confirms
|
|
74
74
|
# For instance:
|
75
75
|
|
76
76
|
result.each do |channel, status|
|
77
|
-
# If
|
77
|
+
# If status[:all_confirmed] is false, some message has been nacked for the channel. A message may be nacked by SpaceBunny's platform if, for some
|
78
78
|
# reason, it cannot take responsibility for the message
|
79
79
|
unless status[:all_confirmed]
|
80
80
|
# do something with nacked messages
|
@@ -44,7 +44,7 @@ module Spacebunny
|
|
44
44
|
return @connection_configs if @connection_configs
|
45
45
|
if auto_configure?
|
46
46
|
# If key is specified, retrieve configs from APIs endpoint
|
47
|
-
@auto_configs = EndpointConnection.new(@api_endpoint.merge(key: @key)).configs
|
47
|
+
@auto_configs = EndpointConnection.new(@api_endpoint.merge(key: @key, logger: logger)).configs
|
48
48
|
normalize_and_add_channels @auto_configs[:channels]
|
49
49
|
@auto_connection_configs = normalize_auto_connection_configs
|
50
50
|
end
|
@@ -17,6 +17,7 @@ module Spacebunny
|
|
17
17
|
}.freeze
|
18
18
|
|
19
19
|
attr_accessor :scheme, :host, :port, :api_version, :configs_path
|
20
|
+
attr_reader :logger
|
20
21
|
|
21
22
|
def initialize(options = {})
|
22
23
|
unless options.is_a? Hash
|
@@ -34,6 +35,7 @@ module Spacebunny
|
|
34
35
|
@port = options[:port]
|
35
36
|
@api_version = options[:api_version]
|
36
37
|
@configs_path = options[:configs_path]
|
38
|
+
@logger = options.fetch :logger
|
37
39
|
end
|
38
40
|
|
39
41
|
def configs
|
@@ -114,15 +116,11 @@ module Spacebunny
|
|
114
116
|
request.get(uri.to_s)
|
115
117
|
rescue => e
|
116
118
|
logger.error e.message
|
117
|
-
logger.error e.backtrace.join
|
119
|
+
logger.error e.backtrace.join("\n")
|
118
120
|
raise EndPointNotReachable
|
119
121
|
end
|
120
122
|
end
|
121
123
|
|
122
|
-
def logger
|
123
|
-
Spacebunny.logger
|
124
|
-
end
|
125
|
-
|
126
124
|
def merge_with_default(options)
|
127
125
|
DEFAULT_OPTIONS.merge(options) { |key, old_val, new_val| new_val.nil? ? old_val : new_val }
|
128
126
|
end
|
@@ -44,7 +44,10 @@ module Spacebunny
|
|
44
44
|
return @connection_configs if @connection_configs
|
45
45
|
if auto_configure?
|
46
46
|
# If key is specified, retrieve configs from APIs endpoint
|
47
|
-
@auto_configs = EndpointConnection.new(@api_endpoint.merge(
|
47
|
+
@auto_configs = EndpointConnection.new(@api_endpoint.merge(
|
48
|
+
client: @client,
|
49
|
+
secret: @secret,
|
50
|
+
logger: logger)).configs
|
48
51
|
check_and_add_live_streams @auto_configs[:live_streams]
|
49
52
|
@auto_connection_configs = normalize_auto_connection_configs
|
50
53
|
end
|
data/lib/spacebunny/logger.rb
CHANGED
data/lib/spacebunny/version.rb
CHANGED
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.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:
|
11
|
+
date: 2017-02-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: http
|
@@ -151,7 +151,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
151
151
|
version: '0'
|
152
152
|
requirements: []
|
153
153
|
rubyforge_project:
|
154
|
-
rubygems_version: 2.
|
154
|
+
rubygems_version: 2.6.8
|
155
155
|
signing_key:
|
156
156
|
specification_version: 4
|
157
157
|
summary: Space Bunny platform SDK
|