launchdarkly-server-sdk 7.2.0 → 7.3.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +3 -3
- data/lib/ldclient-rb/config.rb +1 -1
- data/lib/ldclient-rb/context.rb +4 -0
- data/lib/ldclient-rb/impl/context.rb +3 -3
- data/lib/ldclient-rb/impl/event_sender.rb +1 -0
- data/lib/ldclient-rb/impl/integrations/file_data_source.rb +1 -0
- data/lib/ldclient-rb/impl/integrations/redis_impl.rb +3 -2
- data/lib/ldclient-rb/integrations/test_data.rb +3 -3
- data/lib/ldclient-rb/ldclient.rb +1 -0
- data/lib/ldclient-rb/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f4a03c0847cb10ea287eaa193067eb3e74191ea124faad2ec6a632ccd04b3297
|
4
|
+
data.tar.gz: dc06eb1a9d68e1fa972751ac4273ecc3284737279d1715b2769fde52f8457def
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9496714bc7e4fe7ddfdf392255d89033a5d330b26397efd87ac166582d6ac74984843a91d5ee1236638f70310d8e4f03ab0d8fce0d0220381daed4b2bee9ea98
|
7
|
+
data.tar.gz: ababf98f4a35776fcbd9911a06b2dca144fb5803a05ad9f1aabe5a5afcb776a9c76a9156059ccfc484888d32c1f3ef70a81b8060bb01bced991d72b417da0b5f
|
data/README.md
CHANGED
@@ -3,13 +3,13 @@ LaunchDarkly Server-side SDK for Ruby
|
|
3
3
|
|
4
4
|
[![Gem Version](https://badge.fury.io/rb/launchdarkly-server-sdk.svg)](http://badge.fury.io/rb/launchdarkly-server-sdk)
|
5
5
|
|
6
|
-
[![
|
6
|
+
[![Run CI](https://github.com/launchdarkly/ruby-server-sdk/actions/workflows/ci.yml/badge.svg)](https://github.com/launchdarkly/ruby-server-sdk/actions/workflows/ci.yml)
|
7
7
|
[![RubyDoc](https://img.shields.io/static/v1?label=docs+-+all+versions&message=reference&color=00add8)](https://www.rubydoc.info/gems/launchdarkly-server-sdk)
|
8
8
|
[![GitHub Pages](https://img.shields.io/static/v1?label=docs+-+latest&message=reference&color=00add8)](https://launchdarkly.github.io/ruby-server-sdk)
|
9
9
|
|
10
10
|
LaunchDarkly overview
|
11
11
|
-------------------------
|
12
|
-
[LaunchDarkly](https://www.launchdarkly.com) is a feature management platform that serves
|
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
13
|
|
14
14
|
[![Twitter Follow](https://img.shields.io/twitter/follow/launchdarkly.svg?style=social&label=Follow&maxAge=2592000)](https://twitter.com/intent/follow?screen_name=launchdarkly)
|
15
15
|
|
@@ -26,7 +26,7 @@ Refer to the [SDK documentation](https://docs.launchdarkly.com/sdk/server-side/r
|
|
26
26
|
Learn more
|
27
27
|
-----------
|
28
28
|
|
29
|
-
|
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
30
|
|
31
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
32
|
|
data/lib/ldclient-rb/config.rb
CHANGED
data/lib/ldclient-rb/context.rb
CHANGED
@@ -317,6 +317,8 @@ module LaunchDarkly
|
|
317
317
|
# {https://docs.launchdarkly.com/sdk/features/user-config SDK
|
318
318
|
# documentation}.
|
319
319
|
#
|
320
|
+
# @deprecated The old user format will be removed in 8.0.0. Please use the new context specific format.
|
321
|
+
#
|
320
322
|
# @param data [Hash]
|
321
323
|
# @return [LDContext]
|
322
324
|
#
|
@@ -397,6 +399,8 @@ module LaunchDarkly
|
|
397
399
|
# @return [LDContext]
|
398
400
|
#
|
399
401
|
private_class_method def self.create_legacy_context(data)
|
402
|
+
warn("DEPRECATED: legacy user format will be removed in 8.0.0", uplevel: 1)
|
403
|
+
|
400
404
|
key = data[:key]
|
401
405
|
|
402
406
|
# Legacy users are allowed to have "" as a key but they cannot have nil as a key.
|
@@ -40,7 +40,7 @@ module LaunchDarkly
|
|
40
40
|
return ERR_KIND_NON_STRING unless kind.is_a?(String)
|
41
41
|
return ERR_KIND_CANNOT_BE_KIND if kind == "kind"
|
42
42
|
return ERR_KIND_CANNOT_BE_MULTI if kind == "multi"
|
43
|
-
|
43
|
+
ERR_KIND_INVALID_CHARS unless kind.match?(/^[\w.-]+$/)
|
44
44
|
end
|
45
45
|
|
46
46
|
#
|
@@ -51,7 +51,7 @@ module LaunchDarkly
|
|
51
51
|
#
|
52
52
|
def self.validate_key(key)
|
53
53
|
return ERR_KEY_NON_STRING unless key.is_a?(String)
|
54
|
-
|
54
|
+
ERR_KEY_EMPTY if key == ""
|
55
55
|
end
|
56
56
|
|
57
57
|
#
|
@@ -61,7 +61,7 @@ module LaunchDarkly
|
|
61
61
|
# @return [String, nil]
|
62
62
|
#
|
63
63
|
def self.validate_name(name)
|
64
|
-
|
64
|
+
ERR_NAME_NON_STRING unless name.nil? || name.is_a?(String)
|
65
65
|
end
|
66
66
|
|
67
67
|
#
|
@@ -1,3 +1,4 @@
|
|
1
|
+
require "ldclient-rb/interfaces"
|
1
2
|
require "concurrent/atomics"
|
2
3
|
require "json"
|
3
4
|
|
@@ -111,13 +112,13 @@ module LaunchDarkly
|
|
111
112
|
@pool = create_redis_pool(opts)
|
112
113
|
|
113
114
|
# shutdown pool on close unless the client passed a custom pool and specified not to shutdown
|
114
|
-
@pool_shutdown_on_close =
|
115
|
+
@pool_shutdown_on_close = !opts[:pool] || opts.fetch(:pool_shutdown_on_close, true)
|
115
116
|
|
116
117
|
@prefix = opts[:prefix] || LaunchDarkly::Integrations::Redis::default_prefix
|
117
118
|
@logger = opts[:logger] || Config.default_logger
|
118
119
|
@test_hook = opts[:test_hook] # used for unit tests, deliberately undocumented
|
119
120
|
|
120
|
-
@stopped = Concurrent::AtomicBoolean.new
|
121
|
+
@stopped = Concurrent::AtomicBoolean.new
|
121
122
|
|
122
123
|
with_connection do |redis|
|
123
124
|
@logger.info("#{description}: using Redis instance at #{redis.connection[:host]}:#{redis.connection[:port]} and prefix: #{@prefix}")
|
@@ -90,7 +90,7 @@ module LaunchDarkly
|
|
90
90
|
#
|
91
91
|
def flag(key)
|
92
92
|
existing_builder = @lock.with_read_lock { @flag_builders[key] }
|
93
|
-
if existing_builder.nil?
|
93
|
+
if existing_builder.nil?
|
94
94
|
FlagBuilder.new(key).boolean_flag
|
95
95
|
else
|
96
96
|
existing_builder.clone
|
@@ -118,7 +118,7 @@ module LaunchDarkly
|
|
118
118
|
@flag_builders[flag_builder.key] = flag_builder
|
119
119
|
version = 0
|
120
120
|
flag_key = flag_builder.key.to_sym
|
121
|
-
if @current_flags[flag_key]
|
121
|
+
if @current_flags[flag_key]
|
122
122
|
version = @current_flags[flag_key][:version]
|
123
123
|
end
|
124
124
|
new_flag = Impl::Model.deserialize(FEATURES, flag_builder.build(version+1))
|
@@ -175,7 +175,7 @@ module LaunchDarkly
|
|
175
175
|
key = item.key.to_sym
|
176
176
|
@lock.with_write_lock do
|
177
177
|
old_item = current[key]
|
178
|
-
unless old_item.nil?
|
178
|
+
unless old_item.nil?
|
179
179
|
data = item.as_json
|
180
180
|
data[:version] = old_item.version + 1
|
181
181
|
item = Impl::Model.deserialize(kind, data)
|
data/lib/ldclient-rb/ldclient.rb
CHANGED
data/lib/ldclient-rb/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: launchdarkly-server-sdk
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 7.2
|
4
|
+
version: 7.3.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- LaunchDarkly
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-12-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aws-sdk-dynamodb
|
@@ -357,7 +357,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
357
357
|
- !ruby/object:Gem::Version
|
358
358
|
version: '0'
|
359
359
|
requirements: []
|
360
|
-
rubygems_version: 3.
|
360
|
+
rubygems_version: 3.1.6
|
361
361
|
signing_key:
|
362
362
|
specification_version: 4
|
363
363
|
summary: LaunchDarkly SDK for Ruby
|