launchdarkly-server-sdk 5.5.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (87) hide show
  1. checksums.yaml +7 -0
  2. data/.circleci/config.yml +134 -0
  3. data/.github/ISSUE_TEMPLATE/bug_report.md +37 -0
  4. data/.github/ISSUE_TEMPLATE/feature_request.md +20 -0
  5. data/.gitignore +15 -0
  6. data/.hound.yml +2 -0
  7. data/.rspec +2 -0
  8. data/.rubocop.yml +600 -0
  9. data/.simplecov +4 -0
  10. data/.yardopts +9 -0
  11. data/CHANGELOG.md +261 -0
  12. data/CODEOWNERS +1 -0
  13. data/CONTRIBUTING.md +37 -0
  14. data/Gemfile +3 -0
  15. data/Gemfile.lock +102 -0
  16. data/LICENSE.txt +13 -0
  17. data/README.md +56 -0
  18. data/Rakefile +5 -0
  19. data/azure-pipelines.yml +51 -0
  20. data/ext/mkrf_conf.rb +11 -0
  21. data/launchdarkly-server-sdk.gemspec +40 -0
  22. data/lib/ldclient-rb.rb +29 -0
  23. data/lib/ldclient-rb/cache_store.rb +45 -0
  24. data/lib/ldclient-rb/config.rb +411 -0
  25. data/lib/ldclient-rb/evaluation.rb +455 -0
  26. data/lib/ldclient-rb/event_summarizer.rb +55 -0
  27. data/lib/ldclient-rb/events.rb +468 -0
  28. data/lib/ldclient-rb/expiring_cache.rb +77 -0
  29. data/lib/ldclient-rb/file_data_source.rb +312 -0
  30. data/lib/ldclient-rb/flags_state.rb +76 -0
  31. data/lib/ldclient-rb/impl.rb +13 -0
  32. data/lib/ldclient-rb/impl/integrations/consul_impl.rb +158 -0
  33. data/lib/ldclient-rb/impl/integrations/dynamodb_impl.rb +228 -0
  34. data/lib/ldclient-rb/impl/integrations/redis_impl.rb +155 -0
  35. data/lib/ldclient-rb/impl/store_client_wrapper.rb +47 -0
  36. data/lib/ldclient-rb/impl/store_data_set_sorter.rb +55 -0
  37. data/lib/ldclient-rb/in_memory_store.rb +100 -0
  38. data/lib/ldclient-rb/integrations.rb +55 -0
  39. data/lib/ldclient-rb/integrations/consul.rb +38 -0
  40. data/lib/ldclient-rb/integrations/dynamodb.rb +47 -0
  41. data/lib/ldclient-rb/integrations/redis.rb +55 -0
  42. data/lib/ldclient-rb/integrations/util/store_wrapper.rb +230 -0
  43. data/lib/ldclient-rb/interfaces.rb +153 -0
  44. data/lib/ldclient-rb/ldclient.rb +424 -0
  45. data/lib/ldclient-rb/memoized_value.rb +32 -0
  46. data/lib/ldclient-rb/newrelic.rb +17 -0
  47. data/lib/ldclient-rb/non_blocking_thread_pool.rb +46 -0
  48. data/lib/ldclient-rb/polling.rb +78 -0
  49. data/lib/ldclient-rb/redis_store.rb +87 -0
  50. data/lib/ldclient-rb/requestor.rb +101 -0
  51. data/lib/ldclient-rb/simple_lru_cache.rb +25 -0
  52. data/lib/ldclient-rb/stream.rb +141 -0
  53. data/lib/ldclient-rb/user_filter.rb +51 -0
  54. data/lib/ldclient-rb/util.rb +50 -0
  55. data/lib/ldclient-rb/version.rb +3 -0
  56. data/scripts/gendocs.sh +11 -0
  57. data/scripts/release.sh +27 -0
  58. data/spec/config_spec.rb +63 -0
  59. data/spec/evaluation_spec.rb +739 -0
  60. data/spec/event_summarizer_spec.rb +63 -0
  61. data/spec/events_spec.rb +642 -0
  62. data/spec/expiring_cache_spec.rb +76 -0
  63. data/spec/feature_store_spec_base.rb +213 -0
  64. data/spec/file_data_source_spec.rb +255 -0
  65. data/spec/fixtures/feature.json +37 -0
  66. data/spec/fixtures/feature1.json +36 -0
  67. data/spec/fixtures/user.json +9 -0
  68. data/spec/flags_state_spec.rb +81 -0
  69. data/spec/http_util.rb +109 -0
  70. data/spec/in_memory_feature_store_spec.rb +12 -0
  71. data/spec/integrations/consul_feature_store_spec.rb +42 -0
  72. data/spec/integrations/dynamodb_feature_store_spec.rb +105 -0
  73. data/spec/integrations/store_wrapper_spec.rb +276 -0
  74. data/spec/ldclient_spec.rb +471 -0
  75. data/spec/newrelic_spec.rb +5 -0
  76. data/spec/polling_spec.rb +120 -0
  77. data/spec/redis_feature_store_spec.rb +95 -0
  78. data/spec/requestor_spec.rb +214 -0
  79. data/spec/segment_store_spec_base.rb +95 -0
  80. data/spec/simple_lru_cache_spec.rb +24 -0
  81. data/spec/spec_helper.rb +9 -0
  82. data/spec/store_spec.rb +10 -0
  83. data/spec/stream_spec.rb +60 -0
  84. data/spec/user_filter_spec.rb +91 -0
  85. data/spec/util_spec.rb +17 -0
  86. data/spec/version_spec.rb +7 -0
  87. metadata +375 -0
data/.simplecov ADDED
@@ -0,0 +1,4 @@
1
+ SimpleCov.start do
2
+ add_filter '/spec/'
3
+ add_filter '/.bundle/'
4
+ end
data/.yardopts ADDED
@@ -0,0 +1,9 @@
1
+ --no-private
2
+ --markup markdown
3
+ --embed-mixins
4
+ lib/*.rb
5
+ lib/**/*.rb
6
+ lib/**/**/*.rb
7
+ lib/**/**/**/*.rb
8
+ -
9
+ README.md
data/CHANGELOG.md ADDED
@@ -0,0 +1,261 @@
1
+ # Change log
2
+
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
+
5
+ ## [5.5.7] - 2019-05-13
6
+ ### Changed:
7
+ - Changed the gem name from `ldclient-rb` to `launchdarkly-server-sdk`.
8
+
9
+ There are no other changes in this release. Substituting `ldclient-rb` version 5.5.6 with `launchdarkly-server-sdk` version 5.5.7 will not affect functionality.
10
+
11
+ ## [5.5.6] - 2019-05-08
12
+ ### Fixed:
13
+ - CI tests now include Ruby 2.6.x.
14
+ - Running the SDK unit tests is now simpler, as the database integrations can be skipped. See `CONTRIBUTING.md`.
15
+
16
+ # Note on future releases
17
+
18
+ The LaunchDarkly SDK repositories are being renamed for consistency. This repository is now `ruby-server-sdk` rather than `ruby-client`.
19
+
20
+ The gem name will also change. In the 5.5.6 release, it is still `ldclient-rb`; in all future releases, it will be `launchdarkly-server-sdk`. No further updates to the `ldclient-rb` gem will be published after this release.
21
+
22
+
23
+ ## [5.5.5] - 2019-03-28
24
+ ### Fixed:
25
+ - Setting user attributes to non-string values when a string was expected would cause analytics events not to be processed. Also, in the case of the `secondary` attribute, this could cause evaluations to fail for a flag with a percentage rollout. The SDK will now convert attribute values to strings as needed. ([#131](https://github.com/launchdarkly/ruby-server-sdk/issues/131))
26
+
27
+ ## [5.5.4] - 2019-03-29
28
+ ### Fixed:
29
+ - Fixed a missing `require` that could sometimes cause a `NameError` to be thrown when starting the client, depending on what other gems were installed. This bug was introduced in version 5.5.3. ([#129](https://github.com/launchdarkly/ruby-server-sdk/issues/129))
30
+ - When an analytics event was generated for a feature flag because it is a prerequisite for another flag that was evaluated, the user data was being omitted from the event. ([#128](https://github.com/launchdarkly/ruby-server-sdk/issues/128))
31
+ - If `track` or `identify` is called without a user, the SDK now logs a warning, and does not send an analytics event to LaunchDarkly (since it would not be processed without a user).
32
+ - Added a link from the SDK readme to the guide regarding the client initialization.
33
+
34
+ ## [5.5.3] - 2019-02-13
35
+ ### Changed:
36
+ - The SDK previously used the `faraday` and `net-http-persistent` gems for all HTTP requests other than streaming connections. Since `faraday` lacks a stable version and has a known issue with character encoding, and `net-http-persistent` is no longer maintained, these have both been removed. This should not affect any SDK functionality.
37
+
38
+ ### Fixed:
39
+ - The SDK was not usable in Windows because of `net-http-persistent`. That gem has been removed.
40
+ - When running in Windows, the event-processing thread threw a `RangeError` due to a difference in the Windows implementation of `concurrent-ruby`. This has been fixed.
41
+ - Windows incompatibilities were undetected before because we were not running a Windows CI job. We are now testing on Windows with Ruby 2.5.
42
+
43
+ ## [5.5.2] - 2019-01-18
44
+ ### Fixed:
45
+ - Like 5.5.1, this release contains only documentation fixes. Implementation classes that are not part of the supported API are now hidden from the [generated documentation](https://www.rubydoc.info/gems/ldclient-rb).
46
+
47
+
48
+ ## [5.5.1] - 2019-01-17
49
+ ### Fixed:
50
+ - Fixed several documentation comments that had the wrong parameter names. There are no other changes in this release; it's only to correct the documentation.
51
+
52
+ ## [5.5.0] - 2019-01-17
53
+ ### Added:
54
+ - It is now possible to use Consul or DynamoDB as a persistent feature store, similar to the existing Redis integration. See the `LaunchDarkly::Integrations::Consul` and `LaunchDarkly::Integrations::DynamoDB` modules, and the reference guide [Using a persistent feature store](https://docs.launchdarkly.com/v2.0/docs/using-a-persistent-feature-store).
55
+ - There is now a `LaunchDarkly::Integrations::Redis` module, which is the preferred method for creating a Redis feature store.
56
+ - All of the database feature stores now support local caching not only for individual feature flag queries, but also for `all_flags_state`.
57
+ - The `Config` property `data_source` is the new name for `update_processor` and `update_processor_factory`.
58
+
59
+ ### Changed:
60
+ - The implementation of the SSE protocol for streaming has been moved into a separate gem, [`ld-eventsource`](https://github.com/launchdarkly/ruby-eventsource). This has no effect on streaming functionality.
61
+
62
+ ### Fixed:
63
+ - Added or corrected a large number of documentation comments. All API classes and methods are now documented, and internal implementation details have been hidden from the documentation. You can view the latest documentation on [RubyDoc](https://www.rubydoc.info/gems/ldclient-rb).
64
+ - Fixed a problem in the Redis feature store that would only happen under unlikely circumstances: trying to evaluate a flag when the LaunchDarkly client had not yet been fully initialized and the store did not yet have data in it, and then trying again when the client was still not ready but the store _did_ have data (presumably put there by another process). Previously, the second attempt would fail.
65
+ - In polling mode, the SDK did not correctly handle non-ASCII Unicode characters in feature flag data. ([#90](https://github.com/launchdarkly/ruby-server-sdk/issues/90))
66
+
67
+ ### Deprecated:
68
+ - `RedisFeatureStore.new`. This implementation class may be changed or moved in the future; use `LaunchDarkly::Integrations::Redis::new_feature_store`.
69
+ - `Config.update_processor` and `Config.update_processor_factory`; use `Config.data_source`.
70
+
71
+ ## [5.4.3] - 2019-01-11
72
+ ### Changed:
73
+ - The SDK is now compatible with `net-http-persistent` 3.x. (Thanks, [CodingAnarchy](https://github.com/launchdarkly/ruby-server-sdk/pull/113)!)
74
+
75
+ ## [5.4.2] - 2019-01-04
76
+ ### Fixed:
77
+ - Fixed overly specific dependency versions of `concurrent-ruby` and `semantic`. ([#115](https://github.com/launchdarkly/ruby-server-sdk/issues/115))
78
+ - Removed obsolete dependencies on `hashdiff` and `thread_safe`.
79
+
80
+ ## [5.4.1] - 2018-11-05
81
+ ### Fixed:
82
+ - Fixed a `LoadError` in `file_data_source.rb`, which was added in 5.4.0. (Thanks, [kbarrette](https://github.com/launchdarkly/ruby-server-sdk/pull/110)!)
83
+
84
+
85
+ ## [5.4.0] - 2018-11-02
86
+ ### Added:
87
+ - It is now possible to inject feature flags into the client from local JSON or YAML files, replacing the normal LaunchDarkly connection. This would typically be for testing purposes. See `file_data_source.rb`.
88
+
89
+ ### Fixed:
90
+ - When shutting down an `LDClient`, if in polling mode, the client was using `Thread.raise` to make the polling thread stop sleeping. `Thread.raise` can cause unpredictable behavior in a worker thread, so it is no longer used.
91
+
92
+ ## [5.3.0] - 2018-10-24
93
+ ### Added:
94
+ - The `all_flags_state` method now accepts a new option, `details_only_for_tracked_flags`, which reduces the size of the JSON representation of the flag state by omitting some metadata. Specifically, it omits any data that is normally used for generating detailed evaluation events if a flag does not have event tracking or debugging turned on.
95
+
96
+ ### Fixed:
97
+ - JSON data from `all_flags_state` is now slightly smaller even if you do not use the new option described above, because it omits the flag property for event tracking unless that property is true.
98
+
99
+ ## [5.2.0] - 2018-08-29
100
+ ### Added:
101
+ - The new `LDClient` method `variation_detail` allows you to evaluate a feature flag (using the same parameters as you would for `variation`) and receive more information about how the value was calculated. This information is returned in an `EvaluationDetail` object, which contains both the result value and a "reason" object which will tell you, for instance, if the user was individually targeted for the flag or was matched by one of the flag's rules, or if the flag returned the default value due to an error.
102
+
103
+ ### Fixed:
104
+ - Evaluating a prerequisite feature flag did not produce an analytics event if the prerequisite flag was off.
105
+
106
+
107
+ ## [5.1.0] - 2018-08-27
108
+ ### Added:
109
+ - The new `LDClient` method `all_flags_state()` should be used instead of `all_flags()` if you are passing flag data to the front end for use with the JavaScript SDK. It preserves some flag metadata that the front end requires in order to send analytics events correctly. Versions 2.5.0 and above of the JavaScript SDK are able to use this metadata, but the output of `all_flags_state()` will still work with older versions.
110
+ - The `all_flags_state()` method also allows you to select only client-side-enabled flags to pass to the front end, by using the option `client_side_only: true`.
111
+
112
+ ### Changed:
113
+ - Unexpected exceptions are now logged at `ERROR` level, and exception stacktraces at `DEBUG` level. Previously, both were being logged at `WARN` level.
114
+
115
+ ### Deprecated:
116
+ - `LDClient.all_flags()`
117
+
118
+
119
+ ## [5.0.1] - 2018-07-02
120
+ ### Fixed:
121
+ Fixed a regression in version 5.0.0 that could prevent the client from reconnecting if the stream connection was dropped by the server.
122
+
123
+
124
+ ## [5.0.0] - 2018-06-26
125
+ ### Changed:
126
+ - The client no longer uses Celluloid for streaming I/O. Instead, it uses [socketry](https://github.com/socketry/socketry).
127
+ - The client now treats most HTTP 4xx errors as unrecoverable: that is, after receiving such an error, it will not make any more HTTP requests for the lifetime of the client instance, in effect taking the client offline. This is because such errors indicate either a configuration problem (invalid SDK key) or a bug, which is not likely to resolve without a restart or an upgrade. This does not apply if the error is 400, 408, 429, or any 5xx error.
128
+ - During initialization, if the client receives any of the unrecoverable errors described above, the client constructor will return immediately; previously it would continue waiting until a timeout. The `initialized?` method will return false in this case.
129
+
130
+ ### Removed:
131
+ - The SDK no longer supports Ruby versions below 2.2.6, or JRuby below 9.1.16.
132
+
133
+ ## [4.0.0] - 2018-05-10
134
+
135
+ ### Changed:
136
+ - To reduce the network bandwidth used for analytics events, feature request events are now sent as counters rather than individual events, and user details are now sent only at intervals rather than in each event. These behaviors can be modified through the LaunchDarkly UI and with the new configuration option `inline_users_in_events`. For more details, see [Analytics Data Stream Reference](https://docs.launchdarkly.com/v2.0/docs/analytics-data-stream-reference).
137
+
138
+ ### Removed:
139
+ - JRuby 1.7 is no longer supported.
140
+ - Greatly reduced the number of indirect gem dependencies by removing `moneta`, which was previously a requirement for the Redis feature store.
141
+
142
+
143
+ ## [3.0.3] - 2018-03-23
144
+ ## Fixed
145
+ - In the Redis feature store, fixed a synchronization problem that could cause a feature flag update to be missed if several of them happened in rapid succession.
146
+
147
+ ## [3.0.2] - 2018-03-06
148
+ ## Fixed
149
+ - Improved efficiency of logging by not constructing messages that won't be visible at the current log level. (Thanks, [julik](https://github.com/launchdarkly/ruby-server-sdk/pull/98)!)
150
+
151
+
152
+ ## [3.0.1] - 2018-02-26
153
+ ### Fixed
154
+ - Fixed a bug that could prevent very large feature flags from being updated in streaming mode.
155
+
156
+
157
+ ## [3.0.0] - 2018-02-22
158
+ ### Added
159
+ - Support for a new LaunchDarkly feature: reusable user segments.
160
+
161
+ ### Changed
162
+ - The feature store interface has been changed to support user segment data as well as feature flags. Existing code that uses `InMemoryFeatureStore` or `RedisFeatureStore` should work as before, but custom feature store implementations will need to be updated.
163
+
164
+
165
+ ## [2.5.0] - 2018-02-12
166
+
167
+ ## Added
168
+ - Adds support for a future LaunchDarkly feature, coming soon: semantic version user attributes.
169
+
170
+ ## Changed
171
+ - It is now possible to compute rollouts based on an integer attribute of a user, not just a string attribute.
172
+
173
+ ## [2.4.1] - 2018-01-23
174
+ ## Changed
175
+ - Reduce logging level for missing flags
176
+ - Relax json and faraday dependencies
177
+ ## Fixed
178
+ - Wrap redis bulk updates in a transaction
179
+ - Fixed documentation links
180
+
181
+ ## [2.4.0] - 2018-01-12
182
+ ## Changed
183
+ - Will use feature store if already initialized even if connection to service could not be established. This is useful when flags have been initialized in redis.
184
+ - Increase default and minimum polling interval to 30s
185
+ - Strip out unknown top-level attributes
186
+
187
+ ## [2.3.2] - 2017-12-02
188
+
189
+ ### Fixed
190
+ - Make sure redis store initializations are atomic
191
+
192
+
193
+ ## [2.3.1] - 2017-11-16
194
+
195
+ ### Changed
196
+ - Include source code for changes described in 2.3.0
197
+
198
+
199
+ ## [2.3.0] - 2017-11-16
200
+ ## Added
201
+ - Add `close` method to Ruby client to stop processing events
202
+ - Add support for Redis feature store
203
+ - Add support for LDD mode
204
+ - Allow user to disable outgoing event stream.
205
+
206
+ ## Changed
207
+ - Stop retrying on 401 responses (due to bad sdk keys)
208
+
209
+ ## [2.2.7] - 2017-07-26
210
+ ## Changed
211
+ - Update Readme to fix instructions on installing gem using command line
212
+ - Cleaned up formatting on various files (Rubocop)
213
+ ## [2.2.5] - 2017-05-08
214
+ ## Changed
215
+ - Added proxy support to streaming and http connections. Respects `HTTP_PROXY` and `http_proxy` environment variables as well as the `:proxy => protocol://user:pass@host` configuration parameter.
216
+
217
+ ## [2.1.5] - 2017-03-28
218
+ ## Changed
219
+ - Updated changelog
220
+
221
+ ## [2.1.1] - 2017-03-28
222
+ ## Changed
223
+ - Bumped nio4r to 2.0
224
+
225
+ ## [2.0.6] - 2017-02-10
226
+ ## Changed
227
+ - Improved handling of http status codes that may not be integers.
228
+
229
+ ## [2.0.5] - 2017-01-31
230
+ ## Changed
231
+ - Improved error handling when connected to flag update stream.
232
+
233
+ ## [2.0.3] - 2016-10-21
234
+ ## Fixed
235
+ - Indirect stream events are now correctly processed
236
+
237
+ ## [2.0.2] - 2016-08-08
238
+ ## Changed
239
+ - The default logger now logs at `info` level
240
+
241
+ ## [2.0.0] - 2016-08-08
242
+ ### Added
243
+ - Support for multivariate feature flags. In addition to booleans, feature flags can now return numbers, strings, dictionaries, or arrays via the `variation` method.
244
+ - New `all_flags` method returns all flag values for a specified user.
245
+ - If streaming is disabled, the client polls for feature flag changes. If streaming is disabled, the client will default to polling LaunchDarkly every second for updates. The poll interval is configurable via `poll_interval`.
246
+ - New `secure_mode_hash` function computes a hash suitable for the new LaunchDarkly JavaScript client's secure mode feature.
247
+ - Support for extremely large feature flags. When a large feature flag changes, the stream will include a directive to fetch the updated flag.
248
+
249
+ ### Changed
250
+ - You can now initialize the LaunchDarkly client with an optional timeout (specified in seconds). This will block initialization until the client has finished bootstrapping and is able to serve feature flags.
251
+ - The streaming implementation (`StreamProcessor`) uses [Celluloid](https://github.com/celluloid/celluloid) under the hood instead of [EventMachine](https://github.com/eventmachine/eventmachine). The dependency on EventMachine has been removed.
252
+ - The `store` option has been renamed to `cache_store`.
253
+ - Offline mode can no longer be set dynamically. Instead, at configuration time, the `offline` parameter can be set to put the client in offline mode. It is no longer possible to dynamically change whether the client is online and offline (via `set_online` and `set_offline`). Call `offline?` to determine whether or not the client is offline.
254
+ - The `debug_stream` configuration option has been removed.
255
+ - The `log_timings` configuration option has been removed.
256
+
257
+ ### Deprecated
258
+ - The `toggle` call has been deprecated in favor of `variation`.
259
+
260
+ ### Removed
261
+ - `update_user_flag_setting` has been removed. To change user settings, use the LaunchDarkly REST API.
data/CODEOWNERS ADDED
@@ -0,0 +1 @@
1
+
data/CONTRIBUTING.md ADDED
@@ -0,0 +1,37 @@
1
+ Contributing to the LaunchDarkly Server-side SDK for Ruby
2
+ ================================================
3
+
4
+ LaunchDarkly has published an [SDK contributor's guide](https://docs.launchdarkly.com/docs/sdk-contributors-guide) that provides a detailed explanation of how our SDKs work. See below for additional information on how to contribute to this SDK.
5
+
6
+ Submitting bug reports and feature requests
7
+ ------------------
8
+
9
+ The LaunchDarkly SDK team monitors the [issue tracker](https://github.com/launchdarkly/ruby-server-sdk/issues) in the SDK repository. Bug reports and feature requests specific to this SDK should be filed in this issue tracker. The SDK team will respond to all newly filed issues within two business days.
10
+
11
+ Submitting pull requests
12
+ ------------------
13
+
14
+ We encourage pull requests and other contributions from the community. Before submitting pull requests, ensure that all temporary or unintended code is removed. Don't worry about adding reviewers to the pull request; the LaunchDarkly SDK team will add themselves. The SDK team will acknowledge all pull requests within two business days.
15
+
16
+ Build instructions
17
+ ------------------
18
+
19
+ ### Prerequisites
20
+
21
+ This SDK is built with [Bundler](https://bundler.io/). To install Bundler, run `gem install bundler -v 1.17.3`. You might need `sudo` to execute the command successfully. As of this writing, the SDK does not support being built with Bundler 2.0.
22
+
23
+ To install the runtime dependencies:
24
+
25
+ ```
26
+ bundle install
27
+ ```
28
+
29
+ ### Testing
30
+
31
+ To run all unit tests:
32
+
33
+ ```
34
+ bundle exec rspec spec
35
+ ```
36
+
37
+ By default, the full unit test suite includes live tests of the integrations for Consul, DynamoDB, and Redis. Those tests expect you to have instances of all of those databases running locally. To skip them, set the environment variable `LD_SKIP_DATABASE_TESTS=1` before running the tests.
data/Gemfile ADDED
@@ -0,0 +1,3 @@
1
+ source "https://rubygems.org"
2
+
3
+ gemspec
data/Gemfile.lock ADDED
@@ -0,0 +1,102 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ launchdarkly-server-sdk (5.5.6)
5
+ concurrent-ruby (~> 1.0)
6
+ json (>= 1.8, < 3)
7
+ ld-eventsource (~> 1.0)
8
+ semantic (~> 1.6)
9
+
10
+ GEM
11
+ remote: https://rubygems.org/
12
+ specs:
13
+ aws-eventstream (1.0.1)
14
+ aws-partitions (1.128.0)
15
+ aws-sdk-core (3.44.2)
16
+ aws-eventstream (~> 1.0)
17
+ aws-partitions (~> 1.0)
18
+ aws-sigv4 (~> 1.0)
19
+ jmespath (~> 1.0)
20
+ aws-sdk-dynamodb (1.19.0)
21
+ aws-sdk-core (~> 3, >= 3.39.0)
22
+ aws-sigv4 (~> 1.0)
23
+ aws-sigv4 (1.0.3)
24
+ codeclimate-test-reporter (0.6.0)
25
+ simplecov (>= 0.7.1, < 1.0.0)
26
+ concurrent-ruby (1.1.5)
27
+ connection_pool (2.2.1)
28
+ diff-lcs (1.3)
29
+ diplomat (2.0.2)
30
+ faraday (~> 0.9)
31
+ json
32
+ docile (1.1.5)
33
+ faraday (0.15.4)
34
+ multipart-post (>= 1.2, < 3)
35
+ ffi (1.9.25)
36
+ ffi (1.9.25-java)
37
+ hitimes (1.3.1)
38
+ hitimes (1.3.1-java)
39
+ http_tools (0.4.5)
40
+ jmespath (1.4.0)
41
+ json (1.8.6)
42
+ json (1.8.6-java)
43
+ ld-eventsource (1.0.0)
44
+ concurrent-ruby (~> 1.0)
45
+ http_tools (~> 0.4.5)
46
+ socketry (~> 0.5.1)
47
+ listen (3.1.5)
48
+ rb-fsevent (~> 0.9, >= 0.9.4)
49
+ rb-inotify (~> 0.9, >= 0.9.7)
50
+ ruby_dep (~> 1.2)
51
+ multipart-post (2.0.0)
52
+ rake (10.5.0)
53
+ rb-fsevent (0.10.3)
54
+ rb-inotify (0.9.10)
55
+ ffi (>= 0.5.0, < 2)
56
+ redis (3.3.5)
57
+ rspec (3.7.0)
58
+ rspec-core (~> 3.7.0)
59
+ rspec-expectations (~> 3.7.0)
60
+ rspec-mocks (~> 3.7.0)
61
+ rspec-core (3.7.1)
62
+ rspec-support (~> 3.7.0)
63
+ rspec-expectations (3.7.0)
64
+ diff-lcs (>= 1.2.0, < 2.0)
65
+ rspec-support (~> 3.7.0)
66
+ rspec-mocks (3.7.0)
67
+ diff-lcs (>= 1.2.0, < 2.0)
68
+ rspec-support (~> 3.7.0)
69
+ rspec-support (3.7.0)
70
+ rspec_junit_formatter (0.3.0)
71
+ rspec-core (>= 2, < 4, != 2.12.0)
72
+ ruby_dep (1.5.0)
73
+ semantic (1.6.1)
74
+ simplecov (0.15.1)
75
+ docile (~> 1.1.0)
76
+ json (>= 1.8, < 3)
77
+ simplecov-html (~> 0.10.0)
78
+ simplecov-html (0.10.2)
79
+ socketry (0.5.1)
80
+ hitimes (~> 1.2)
81
+ timecop (0.9.1)
82
+
83
+ PLATFORMS
84
+ java
85
+ ruby
86
+
87
+ DEPENDENCIES
88
+ aws-sdk-dynamodb (~> 1.18)
89
+ bundler (~> 1.7)
90
+ codeclimate-test-reporter (~> 0)
91
+ connection_pool (>= 2.1.2)
92
+ diplomat (>= 2.0.2)
93
+ launchdarkly-server-sdk!
94
+ listen (~> 3.0)
95
+ rake (~> 10.0)
96
+ redis (~> 3.3.5)
97
+ rspec (~> 3.2)
98
+ rspec_junit_formatter (~> 0.3.0)
99
+ timecop (~> 0.9.1)
100
+
101
+ BUNDLED WITH
102
+ 1.17.3
data/LICENSE.txt ADDED
@@ -0,0 +1,13 @@
1
+ Copyright 2014 Catamorphic, Co.
2
+
3
+ Licensed under the Apache License, Version 2.0 (the "License");
4
+ you may not use this file except in compliance with the License.
5
+ You may obtain a copy of the License at
6
+
7
+ http://www.apache.org/licenses/LICENSE-2.0
8
+
9
+ Unless required by applicable law or agreed to in writing, software
10
+ distributed under the License is distributed on an "AS IS" BASIS,
11
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ See the License for the specific language governing permissions and
13
+ limitations under the License.
data/README.md ADDED
@@ -0,0 +1,56 @@
1
+ LaunchDarkly Server-side SDK for Ruby
2
+ ===========================
3
+
4
+ [![Gem Version](https://badge.fury.io/rb/launchdarkly-server-sdk.svg)](http://badge.fury.io/rb/launchdarkly-server-sdk)
5
+
6
+ [![Circle CI](https://circleci.com/gh/launchdarkly/ruby-server-sdk/tree/master.svg?style=svg)](https://circleci.com/gh/launchdarkly/ruby-server-sdk/tree/master)
7
+ [![Security](https://hakiri.io/github/launchdarkly/ruby-server-sdk/master.svg)](https://hakiri.io/github/launchdarkly/ruby-server-sdk/master)
8
+
9
+ LaunchDarkly overview
10
+ -------------------------
11
+ [LaunchDarkly](https://www.launchdarkly.com) is a feature management platform that serves over 100 billion feature flags daily to help teams build better software, faster. [Get started](https://docs.launchdarkly.com/docs/getting-started) using LaunchDarkly today!
12
+
13
+ [![Twitter Follow](https://img.shields.io/twitter/follow/launchdarkly.svg?style=social&label=Follow&maxAge=2592000)](https://twitter.com/intent/follow?screen_name=launchdarkly)
14
+
15
+ Supported Ruby versions
16
+ -----------------------
17
+
18
+ This version of the LaunchDarkly SDK has a minimum Ruby version of 2.2.6, or 9.1.6 for JRuby.
19
+
20
+ Getting started
21
+ -----------
22
+
23
+ Refer to the [SDK documentation](https://docs.launchdarkly.com/docs/ruby-sdk-reference#section-getting-started) for instructions on getting started with using the SDK.
24
+
25
+ Learn more
26
+ -----------
27
+
28
+ Check out our [documentation](http://docs.launchdarkly.com) for in-depth instructions on configuring and using LaunchDarkly. You can also head straight to the [reference guide for this SDK](http://docs.launchdarkly.com/docs/ruby-sdk-reference).
29
+
30
+ Generated API documentation is on [RubyDoc.info](https://www.rubydoc.info/gems/launchdarkly-server-sdk).
31
+
32
+ Testing
33
+ -------
34
+
35
+ We run integration tests for all our SDKs using a centralized test harness. This approach gives us the ability to test for consistency across SDKs, as well as test networking behavior in a long-running application. These tests cover each method in the SDK, and verify that event sending, flag evaluation, stream reconnection, and other aspects of the SDK all behave correctly.
36
+
37
+ Contributing
38
+ ------------
39
+
40
+ We encourage pull requests and other contributions from the community. Check out our [contributing guidelines](CONTRIBUTING.md) for instructions on how to contribute to this SDK.
41
+
42
+ About LaunchDarkly
43
+ -----------
44
+
45
+ * LaunchDarkly is a continuous delivery platform that provides feature flags as a service and allows developers to iterate quickly and safely. We allow you to easily flag your features and manage them from the LaunchDarkly dashboard. With LaunchDarkly, you can:
46
+ * Roll out a new feature to a subset of your users (like a group of users who opt-in to a beta tester group), gathering feedback and bug reports from real-world use cases.
47
+ * Gradually roll out a feature to an increasing percentage of users, and track the effect that the feature has on key metrics (for instance, how likely is a user to complete a purchase if they have feature A versus feature B?).
48
+ * Turn off a feature that you realize is causing performance problems in production, without needing to re-deploy, or even restart the application with a changed configuration file.
49
+ * Grant access to certain features based on user attributes, like payment plan (eg: users on the ‘gold’ plan get access to more features than users in the ‘silver’ plan). Disable parts of your application to facilitate maintenance, without taking everything offline.
50
+ * LaunchDarkly provides feature flag SDKs for a wide variety of languages and technologies. Check out [our documentation](https://docs.launchdarkly.com/docs) for a complete list.
51
+ * Explore LaunchDarkly
52
+ * [launchdarkly.com](https://www.launchdarkly.com/ "LaunchDarkly Main Website") for more information
53
+ * [docs.launchdarkly.com](https://docs.launchdarkly.com/ "LaunchDarkly Documentation") for our documentation and SDK reference guides
54
+ * [apidocs.launchdarkly.com](https://apidocs.launchdarkly.com/ "LaunchDarkly API Documentation") for our API documentation
55
+ * [blog.launchdarkly.com](https://blog.launchdarkly.com/ "LaunchDarkly Blog Documentation") for the latest product updates
56
+ * [Feature Flagging Guide](https://github.com/launchdarkly/featureflags/ "Feature Flagging Guide") for best practices and strategies