Skip to content

Commit 0b002d8

Browse files
authored
prepare 5.5.6 release (#133)
1 parent c27731b commit 0b002d8

File tree

10 files changed

+86
-161
lines changed

10 files changed

+86
-161
lines changed

.circleci/config.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ workflows:
99
- test-2.3
1010
- test-2.4
1111
- test-2.5
12+
- test-2.6
1213
- test-jruby-9.2
1314

1415
ruby-docker-template: &ruby-docker-template
@@ -57,6 +58,13 @@ jobs:
5758
- image: consul
5859
- image: redis
5960
- image: amazon/dynamodb-local
61+
test-2.6:
62+
<<: *ruby-docker-template
63+
docker:
64+
- image: circleci/ruby:2.6.2-stretch
65+
- image: consul
66+
- image: redis
67+
- image: amazon/dynamodb-local
6068
test-jruby-9.2:
6169
<<: *ruby-docker-template
6270
docker:

CHANGELOG.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ All notable changes to the LaunchDarkly Ruby SDK will be documented in this file
44

55
## [5.5.5] - 2019-03-28
66
### Fixed:
7-
- 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-client/issues/131))
7+
- 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))
88

99
## [5.5.4] - 2019-03-29
1010
### Fixed:
11-
- 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-client/issues/129))
12-
- 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-client/issues/128))
11+
- 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))
12+
- 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))
1313
- 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).
1414
- Added a link from the SDK readme to the guide regarding the client initialization.
1515

@@ -44,24 +44,24 @@ All notable changes to the LaunchDarkly Ruby SDK will be documented in this file
4444
### Fixed:
4545
- 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).
4646
- 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.
47-
- In polling mode, the SDK did not correctly handle non-ASCII Unicode characters in feature flag data. ([#90](https://github.com/launchdarkly/ruby-client/issues/90))
47+
- 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))
4848

4949
### Deprecated:
5050
- `RedisFeatureStore.new`. This implementation class may be changed or moved in the future; use `LaunchDarkly::Integrations::Redis::new_feature_store`.
5151
- `Config.update_processor` and `Config.update_processor_factory`; use `Config.data_source`.
5252

5353
## [5.4.3] - 2019-01-11
5454
### Changed:
55-
- The SDK is now compatible with `net-http-persistent` 3.x. (Thanks, [CodingAnarchy](https://github.com/launchdarkly/ruby-client/pull/113)!)
55+
- The SDK is now compatible with `net-http-persistent` 3.x. (Thanks, [CodingAnarchy](https://github.com/launchdarkly/ruby-server-sdk/pull/113)!)
5656

5757
## [5.4.2] - 2019-01-04
5858
### Fixed:
59-
- Fixed overly specific dependency versions of `concurrent-ruby` and `semantic`. ([#115](https://github.com/launchdarkly/ruby-client/issues/115))
59+
- Fixed overly specific dependency versions of `concurrent-ruby` and `semantic`. ([#115](https://github.com/launchdarkly/ruby-server-sdk/issues/115))
6060
- Removed obsolete dependencies on `hashdiff` and `thread_safe`.
6161

6262
## [5.4.1] - 2018-11-05
6363
### Fixed:
64-
- Fixed a `LoadError` in `file_data_source.rb`, which was added in 5.4.0. (Thanks, [kbarrette](https://github.com/launchdarkly/ruby-client/pull/110)!)
64+
- 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)!)
6565

6666

6767
## [5.4.0] - 2018-11-02
@@ -128,7 +128,7 @@ Fixed a regression in version 5.0.0 that could prevent the client from reconnect
128128

129129
## [3.0.2] - 2018-03-06
130130
## Fixed
131-
- 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-client/pull/98)!)
131+
- 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)!)
132132

133133

134134
## [3.0.1] - 2018-02-26

CONTRIBUTING.md

Lines changed: 36 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,37 @@
1-
Contributing to LaunchDarkly SDK for Ruby
2-
=========================================
1+
Contributing to the LaunchDarkly Server-side SDK for Ruby
2+
================================================
33

4-
We encourage pull-requests and other contributions from the community. We've also published an [SDK contributor's guide](http://docs.launchdarkly.com/docs/sdk-contributors-guide) that provides a detailed explanation of how our SDKs work.
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.

Gemfile.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
PATH
22
remote: .
33
specs:
4-
ldclient-rb (5.5.2)
4+
ldclient-rb (5.5.5)
55
concurrent-ruby (~> 1.0)
66
json (>= 1.8, < 3)
77
ld-eventsource (~> 1.0)
@@ -23,7 +23,7 @@ GEM
2323
aws-sigv4 (1.0.3)
2424
codeclimate-test-reporter (0.6.0)
2525
simplecov (>= 0.7.1, < 1.0.0)
26-
concurrent-ruby (1.1.4)
26+
concurrent-ruby (1.1.5)
2727
connection_pool (2.2.1)
2828
diff-lcs (1.3)
2929
diplomat (2.0.2)

README.md

Lines changed: 24 additions & 144 deletions
Original file line numberDiff line numberDiff line change
@@ -1,135 +1,26 @@
1-
LaunchDarkly SDK for Ruby
1+
LaunchDarkly Server-side SDK for Ruby
22
===========================
33

44
[![Gem Version](https://badge.fury.io/rb/ldclient-rb.svg)](http://badge.fury.io/rb/ldclient-rb)
55

6-
[![Circle CI](https://circleci.com/gh/launchdarkly/ruby-client/tree/master.svg?style=svg)](https://circleci.com/gh/launchdarkly/ruby-client/tree/master)
7-
[![Test Coverage](https://codeclimate.com/github/launchdarkly/ruby-client/badges/coverage.svg)](https://codeclimate.com/github/launchdarkly/ruby-client/coverage)
8-
[![security](https://hakiri.io/github/launchdarkly/ruby-client/master.svg)](https://hakiri.io/github/launchdarkly/ruby-client/master)
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)
914

1015
Supported Ruby versions
1116
-----------------------
1217

1318
This version of the LaunchDarkly SDK has a minimum Ruby version of 2.2.6, or 9.1.6 for JRuby.
1419

15-
Quick setup
20+
Getting started
1621
-----------
1722

18-
1. Install the Ruby SDK with `gem`
19-
20-
```shell
21-
gem install ldclient-rb
22-
```
23-
24-
2. Require the LaunchDarkly client:
25-
26-
```ruby
27-
require 'ldclient-rb'
28-
```
29-
30-
3. Create a new LDClient with your SDK key:
31-
32-
```ruby
33-
client = LaunchDarkly::LDClient.new("your_sdk_key")
34-
```
35-
36-
*NOTE: Please refer to [our documentation](https://docs.launchdarkly.com/docs/ruby-sdk-reference#section-initializing-ldclient-using-spring-unicorn-or-puma) for additional instructions on how to use LaunchDarkly with [Spring](https://github.com/rails/spring), [Unicorn](https://bogomips.org/unicorn/), or [Puma](https://github.com/puma/puma).*
37-
38-
### Ruby on Rails
39-
40-
1. Add `gem 'ldclient-rb'` to your Gemfile and `bundle install`
41-
42-
2. Initialize the launchdarkly client in `config/initializers/launchdarkly.rb`:
43-
44-
```ruby
45-
Rails.configuration.ld_client = LaunchDarkly::LDClient.new("your_sdk_key")
46-
```
47-
48-
3. You may want to include a function in your ApplicationController
49-
50-
```ruby
51-
def launchdarkly_settings
52-
if current_user.present?
53-
{
54-
key: current_user.id,
55-
anonymous: false,
56-
email: current_user.email,
57-
custom: { groups: current_user.groups.pluck(:name) },
58-
# Any other fields you may have
59-
# e.g. lastName: current_user.last_name,
60-
}
61-
else
62-
if Rails::VERSION::MAJOR <= 3
63-
hash_key = request.session_options[:id]
64-
else
65-
hash_key = session.id
66-
end
67-
# session ids should be private to prevent session hijacking
68-
hash_key = Digest::SHA256.base64digest hash_key
69-
{
70-
key: hash_key,
71-
anonymous: true,
72-
}
73-
end
74-
end
75-
```
76-
77-
4. In your controllers, access the client using
78-
79-
```ruby
80-
Rails.application.config.ld_client.variation('your.flag.key', launchdarkly_settings, false)
81-
```
82-
83-
Note that this gem will automatically switch to using the Rails logger it is detected.
84-
85-
86-
Your first feature flag
87-
-----------------------
88-
89-
1. Create a new feature flag on your [dashboard](https://app.launchdarkly.com).
90-
2. In your application code, use the feature's key to check whether the flag is on for each user:
91-
92-
```ruby
93-
if client.variation("your.flag.key", {key: "[email protected]"}, false)
94-
# application code to show the feature
95-
else
96-
# the code to run if the feature is off
97-
end
98-
```
99-
100-
HTTPS proxy
101-
-----------
102-
103-
The Ruby SDK uses Faraday and Socketry to handle its network traffic. Both of these provide built-in support for the use of an HTTPS proxy. If the HTTPS_PROXY environment variable is present then the SDK will proxy all network requests through the URL provided. (HTTP_PROXY is not used because all LaunchDarkly services require HTTPS.)
104-
105-
How to set the HTTPS_PROXY environment variable on Mac/Linux systems:
106-
```
107-
export HTTPS_PROXY=https://web-proxy.domain.com:8080
108-
```
109-
110-
How to set the HTTPS_PROXY environment variable on Windows systems:
111-
```
112-
set HTTPS_PROXY=https://web-proxy.domain.com:8080
113-
```
114-
115-
If your proxy requires authentication then you can prefix the URN with your login information:
116-
```
117-
export HTTPS_PROXY=http://user:[email protected]:8080
118-
```
119-
or
120-
```
121-
set HTTPS_PROXY=http://user:[email protected]:8080
122-
```
123-
124-
Database integrations
125-
---------------------
126-
127-
Feature flag data can be kept in a persistent store using Redis, DynamoDB, or Consul. These adapters are implemented in the `LaunchDarkly::Integrations::Redis`, `LaunchDarkly::Integrations::DynamoDB`, and `LaunchDarkly::Integrations::Consul` modules; to use them, call the `new_feature_store` method in the module, and put the returned object in the `feature_store` property of your client configuration. See the [API documentation](https://www.rubydoc.info/gems/ldclient-rb/LaunchDarkly/Integrations) and the [SDK reference guide](https://docs.launchdarkly.com/v2.0/docs/using-a-persistent-feature-store) for more information.
128-
129-
Using flag data from a file
130-
---------------------------
131-
132-
For testing purposes, the SDK can be made to read feature flag state from a file or files instead of connecting to LaunchDarkly. See `LaunchDarkly::FileDataSource` or the [SDK reference guide](https://docs.launchdarkly.com/v2.0/docs/reading-flags-from-a-file) for more details.
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.
13324

13425
Learn more
13526
-----------
@@ -140,37 +31,26 @@ Generated API documentation is on [RubyDoc.info](https://www.rubydoc.info/gems/l
14031

14132
Testing
14233
-------
143-
34+
14435
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.
145-
36+
14637
Contributing
14738
------------
148-
149-
See [Contributing](https://github.com/launchdarkly/ruby-client/blob/master/CONTRIBUTING.md).
150-
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+
15142
About LaunchDarkly
152-
------------------
153-
43+
-----------
44+
15445
* 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:
15546
* 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.
15647
* 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?).
15748
* 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.
15849
* 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.
159-
* LaunchDarkly provides feature flag SDKs for
160-
* [Java](http://docs.launchdarkly.com/docs/java-sdk-reference "Java SDK")
161-
* [JavaScript](http://docs.launchdarkly.com/docs/js-sdk-reference "LaunchDarkly JavaScript SDK")
162-
* [PHP](http://docs.launchdarkly.com/docs/php-sdk-reference "LaunchDarkly PHP SDK")
163-
* [Python](http://docs.launchdarkly.com/docs/python-sdk-reference "LaunchDarkly Python SDK")
164-
* [Go](http://docs.launchdarkly.com/docs/go-sdk-reference "LaunchDarkly Go SDK")
165-
* [Node.JS](http://docs.launchdarkly.com/docs/node-sdk-reference "LaunchDarkly Node SDK")
166-
* [Electron](http://docs.launchdarkly.com/docs/electron-sdk-reference "LaunchDarkly Electron SDK")
167-
* [.NET](http://docs.launchdarkly.com/docs/dotnet-sdk-reference "LaunchDarkly .Net SDK")
168-
* [Ruby](http://docs.launchdarkly.com/docs/ruby-sdk-reference "LaunchDarkly Ruby SDK")
169-
* [iOS](http://docs.launchdarkly.com/docs/ios-sdk-reference "LaunchDarkly iOS SDK")
170-
* [Android](http://docs.launchdarkly.com/docs/android-sdk-reference "LaunchDarkly Android SDK")
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.
17151
* Explore LaunchDarkly
172-
* [launchdarkly.com](http://www.launchdarkly.com/ "LaunchDarkly Main Website") for more information
173-
* [docs.launchdarkly.com](http://docs.launchdarkly.com/ "LaunchDarkly Documentation") for our documentation and SDKs
174-
* [apidocs.launchdarkly.com](http://apidocs.launchdarkly.com/ "LaunchDarkly API Documentation") for our API documentation
175-
* [blog.launchdarkly.com](http://blog.launchdarkly.com/ "LaunchDarkly Blog Documentation") for the latest product updates
176-
* [Feature Flagging Guide](https://github.com/launchdarkly/featureflags/ "Feature Flagging Guide") for best practices and strategies
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

ldclient-rb.gemspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Gem::Specification.new do |spec|
1212
spec.email = ["[email protected]"]
1313
spec.summary = "LaunchDarkly SDK for Ruby"
1414
spec.description = "Official LaunchDarkly SDK for Ruby"
15-
spec.homepage = "https://github.com/launchdarkly/ruby-client"
15+
spec.homepage = "https://github.com/launchdarkly/ruby-server-sdk"
1616
spec.license = "Apache-2.0"
1717

1818
spec.files = `git ls-files -z`.split("\x0")

scripts/release.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
# When done you should commit and push the changes made.
1010

1111
set -uxe
12-
echo "Starting ruby-client release."
12+
echo "Starting ruby-server-sdk release."
1313

1414
VERSION=$1
1515

@@ -24,4 +24,4 @@ gem build ldclient-rb.gemspec
2424
# Publish Ruby Gem
2525
gem push ldclient-rb-${VERSION}.gem
2626

27-
echo "Done with ruby-client release"
27+
echo "Done with ruby-server-sdk release"

spec/integrations/consul_feature_store_spec.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ def clear_all_data
2828

2929

3030
describe "Consul feature store" do
31+
return if ENV['LD_SKIP_DATABASE_TESTS'] == '1'
3132

3233
# These tests will all fail if there isn't a local Consul instance running.
3334

spec/integrations/dynamodb_feature_store_spec.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,8 @@ def create_test_client
8989

9090

9191
describe "DynamoDB feature store" do
92-
92+
return if ENV['LD_SKIP_DATABASE_TESTS'] == '1'
93+
9394
# These tests will all fail if there isn't a local DynamoDB instance running.
9495

9596
create_table_if_necessary

0 commit comments

Comments
 (0)