launchdarkly-server-sdk 8.8.3-java
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/LICENSE.txt +13 -0
- data/README.md +61 -0
- data/lib/launchdarkly-server-sdk.rb +1 -0
- data/lib/ldclient-rb/cache_store.rb +45 -0
- data/lib/ldclient-rb/config.rb +658 -0
- data/lib/ldclient-rb/context.rb +565 -0
- data/lib/ldclient-rb/evaluation_detail.rb +387 -0
- data/lib/ldclient-rb/events.rb +642 -0
- data/lib/ldclient-rb/expiring_cache.rb +77 -0
- data/lib/ldclient-rb/flags_state.rb +88 -0
- data/lib/ldclient-rb/impl/big_segments.rb +117 -0
- data/lib/ldclient-rb/impl/broadcaster.rb +78 -0
- data/lib/ldclient-rb/impl/context.rb +96 -0
- data/lib/ldclient-rb/impl/context_filter.rb +166 -0
- data/lib/ldclient-rb/impl/data_source.rb +188 -0
- data/lib/ldclient-rb/impl/data_store.rb +109 -0
- data/lib/ldclient-rb/impl/dependency_tracker.rb +102 -0
- data/lib/ldclient-rb/impl/diagnostic_events.rb +129 -0
- data/lib/ldclient-rb/impl/evaluation_with_hook_result.rb +34 -0
- data/lib/ldclient-rb/impl/evaluator.rb +539 -0
- data/lib/ldclient-rb/impl/evaluator_bucketing.rb +86 -0
- data/lib/ldclient-rb/impl/evaluator_helpers.rb +50 -0
- data/lib/ldclient-rb/impl/evaluator_operators.rb +131 -0
- data/lib/ldclient-rb/impl/event_sender.rb +100 -0
- data/lib/ldclient-rb/impl/event_summarizer.rb +68 -0
- data/lib/ldclient-rb/impl/event_types.rb +136 -0
- data/lib/ldclient-rb/impl/flag_tracker.rb +58 -0
- data/lib/ldclient-rb/impl/integrations/consul_impl.rb +170 -0
- data/lib/ldclient-rb/impl/integrations/dynamodb_impl.rb +300 -0
- data/lib/ldclient-rb/impl/integrations/file_data_source.rb +229 -0
- data/lib/ldclient-rb/impl/integrations/redis_impl.rb +306 -0
- data/lib/ldclient-rb/impl/integrations/test_data/test_data_source.rb +40 -0
- data/lib/ldclient-rb/impl/migrations/migrator.rb +287 -0
- data/lib/ldclient-rb/impl/migrations/tracker.rb +136 -0
- data/lib/ldclient-rb/impl/model/clause.rb +45 -0
- data/lib/ldclient-rb/impl/model/feature_flag.rb +254 -0
- data/lib/ldclient-rb/impl/model/preprocessed_data.rb +64 -0
- data/lib/ldclient-rb/impl/model/segment.rb +132 -0
- data/lib/ldclient-rb/impl/model/serialization.rb +72 -0
- data/lib/ldclient-rb/impl/repeating_task.rb +46 -0
- data/lib/ldclient-rb/impl/sampler.rb +25 -0
- data/lib/ldclient-rb/impl/store_client_wrapper.rb +141 -0
- data/lib/ldclient-rb/impl/store_data_set_sorter.rb +55 -0
- data/lib/ldclient-rb/impl/unbounded_pool.rb +34 -0
- data/lib/ldclient-rb/impl/util.rb +95 -0
- data/lib/ldclient-rb/impl.rb +13 -0
- data/lib/ldclient-rb/in_memory_store.rb +100 -0
- data/lib/ldclient-rb/integrations/consul.rb +45 -0
- data/lib/ldclient-rb/integrations/dynamodb.rb +92 -0
- data/lib/ldclient-rb/integrations/file_data.rb +108 -0
- data/lib/ldclient-rb/integrations/redis.rb +98 -0
- data/lib/ldclient-rb/integrations/test_data/flag_builder.rb +663 -0
- data/lib/ldclient-rb/integrations/test_data.rb +213 -0
- data/lib/ldclient-rb/integrations/util/store_wrapper.rb +246 -0
- data/lib/ldclient-rb/integrations.rb +6 -0
- data/lib/ldclient-rb/interfaces.rb +974 -0
- data/lib/ldclient-rb/ldclient.rb +822 -0
- data/lib/ldclient-rb/memoized_value.rb +32 -0
- data/lib/ldclient-rb/migrations.rb +230 -0
- data/lib/ldclient-rb/non_blocking_thread_pool.rb +46 -0
- data/lib/ldclient-rb/polling.rb +102 -0
- data/lib/ldclient-rb/reference.rb +295 -0
- data/lib/ldclient-rb/requestor.rb +102 -0
- data/lib/ldclient-rb/simple_lru_cache.rb +25 -0
- data/lib/ldclient-rb/stream.rb +196 -0
- data/lib/ldclient-rb/util.rb +132 -0
- data/lib/ldclient-rb/version.rb +3 -0
- data/lib/ldclient-rb.rb +27 -0
- metadata +400 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 59c552eae93a7ae544e129a1f14565cf96a8bab492b35b90d2a4c73792d7a5f5
|
4
|
+
data.tar.gz: 7b2b170dccd64ba24608e11fd26ab82fac898a61542a1e3279f223daa3dc4012
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 2884b93afa6e27cacc8e2e7271b853348facd526c351c7aabea690cab8f46b9f72b00279dfc04ed503a6e8a0b8f39b9e9dd814085a520e2c126ccc9cdf04a97b
|
7
|
+
data.tar.gz: 7719ede3528f9400536cc06e2543bc1ffaabaef02d6ccb3389efdd33fbc9f4b7162f19838e4a20c66336cf6d461be75aea9051b2efb4094e2dcec9f07af6cf56
|
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,61 @@
|
|
1
|
+
LaunchDarkly Server-side SDK for Ruby
|
2
|
+
===========================
|
3
|
+
|
4
|
+
[](http://badge.fury.io/rb/launchdarkly-server-sdk)
|
5
|
+
|
6
|
+
[](https://github.com/launchdarkly/ruby-server-sdk/actions/workflows/ci.yml)
|
7
|
+
[](https://www.rubydoc.info/gems/launchdarkly-server-sdk)
|
8
|
+
[](https://launchdarkly.github.io/ruby-server-sdk)
|
9
|
+
|
10
|
+
LaunchDarkly overview
|
11
|
+
-------------------------
|
12
|
+
[LaunchDarkly](https://www.launchdarkly.com) is a feature management platform that serves trillions of feature flags daily to help teams build better software, faster. [Get started](https://docs.launchdarkly.com/home/getting-started) using LaunchDarkly today!
|
13
|
+
|
14
|
+
[](https://twitter.com/intent/follow?screen_name=launchdarkly)
|
15
|
+
|
16
|
+
Supported Ruby versions
|
17
|
+
-----------------------
|
18
|
+
|
19
|
+
This version of the LaunchDarkly SDK has a minimum Ruby version of 2.5.0, or 9.2.0 for JRuby.
|
20
|
+
|
21
|
+
Getting started
|
22
|
+
-----------
|
23
|
+
|
24
|
+
Refer to the [SDK documentation](https://docs.launchdarkly.com/sdk/server-side/ruby#getting-started) for instructions on getting started with using the SDK.
|
25
|
+
|
26
|
+
Learn more
|
27
|
+
-----------
|
28
|
+
|
29
|
+
Read 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).
|
30
|
+
|
31
|
+
Generated API documentation for all versions of the SDK is on [RubyDoc.info](https://www.rubydoc.info/gems/launchdarkly-server-sdk). The API documentation for the latest version is also on [GitHub Pages](https://launchdarkly.github.io/ruby-server-sdk).
|
32
|
+
|
33
|
+
Testing
|
34
|
+
-------
|
35
|
+
|
36
|
+
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.
|
37
|
+
|
38
|
+
Contributing
|
39
|
+
------------
|
40
|
+
|
41
|
+
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.
|
42
|
+
|
43
|
+
Verifying SDK build provenance with the SLSA framework
|
44
|
+
------------
|
45
|
+
|
46
|
+
LaunchDarkly uses the [SLSA framework](https://slsa.dev/spec/v1.0/about) (Supply-chain Levels for Software Artifacts) to help developers make their supply chain more secure by ensuring the authenticity and build integrity of our published SDK packages. To learn more, see the [provenance guide](PROVENANCE.md).
|
47
|
+
|
48
|
+
About LaunchDarkly
|
49
|
+
-----------
|
50
|
+
|
51
|
+
* 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:
|
52
|
+
* 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.
|
53
|
+
* 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?).
|
54
|
+
* 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.
|
55
|
+
* 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.
|
56
|
+
* LaunchDarkly provides feature flag SDKs for a wide variety of languages and technologies. Read [our documentation](https://docs.launchdarkly.com/sdk) for a complete list.
|
57
|
+
* Explore LaunchDarkly
|
58
|
+
* [launchdarkly.com](https://www.launchdarkly.com/ "LaunchDarkly Main Website") for more information
|
59
|
+
* [docs.launchdarkly.com](https://docs.launchdarkly.com/ "LaunchDarkly Documentation") for our documentation and SDK reference guides
|
60
|
+
* [apidocs.launchdarkly.com](https://apidocs.launchdarkly.com/ "LaunchDarkly API Documentation") for our API documentation
|
61
|
+
* [blog.launchdarkly.com](https://blog.launchdarkly.com/ "LaunchDarkly Blog Documentation") for the latest product updates
|
@@ -0,0 +1 @@
|
|
1
|
+
require_relative "ldclient-rb"
|
@@ -0,0 +1,45 @@
|
|
1
|
+
require "concurrent/map"
|
2
|
+
|
3
|
+
module LaunchDarkly
|
4
|
+
#
|
5
|
+
# A thread-safe in-memory store that uses the same semantics that Faraday would expect, although we
|
6
|
+
# no longer use Faraday. This is used by Requestor, when we are not in a Rails environment.
|
7
|
+
#
|
8
|
+
# @private
|
9
|
+
#
|
10
|
+
class ThreadSafeMemoryStore
|
11
|
+
#
|
12
|
+
# Default constructor
|
13
|
+
#
|
14
|
+
# @return [ThreadSafeMemoryStore] a new store
|
15
|
+
def initialize
|
16
|
+
@cache = Concurrent::Map.new
|
17
|
+
end
|
18
|
+
|
19
|
+
#
|
20
|
+
# Read a value from the cache
|
21
|
+
# @param key [Object] the cache key
|
22
|
+
#
|
23
|
+
# @return [Object] the cache value
|
24
|
+
def read(key)
|
25
|
+
@cache[key]
|
26
|
+
end
|
27
|
+
|
28
|
+
#
|
29
|
+
# Store a value in the cache
|
30
|
+
# @param key [Object] the cache key
|
31
|
+
# @param value [Object] the value to associate with the key
|
32
|
+
#
|
33
|
+
# @return [Object] the value
|
34
|
+
def write(key, value)
|
35
|
+
@cache[key] = value
|
36
|
+
end
|
37
|
+
|
38
|
+
#
|
39
|
+
# Delete a value in the cache
|
40
|
+
# @param key [Object] the cache key
|
41
|
+
def delete(key)
|
42
|
+
@cache.delete(key)
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|