ldclient-rb 2.0.3 → 2.0.5

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: 238b1aa2f0ad4188eb0f393cde367276224a97f9
4
- data.tar.gz: 8651d4e965420a5e8bf6f463c8c9ade30c6a7cb1
3
+ metadata.gz: 82f21d4e659c7c6c1437c83513a85fcbf9726616
4
+ data.tar.gz: 2805945abd6094ae4d3a06af898d37f670dcf021
5
5
  SHA512:
6
- metadata.gz: 5c56792c832ad9e8a65006d6617136b1c01f41064465d87e4952ed3d4dd3a92cd276d2a02b457058aa01b8d80b29815f63b33d415aa8ac0b34e07e3b90f9479d
7
- data.tar.gz: cd862bbf005730031147eb389f51fbbc3ce48c2e30949177bf5795bc5f1ac8a7c22dc6e27599eeb8fb0050b63038635dc71f13f07f89bfdb3d456ac85d5b4bac
6
+ metadata.gz: 8f8bdbe447daba2b31251dac7b48a5f26c5da640aa6f562757b7605f1eb1f78426a5ec2f84b2587615f92416c899a2f5b86796cfb7149b3fae31596a05f42490
7
+ data.tar.gz: 4d1595f110688c49a78e198dba899766988a204284039eabdb2e2205647198c8d770d2bf1e754ab84f88003d9c6972e362e979cc5d43b8fd08c0bca8b15e84b8
@@ -2,6 +2,10 @@
2
2
 
3
3
  All notable changes to the LaunchDarkly Ruby SDK will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org).
4
4
 
5
+ ## [2.0.4] - 2017-01-31
6
+ ## Changed
7
+ - Improved error handling when connected to flag update stream.
8
+
5
9
  ## [2.0.3] - 2016-10-21
6
10
  ## Fixed
7
11
  - Indirect stream events are now correctly processed
data/README.md CHANGED
@@ -118,13 +118,16 @@ About LaunchDarkly
118
118
  * [JavaScript] (http://docs.launchdarkly.com/docs/js-sdk-reference "LaunchDarkly JavaScript SDK")
119
119
  * [PHP] (http://docs.launchdarkly.com/docs/php-sdk-reference "LaunchDarkly PHP SDK")
120
120
  * [Python] (http://docs.launchdarkly.com/docs/python-sdk-reference "LaunchDarkly Python SDK")
121
+ * [Python Twisted] (http://docs.launchdarkly.com/docs/python-twisted-sdk-reference "LaunchDarkly Python Twisted SDK")
121
122
  * [Go] (http://docs.launchdarkly.com/docs/go-sdk-reference "LaunchDarkly Go SDK")
122
123
  * [Node.JS] (http://docs.launchdarkly.com/docs/node-sdk-reference "LaunchDarkly Node SDK")
123
124
  * [.NET] (http://docs.launchdarkly.com/docs/dotnet-sdk-reference "LaunchDarkly .Net SDK")
124
125
  * [Ruby] (http://docs.launchdarkly.com/docs/ruby-sdk-reference "LaunchDarkly Ruby SDK")
125
- * [Python Twisted] (http://docs.launchdarkly.com/docs/python-twisted "LaunchDarkly Python Twisted SDK")
126
+ * [iOS] (http://docs.launchdarkly.com/docs/ios-sdk-reference "LaunchDarkly iOS SDK")
127
+ * [Android] (http://docs.launchdarkly.com/docs/android-sdk-reference "LaunchDarkly Android SDK")
126
128
  * Explore LaunchDarkly
127
- * [www.launchdarkly.com] (http://www.launchdarkly.com/ "LaunchDarkly Main Website") for more information
129
+ * [launchdarkly.com] (http://www.launchdarkly.com/ "LaunchDarkly Main Website") for more information
128
130
  * [docs.launchdarkly.com] (http://docs.launchdarkly.com/ "LaunchDarkly Documentation") for our documentation and SDKs
129
131
  * [apidocs.launchdarkly.com] (http://apidocs.launchdarkly.com/ "LaunchDarkly API Documentation") for our API documentation
130
132
  * [blog.launchdarkly.com] (http://blog.launchdarkly.com/ "LaunchDarkly Blog Documentation") for the latest product updates
133
+ * [Feature Flagging Guide] (https://github.com/launchdarkly/featureflags/ "Feature Flagging Guide") for best practices and strategies
@@ -29,8 +29,10 @@ Gem::Specification.new do |spec|
29
29
  spec.add_runtime_dependency "faraday-http-cache", "~> 1.3.0"
30
30
  spec.add_runtime_dependency "thread_safe", "~> 0.3"
31
31
  spec.add_runtime_dependency "net-http-persistent", "~> 2.9"
32
- spec.add_runtime_dependency "concurrent-ruby", "~> 1.0.0"
32
+ spec.add_runtime_dependency "concurrent-ruby", "~> 1.0.4"
33
33
  spec.add_runtime_dependency "hashdiff", "~> 0.2"
34
- spec.add_runtime_dependency "ld-celluloid-eventsource", "~> 0.5"
34
+ spec.add_runtime_dependency "ld-celluloid-eventsource", "~> 0.8.3"
35
+ spec.add_runtime_dependency "nio4r", "~> 1.1" # for maximum ruby version compatibility.
36
+
35
37
  spec.add_runtime_dependency "waitutil", "0.2"
36
38
  end
@@ -37,7 +37,7 @@ module LaunchDarkly
37
37
  # @option opts [Boolean] :offline (false) Whether the client should be initialized in
38
38
  # offline mode. In offline mode, default values are returned for all flags and no
39
39
  # remote network requests are made.
40
- # @option opts [Float] :poll_interval (30) The number of seconds between polls for flag updates
40
+ # @option opts [Float] :poll_interval (1) The number of seconds between polls for flag updates
41
41
  # if streaming is off.
42
42
  # @option opts [Boolean] :stream (true) Whether or not the streaming API should be used to receive flag updates.
43
43
  #
@@ -24,13 +24,16 @@ module LaunchDarkly
24
24
  end
25
25
 
26
26
  def make_request(path)
27
- res = @client.get (@config.base_uri + path) do |req|
27
+ uri = @config.base_uri + path
28
+ res = @client.get (uri) do |req|
28
29
  req.headers["Authorization"] = @sdk_key
29
30
  req.headers["User-Agent"] = "RubyClient/" + LaunchDarkly::VERSION
30
31
  req.options.timeout = @config.read_timeout
31
32
  req.options.open_timeout = @config.connect_timeout
32
33
  end
33
34
 
35
+ @config.logger.debug("[LDClient] Got response from uri: #{uri}\n\tstatus code: #{res.status}\n\theaders: #{res.headers}\n\tbody: #{res.body}")
36
+
34
37
  if res.status == 401
35
38
  @config.logger.error("[LDClient] Invalid SDK key")
36
39
  return nil
@@ -40,14 +40,11 @@ module LaunchDarkly
40
40
  conn.on(DELETE) { |message| process_message(message, DELETE) }
41
41
  conn.on(INDIRECT_PUT) { |message| process_message(message, INDIRECT_PUT) }
42
42
  conn.on(INDIRECT_PATCH) { |message| process_message(message, INDIRECT_PATCH) }
43
- conn.on_error do |message|
44
- @config.logger.error("[LDClient] Error connecting to stream. Status code: #{message[:status_code]}")
45
- end
46
43
  end
47
44
  end
48
45
 
49
46
  def process_message(message, method)
50
- @config.logger.debug("[LDClient] Stream received #{method} message")
47
+ @config.logger.debug("[LDClient] Stream received #{method} message: #{message.data}")
51
48
  if method == PUT
52
49
  message = JSON.parse(message.data, symbolize_names: true)
53
50
  @store.init(message)
@@ -1,3 +1,3 @@
1
1
  module LaunchDarkly
2
- VERSION = "2.0.3"
2
+ VERSION = "2.0.5"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ldclient-rb
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.3
4
+ version: 2.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - LaunchDarkly
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-10-21 00:00:00.000000000 Z
11
+ date: 2017-01-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -142,14 +142,14 @@ dependencies:
142
142
  requirements:
143
143
  - - "~>"
144
144
  - !ruby/object:Gem::Version
145
- version: 1.0.0
145
+ version: 1.0.4
146
146
  type: :runtime
147
147
  prerelease: false
148
148
  version_requirements: !ruby/object:Gem::Requirement
149
149
  requirements:
150
150
  - - "~>"
151
151
  - !ruby/object:Gem::Version
152
- version: 1.0.0
152
+ version: 1.0.4
153
153
  - !ruby/object:Gem::Dependency
154
154
  name: hashdiff
155
155
  requirement: !ruby/object:Gem::Requirement
@@ -170,14 +170,28 @@ dependencies:
170
170
  requirements:
171
171
  - - "~>"
172
172
  - !ruby/object:Gem::Version
173
- version: '0.5'
173
+ version: 0.8.3
174
174
  type: :runtime
175
175
  prerelease: false
176
176
  version_requirements: !ruby/object:Gem::Requirement
177
177
  requirements:
178
178
  - - "~>"
179
179
  - !ruby/object:Gem::Version
180
- version: '0.5'
180
+ version: 0.8.3
181
+ - !ruby/object:Gem::Dependency
182
+ name: nio4r
183
+ requirement: !ruby/object:Gem::Requirement
184
+ requirements:
185
+ - - "~>"
186
+ - !ruby/object:Gem::Version
187
+ version: '1.1'
188
+ type: :runtime
189
+ prerelease: false
190
+ version_requirements: !ruby/object:Gem::Requirement
191
+ requirements:
192
+ - - "~>"
193
+ - !ruby/object:Gem::Version
194
+ version: '1.1'
181
195
  - !ruby/object:Gem::Dependency
182
196
  name: waitutil
183
197
  requirement: !ruby/object:Gem::Requirement
@@ -257,7 +271,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
257
271
  version: '0'
258
272
  requirements: []
259
273
  rubyforge_project:
260
- rubygems_version: 2.5.0
274
+ rubygems_version: 2.5.1
261
275
  signing_key:
262
276
  specification_version: 4
263
277
  summary: LaunchDarkly SDK for Ruby