Skip to content

prepare 5.5.6 release #133

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 190 commits into from
May 10, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
190 commits
Select commit Hold shift + click to select a range
f5092af
Remove @ashanbrown from codeowners
ashanbrown Jul 24, 2018
fd63b2b
log exception stacktraces at debug level
eli-darkly Aug 2, 2018
d4be186
re-add minimal unit test
eli-darkly Aug 2, 2018
d73d66c
log exceptions at error level
eli-darkly Aug 2, 2018
94c8485
Merge pull request #75 from launchdarkly/eb/ch19339/exception-logging
eli-darkly Aug 2, 2018
ca15234
add new version of all_flags that captures more metadata
eli-darkly Aug 17, 2018
ed19523
add tests for FeatureFlagsState
eli-darkly Aug 17, 2018
73f2d89
provide as_json method that returns a hash instead of just a string
eli-darkly Aug 20, 2018
ab896b1
state can be serialized with JSON.generate
eli-darkly Aug 21, 2018
00347c6
add $valid
eli-darkly Aug 21, 2018
bdac27e
add ability to filter for only client-side flags
eli-darkly Aug 21, 2018
748b59b
Merge pull request #76 from launchdarkly/eb/ch22308/all-flags-state
eli-darkly Aug 21, 2018
50b3aa5
Merge pull request #77 from launchdarkly/eb/ch12124/client-side-filter
eli-darkly Aug 21, 2018
cee4c18
implement evaluation with explanations
eli-darkly Aug 23, 2018
d2c2ab8
misc cleanup
eli-darkly Aug 23, 2018
64a00a1
misc cleanup, more error checking
eli-darkly Aug 23, 2018
46b642b
don't keep evaluating prerequisites if one fails
eli-darkly Aug 23, 2018
855c4e2
doc comment
eli-darkly Aug 23, 2018
a0f002f
rename variation to variation_index
eli-darkly Aug 23, 2018
4ec43db
comment
eli-darkly Aug 23, 2018
9622e01
more test coverage, convenience method
eli-darkly Aug 24, 2018
7a453b0
Merge branch 'master' of github.com:launchdarkly/ruby-client
eli-darkly Aug 27, 2018
88d217e
Merge branch 'master' of github.com:launchdarkly/ruby-client
eli-darkly Aug 27, 2018
084d9ea
fix event generation for a prerequisite that is off
eli-darkly Aug 29, 2018
02b5712
fix private
eli-darkly Aug 29, 2018
53e8408
Merge pull request #78 from launchdarkly/eb/ch19976/explanations
eli-darkly Aug 29, 2018
c78db15
Merge pull request #79 from launchdarkly/eb/ch22995/prereq-off
eli-darkly Aug 29, 2018
960bb89
Merge branch 'explanation'
eli-darkly Aug 30, 2018
39d6ad1
Merge branch 'master' of github.com:launchdarkly/ruby-client
eli-darkly Aug 30, 2018
8867638
add option to reduce front-end metadata for untracked flags
eli-darkly Oct 5, 2018
7ac39ba
Merge pull request #80 from launchdarkly/eb/ch24449/less-metadata
eli-darkly Oct 5, 2018
9ea43e0
fix logic for whether a flag is tracked in all_flags_state
eli-darkly Oct 8, 2018
cbbc2ea
Merge pull request #81 from launchdarkly/eb/ch24449/less-metadata-2
eli-darkly Oct 15, 2018
c79745a
merge from public after release
LaunchDarklyCI Oct 24, 2018
cce8e84
implement file data source
eli-darkly Oct 31, 2018
22ebded
add poll interval param, tolerate single file path string, add doc co…
eli-darkly Oct 31, 2018
b864390
make listen dependency optional
eli-darkly Oct 31, 2018
789b5a4
readme
eli-darkly Oct 31, 2018
31a62c5
fix key handling and client integration, add tests
eli-darkly Oct 31, 2018
778cb6d
debugging
eli-darkly Nov 1, 2018
20dbef2
debugging
eli-darkly Nov 1, 2018
f1c00b1
add fallback polling logic, fix tests
eli-darkly Nov 1, 2018
198b843
rm debugging
eli-darkly Nov 1, 2018
c5d1823
debugging
eli-darkly Nov 2, 2018
9baffe3
debugging
eli-darkly Nov 2, 2018
4d81215
debugging
eli-darkly Nov 2, 2018
30d0cd2
debugging
eli-darkly Nov 2, 2018
8cb2ed9
comment correction
eli-darkly Nov 2, 2018
a10f973
documentation
eli-darkly Nov 2, 2018
16cf9c0
always use YAML parser
eli-darkly Nov 2, 2018
27d954e
report internal error that shouldn't happen
eli-darkly Nov 2, 2018
fd308a9
add test for multiple files
eli-darkly Nov 2, 2018
1d016bf
fix duplicate key checking (string vs. symbol problem)
eli-darkly Nov 2, 2018
c3e66d3
Don't use 'listen' in JRuby 9.1
eli-darkly Nov 2, 2018
1a36fd8
rm debugging
eli-darkly Nov 2, 2018
78ba815
better error handling in poll thread
eli-darkly Nov 2, 2018
2d29388
Merge pull request #82 from launchdarkly/eb/ch25289/file-source
eli-darkly Nov 2, 2018
38f534f
don't use Thread.raise to stop PollingProcessor thread; add test for …
eli-darkly Nov 2, 2018
4966136
Merge pull request #83 from launchdarkly/eb/ch19334/no-thread-raise
eli-darkly Nov 3, 2018
af2c98c
merge from public after release
LaunchDarklyCI Nov 3, 2018
457e85b
Merge branch 'master' of github.com:launchdarkly/ruby-client
eli-darkly Nov 5, 2018
4ad6a9b
merge from public after release
LaunchDarklyCI Nov 5, 2018
5a875c8
test on most recent patch version of each Ruby minor version
eli-darkly Dec 10, 2018
cf7d900
factor common logic out of RedisFeatureStore, add integrations module
eli-darkly Dec 15, 2018
4d34bc4
fix method reference
eli-darkly Dec 15, 2018
19182ad
misc cleanup
eli-darkly Dec 15, 2018
5941638
comment
eli-darkly Dec 15, 2018
b4cf610
re-add test file
eli-darkly Dec 15, 2018
3f9ef3b
misc cleanup
eli-darkly Dec 15, 2018
fa831f9
misc cleanup
eli-darkly Dec 15, 2018
ea68da4
initial DynamoDB implementation
eli-darkly Dec 15, 2018
bde2274
fix exception name
eli-darkly Dec 15, 2018
4e49317
fix test setup
eli-darkly Dec 15, 2018
c71bbec
comments
eli-darkly Dec 15, 2018
cfe3b18
readme
eli-darkly Dec 15, 2018
69cf890
fix doc comment
eli-darkly Dec 15, 2018
321eb6e
greatly improve documentation comments
eli-darkly Dec 15, 2018
5975954
comment fixes
eli-darkly Dec 15, 2018
414af99
change name of "update processor" to "data source"
eli-darkly Dec 15, 2018
c62c49e
Merge pull request #85 from launchdarkly/eb/ch28328/feature-store-sup…
eli-darkly Dec 18, 2018
81dcbf1
Merge pull request #86 from launchdarkly/eb/ch28328/dynamodb
eli-darkly Dec 18, 2018
216a1e8
Merge pull request #87 from launchdarkly/eb/docs
eli-darkly Dec 18, 2018
0fc71a8
Merge pull request #88 from launchdarkly/eb/data-source
eli-darkly Dec 18, 2018
fdb0291
default dynamodb_opts to {}
eli-darkly Dec 21, 2018
65ee009
fix Unicode handling in polling requests
eli-darkly Dec 21, 2018
86820ea
initial Consul implementation
eli-darkly Jan 3, 2019
485a73d
use new SSE gem
eli-darkly Jan 3, 2019
8567439
numerous Ruby SDK documentation fixes
eli-darkly Jan 4, 2019
63c3680
fix bundler version
eli-darkly Jan 4, 2019
008331b
fix build
eli-darkly Jan 4, 2019
c09c166
make some dependencies less strict and remove some unused ones
eli-darkly Jan 4, 2019
a4ced95
not using thread_safe
eli-darkly Jan 4, 2019
806bb8e
add bundler version (still not sure why we need to)
eli-darkly Jan 4, 2019
9d446c8
don't need bundler version for all rubies
eli-darkly Jan 4, 2019
5516745
fix bundler version again
eli-darkly Jan 4, 2019
54add1d
try to fix bundler version again
eli-darkly Jan 4, 2019
3d4b080
yet another build fix
eli-darkly Jan 5, 2019
635adf4
commit lock file to get correct bundler
eli-darkly Jan 5, 2019
3b5b08e
update lockfile
eli-darkly Jan 5, 2019
97bb302
Merge pull request #91 from launchdarkly/eb/ch29193/dependencies
eli-darkly Jan 5, 2019
5f28ecd
merge from public after release
eli-darkly Jan 5, 2019
b346917
Merge branch '5.4.x'
eli-darkly Jan 5, 2019
6342423
Merge branch 'eb/ruby-patch-versions' into eb/ch29137/sse-gem
eli-darkly Jan 5, 2019
e7f5f55
Merge branch 'master' into eb/ch29137/sse-gem
eli-darkly Jan 5, 2019
8656f25
use ruby-eventsource
eli-darkly Jan 6, 2019
1ced67e
uninstall unwanted bundler upgrade in CI
eli-darkly Jan 6, 2019
e11bf4b
allow net-http-persistent 3.x
eli-darkly Jan 6, 2019
cb2193e
uninstall unwanted bundler upgrade in CI
eli-darkly Jan 6, 2019
4b1167a
Merge branch '5.4.x' into eb/net-http-version
eli-darkly Jan 6, 2019
3f4e432
rewrite requestor without Faraday - don't have proxy yet
eli-darkly Jan 7, 2019
b250437
reduce intermittent HTTP errors on stub server by not reusing ports
eli-darkly Jan 7, 2019
c874db3
Merge branch 'master' into eb/ch25288/utf-8
eli-darkly Jan 7, 2019
5b4b855
fix charset handling
eli-darkly Jan 7, 2019
7a7c273
add test for proxy support, remove obsolete property
eli-darkly Jan 7, 2019
1502e61
rm duplicate test code
eli-darkly Jan 7, 2019
4857842
change event sending to use Net::HTTP; completely remove Faraday
eli-darkly Jan 7, 2019
277a0ce
Merge branch 'master' into eb/ch22514/docs
eli-darkly Jan 7, 2019
d658715
implement dependency ordering for feature store data
eli-darkly Jan 9, 2019
ed302ad
fix incomplete test
eli-darkly Jan 9, 2019
34c7418
Merge branch 'master' into eb/ch28430/consul
eli-darkly Jan 10, 2019
230a7f8
Merge pull request #94 from launchdarkly/eb/ch29137/sse-gem
eli-darkly Jan 10, 2019
065a348
Merge branch 'master' of github.com:launchdarkly/ruby-client
eli-darkly Jan 11, 2019
9d33cda
Merge branch 'master' of github.com:launchdarkly/ruby-client into 5.4.x
eli-darkly Jan 11, 2019
f18794d
Merge branch '5.4.x'
eli-darkly Jan 11, 2019
6be20c3
Merge branch 'master' into eb/ch22514/docs
eli-darkly Jan 11, 2019
f8b8d34
Merge branch 'master' into eb/ch29197/dependency-order
eli-darkly Jan 11, 2019
f8997d4
Merge branch 'master' into eb/no-faraday
eli-darkly Jan 11, 2019
8f6a68a
Merge branch 'master' into eb/ch25288/utf-8
eli-darkly Jan 15, 2019
8436be4
use Hash.first
eli-darkly Jan 15, 2019
aee1a3b
Merge pull request #93 from launchdarkly/eb/ch29197/dependency-order
eli-darkly Jan 15, 2019
23606bc
Merge pull request #89 from launchdarkly/eb/ch25288/utf-8
eli-darkly Jan 15, 2019
e84fbe7
add test for Unicode in feature store serialization
eli-darkly Jan 15, 2019
dd61579
Merge branch 'master' into eb/ch28430/consul
eli-darkly Jan 15, 2019
8920923
fill in the rest of the Consul implementation
eli-darkly Jan 15, 2019
21c79fe
minor doc fixes
eli-darkly Jan 15, 2019
7ea110f
rm debugging
eli-darkly Jan 15, 2019
5136187
fix initialized check
eli-darkly Jan 15, 2019
46ebc1f
improve feature store tests + minor Redis fixes
eli-darkly Jan 15, 2019
2a4064c
Merge pull request #95 from launchdarkly/eb/feature-store-unicode
eli-darkly Jan 16, 2019
7691723
Merge pull request #96 from launchdarkly/eb/ch28430/consul
eli-darkly Jan 16, 2019
97ee2da
test fix: we can't use Unicode in flag keys anyway
eli-darkly Jan 16, 2019
3061a42
Merge branch 'master' into eb/better-feature-store-tests
eli-darkly Jan 16, 2019
be4523c
Merge branch 'master' into eb/ch22514/docs
eli-darkly Jan 16, 2019
621ef03
Merge pull request #90 from launchdarkly/eb/ch22514/docs
eli-darkly Jan 16, 2019
dbbd033
Merge branch 'master' into eb/better-feature-store-tests
eli-darkly Jan 16, 2019
21a505e
test fix
eli-darkly Jan 16, 2019
9dcbda8
Merge pull request #97 from launchdarkly/eb/better-feature-store-tests
eli-darkly Jan 17, 2019
784eb07
misc prerelease fixes
eli-darkly Jan 17, 2019
a6490eb
merge from public after release
LaunchDarklyCI Jan 18, 2019
e9b06c6
fix doc comments
eli-darkly Jan 18, 2019
7812be4
merge from public after release
LaunchDarklyCI Jan 18, 2019
6389a26
add YARD config so our docs show up correctly everywhere
eli-darkly Jan 18, 2019
3406a03
don't need markup-provider option
eli-darkly Jan 18, 2019
2175108
Merge pull request #98 from launchdarkly/eb/ch17821/yard-config
eli-darkly Jan 18, 2019
76fa71e
merge from public after release
LaunchDarklyCI Jan 18, 2019
207e8fd
Merge branch 'master' into eb/no-faraday
eli-darkly Jan 29, 2019
d38973a
rm obsolete proxy param
eli-darkly Jan 29, 2019
0405d3d
Merge pull request #92 from launchdarkly/eb/no-faraday
eli-darkly Jan 29, 2019
def22fc
remove net-http-persistent
eli-darkly Jan 31, 2019
f5ef9a4
fix concurrent-ruby usage that breaks on Windows
eli-darkly Jan 31, 2019
e725a2c
Merge pull request #99 from launchdarkly/eb/ch30984/no-http-persistent
eli-darkly Feb 1, 2019
d4081a9
Merge pull request #100 from launchdarkly/eb/ch30999/atomic-value
eli-darkly Feb 1, 2019
9b4d75b
add pipeline and clean up with with rm_rf instead of rm
hroederld Feb 4, 2019
09ee839
Merge pull request #101 from launchdarkly/hr/azure2
hroederld Feb 4, 2019
eb4ad97
fix highlight blocks
hroederld Feb 4, 2019
d1190f5
Merge pull request #102 from launchdarkly/hr/blockfix
hroederld Feb 4, 2019
4aa6272
Hr/azure3 (#103)
hroederld Feb 5, 2019
fd143d7
add dynamo (#104)
hroederld Feb 5, 2019
e8860ba
Merge branch 'master' of github.com:launchdarkly/ruby-client
eli-darkly Feb 14, 2019
12f541a
warn & don't send event if identify or track has no valid user
eli-darkly Feb 22, 2019
2800db8
include user in prereq flag events
eli-darkly Feb 22, 2019
0d0086b
Merge pull request #107 from launchdarkly/eb/ch32577/prereq-event-user
eli-darkly Mar 1, 2019
70cacc9
Merge pull request #106 from launchdarkly/eb/ch32176-ch31956/bad-user
eli-darkly Mar 5, 2019
4c23461
update readme to refer to docs
bwoskow-ld Mar 6, 2019
43d39c0
Merge pull request #108 from launchdarkly/bw/ch33438/update-readme-to…
bwoskow-ld Mar 8, 2019
0f91442
Merge commit '72ba633b4f9b34507b5aaad61d0e0541e83df3ad'
eli-darkly Mar 13, 2019
232f419
add Ruby 2.6.2 to CI
eli-darkly Mar 20, 2019
20d109b
fix missing require for net/http
eli-darkly Mar 20, 2019
9e218c2
Merge pull request #109 from launchdarkly/eb/ch34549/net-http-name-error
eli-darkly Mar 21, 2019
ef0f819
merge from public after release
LaunchDarklyCI Mar 21, 2019
651dc37
stringify built-in user attributes in events, and secondary key for e…
eli-darkly Mar 28, 2019
da15bdd
make const names consistent
eli-darkly Mar 28, 2019
ecf18b2
Merge pull request #110 from launchdarkly/eb/ch35206/secondary-string
eli-darkly Mar 29, 2019
3b6bde7
merge from public after release
LaunchDarklyCI Mar 29, 2019
37f9757
Merge pull request #111 from launchdarkly/eb/ch34550/ruby-2.6
eli-darkly Apr 9, 2019
4bc671b
applying markdown templates and updating repository url references
bwoskow-ld May 6, 2019
a56ee20
Cleaning up markdown files
bwoskow-ld May 7, 2019
2bafe25
Merge pull request #114 from launchdarkly/bw/ch36771/applying-markdow…
eli-darkly May 9, 2019
962e729
allow skipping database tests
eli-darkly May 9, 2019
e044e81
Merge pull request #116 from launchdarkly/eb/ch37610/skip-db-tests
eli-darkly May 9, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ workflows:
- test-2.3
- test-2.4
- test-2.5
- test-2.6
- test-jruby-9.2

ruby-docker-template: &ruby-docker-template
Expand Down Expand Up @@ -57,6 +58,13 @@ jobs:
- image: consul
- image: redis
- image: amazon/dynamodb-local
test-2.6:
<<: *ruby-docker-template
docker:
- image: circleci/ruby:2.6.2-stretch
- image: consul
- image: redis
- image: amazon/dynamodb-local
test-jruby-9.2:
<<: *ruby-docker-template
docker:
Expand Down
16 changes: 8 additions & 8 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ All notable changes to the LaunchDarkly Ruby SDK will be documented in this file

## [5.5.5] - 2019-03-28
### Fixed:
- 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))
- 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))

## [5.5.4] - 2019-03-29
### Fixed:
- 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))
- 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))
- 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))
- 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))
- 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).
- Added a link from the SDK readme to the guide regarding the client initialization.

Expand Down Expand Up @@ -44,24 +44,24 @@ All notable changes to the LaunchDarkly Ruby SDK will be documented in this file
### Fixed:
- 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).
- 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.
- 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))
- 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))

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

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

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

## [5.4.1] - 2018-11-05
### Fixed:
- 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)!)
- 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)!)


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

## [3.0.2] - 2018-03-06
## Fixed
- 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)!)
- 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)!)


## [3.0.1] - 2018-02-26
Expand Down
39 changes: 36 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,37 @@
Contributing to LaunchDarkly SDK for Ruby
=========================================
Contributing to the LaunchDarkly Server-side SDK for Ruby
================================================

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.
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.

Submitting bug reports and feature requests
------------------

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.

Submitting pull requests
------------------

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.

Build instructions
------------------

### Prerequisites

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.

To install the runtime dependencies:

```
bundle install
```

### Testing

To run all unit tests:

```
bundle exec rspec spec
```

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.
4 changes: 2 additions & 2 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
ldclient-rb (5.5.2)
ldclient-rb (5.5.5)
concurrent-ruby (~> 1.0)
json (>= 1.8, < 3)
ld-eventsource (~> 1.0)
Expand All @@ -23,7 +23,7 @@ GEM
aws-sigv4 (1.0.3)
codeclimate-test-reporter (0.6.0)
simplecov (>= 0.7.1, < 1.0.0)
concurrent-ruby (1.1.4)
concurrent-ruby (1.1.5)
connection_pool (2.2.1)
diff-lcs (1.3)
diplomat (2.0.2)
Expand Down
168 changes: 24 additions & 144 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,135 +1,26 @@
LaunchDarkly SDK for Ruby
LaunchDarkly Server-side SDK for Ruby
===========================

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

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

LaunchDarkly overview
-------------------------
[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!

[![Twitter Follow](https://img.shields.io/twitter/follow/launchdarkly.svg?style=social&label=Follow&maxAge=2592000)](https://twitter.com/intent/follow?screen_name=launchdarkly)

Supported Ruby versions
-----------------------

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

Quick setup
Getting started
-----------

1. Install the Ruby SDK with `gem`

```shell
gem install ldclient-rb
```

2. Require the LaunchDarkly client:

```ruby
require 'ldclient-rb'
```

3. Create a new LDClient with your SDK key:

```ruby
client = LaunchDarkly::LDClient.new("your_sdk_key")
```

*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).*

### Ruby on Rails

1. Add `gem 'ldclient-rb'` to your Gemfile and `bundle install`

2. Initialize the launchdarkly client in `config/initializers/launchdarkly.rb`:

```ruby
Rails.configuration.ld_client = LaunchDarkly::LDClient.new("your_sdk_key")
```

3. You may want to include a function in your ApplicationController

```ruby
def launchdarkly_settings
if current_user.present?
{
key: current_user.id,
anonymous: false,
email: current_user.email,
custom: { groups: current_user.groups.pluck(:name) },
# Any other fields you may have
# e.g. lastName: current_user.last_name,
}
else
if Rails::VERSION::MAJOR <= 3
hash_key = request.session_options[:id]
else
hash_key = session.id
end
# session ids should be private to prevent session hijacking
hash_key = Digest::SHA256.base64digest hash_key
{
key: hash_key,
anonymous: true,
}
end
end
```

4. In your controllers, access the client using

```ruby
Rails.application.config.ld_client.variation('your.flag.key', launchdarkly_settings, false)
```

Note that this gem will automatically switch to using the Rails logger it is detected.


Your first feature flag
-----------------------

1. Create a new feature flag on your [dashboard](https://app.launchdarkly.com).
2. In your application code, use the feature's key to check whether the flag is on for each user:

```ruby
if client.variation("your.flag.key", {key: "user@test.com"}, false)
# application code to show the feature
else
# the code to run if the feature is off
end
```

HTTPS proxy
-----------

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.)

How to set the HTTPS_PROXY environment variable on Mac/Linux systems:
```
export HTTPS_PROXY=https://web-proxy.domain.com:8080
```

How to set the HTTPS_PROXY environment variable on Windows systems:
```
set HTTPS_PROXY=https://web-proxy.domain.com:8080
```

If your proxy requires authentication then you can prefix the URN with your login information:
```
export HTTPS_PROXY=http://user:pass@web-proxy.domain.com:8080
```
or
```
set HTTPS_PROXY=http://user:pass@web-proxy.domain.com:8080
```

Database integrations
---------------------

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.

Using flag data from a file
---------------------------

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.
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.

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

Testing
-------

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.

Contributing
------------

See [Contributing](https://github.com/launchdarkly/ruby-client/blob/master/CONTRIBUTING.md).

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.
About LaunchDarkly
------------------

-----------
* 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:
* 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.
* 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?).
* 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.
* 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.
* LaunchDarkly provides feature flag SDKs for
* [Java](http://docs.launchdarkly.com/docs/java-sdk-reference "Java SDK")
* [JavaScript](http://docs.launchdarkly.com/docs/js-sdk-reference "LaunchDarkly JavaScript SDK")
* [PHP](http://docs.launchdarkly.com/docs/php-sdk-reference "LaunchDarkly PHP SDK")
* [Python](http://docs.launchdarkly.com/docs/python-sdk-reference "LaunchDarkly Python SDK")
* [Go](http://docs.launchdarkly.com/docs/go-sdk-reference "LaunchDarkly Go SDK")
* [Node.JS](http://docs.launchdarkly.com/docs/node-sdk-reference "LaunchDarkly Node SDK")
* [Electron](http://docs.launchdarkly.com/docs/electron-sdk-reference "LaunchDarkly Electron SDK")
* [.NET](http://docs.launchdarkly.com/docs/dotnet-sdk-reference "LaunchDarkly .Net SDK")
* [Ruby](http://docs.launchdarkly.com/docs/ruby-sdk-reference "LaunchDarkly Ruby SDK")
* [iOS](http://docs.launchdarkly.com/docs/ios-sdk-reference "LaunchDarkly iOS SDK")
* [Android](http://docs.launchdarkly.com/docs/android-sdk-reference "LaunchDarkly Android SDK")
* 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.
* Explore LaunchDarkly
* [launchdarkly.com](http://www.launchdarkly.com/ "LaunchDarkly Main Website") for more information
* [docs.launchdarkly.com](http://docs.launchdarkly.com/ "LaunchDarkly Documentation") for our documentation and SDKs
* [apidocs.launchdarkly.com](http://apidocs.launchdarkly.com/ "LaunchDarkly API Documentation") for our API documentation
* [blog.launchdarkly.com](http://blog.launchdarkly.com/ "LaunchDarkly Blog Documentation") for the latest product updates
* [Feature Flagging Guide](https://github.com/launchdarkly/featureflags/ "Feature Flagging Guide") for best practices and strategies
* [launchdarkly.com](https://www.launchdarkly.com/ "LaunchDarkly Main Website") for more information
* [docs.launchdarkly.com](https://docs.launchdarkly.com/ "LaunchDarkly Documentation") for our documentation and SDK reference guides
* [apidocs.launchdarkly.com](https://apidocs.launchdarkly.com/ "LaunchDarkly API Documentation") for our API documentation
* [blog.launchdarkly.com](https://blog.launchdarkly.com/ "LaunchDarkly Blog Documentation") for the latest product updates
* [Feature Flagging Guide](https://github.com/launchdarkly/featureflags/ "Feature Flagging Guide") for best practices and strategies
2 changes: 1 addition & 1 deletion ldclient-rb.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Gem::Specification.new do |spec|
spec.email = ["team@launchdarkly.com"]
spec.summary = "LaunchDarkly SDK for Ruby"
spec.description = "Official LaunchDarkly SDK for Ruby"
spec.homepage = "https://github.com/launchdarkly/ruby-client"
spec.homepage = "https://github.com/launchdarkly/ruby-server-sdk"
spec.license = "Apache-2.0"

spec.files = `git ls-files -z`.split("\x0")
Expand Down
4 changes: 2 additions & 2 deletions scripts/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
# When done you should commit and push the changes made.

set -uxe
echo "Starting ruby-client release."
echo "Starting ruby-server-sdk release."

VERSION=$1

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

echo "Done with ruby-client release"
echo "Done with ruby-server-sdk release"
1 change: 1 addition & 0 deletions spec/integrations/consul_feature_store_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ def clear_all_data


describe "Consul feature store" do
return if ENV['LD_SKIP_DATABASE_TESTS'] == '1'

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

Expand Down
3 changes: 2 additions & 1 deletion spec/integrations/dynamodb_feature_store_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,8 @@ def create_test_client


describe "DynamoDB feature store" do

return if ENV['LD_SKIP_DATABASE_TESTS'] == '1'

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

create_table_if_necessary
Expand Down
Loading