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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: fbb52de81289a805cfeccc3900c6d984eb32a0e5
4
- data.tar.gz: aa2e316207767e8c06b6ad780b80013da93f2682
3
+ metadata.gz: 959545411cb9300660ebea4e3a98d763a53c60bb
4
+ data.tar.gz: d7c76db70d9bf229c930a8eab87223a2f94170d0
5
5
  SHA512:
6
- metadata.gz: 4a2200ef7c5089d6cfc7591f882d05b26cc31d410afa5b99dd1376ac76a0f82fb89a8d006a097fd9b65f356d960df2b3859e5347ecccb8a767179645b4d0119e
7
- data.tar.gz: 25c9c4064863a6c6aad1531e9c1841d9b396a33ff5a8db4b0d5d4f1b7ce6aeea6fcf81dbe30b2bf96e5566ed573b8359a9b37161d4fa7983954cf28602de4c5a
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 `auto_recover_from_connection_close`
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 result is false, some message has been nacked. A message may be nacked by SpaceBunny's platform if, for some
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
@@ -37,7 +37,7 @@ module Spacebunny
37
37
 
38
38
  def disconnect
39
39
  super
40
- client.stop
40
+ client.stop if client
41
41
  end
42
42
 
43
43
  def input_channel
@@ -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 "\n"
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(client: @client, secret: @secret)).configs
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
@@ -13,7 +13,6 @@ module Spacebunny
13
13
  case a
14
14
  when String
15
15
  # This is a file path
16
- puts File.open(a, 'a+').inspect
17
16
  @streams << File.open(a, 'a+')
18
17
  else
19
18
  @streams << a
@@ -1,3 +1,3 @@
1
1
  module Spacebunny
2
- VERSION = '1.2.0'
2
+ VERSION = '1.2.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.2.0
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: 2016-11-17 00:00:00.000000000 Z
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.5.1
154
+ rubygems_version: 2.6.8
155
155
  signing_key:
156
156
  specification_version: 4
157
157
  summary: Space Bunny platform SDK