launchdarkly-server-sdk 8.8.0 → 8.8.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ad194623a6f35a835f5b80ce5068146bbb68ae0b7ee170824ffef66be5e5b152
4
- data.tar.gz: 999fb27820fd61a422f14c62cf59a9a6f894fc34ac24be794a4144a13ad9dd35
3
+ metadata.gz: d13d9414f9f1c60e2af1e2505cc40005da11facb98f362f6ce7c5575f92a9596
4
+ data.tar.gz: 94b1b3fd7e9e6f3c685f0b42c2fd798c72445df71d6e436426a89341b864bbeb
5
5
  SHA512:
6
- metadata.gz: be9ca147365077934dbeb17eb70df914679fb2dbf2360d971f7f2dd2fc1e72e2dfbf72be371ef5757bfaf9809cd7057f749936fcb89635d2a7ff530f8f590945
7
- data.tar.gz: 2a8e19486d6897dd4eb5ed5bac30374087cb79817b1970218d7e360595da72a727360d50cddebdfcf3db6e340cffdfbbd8c042c5daece294b9233755a9a0d8cc
6
+ metadata.gz: eafd096ae3a4257855b762e2a267560fcec2b0e96c976fff4a6aa69e113dfe178888637ea27deb963d70df2dd9933503304c010f9e96e17c2ff68b6697d976f1
7
+ data.tar.gz: 1ec423bf28d9bf8b6f15f0a0deb9e6b24b175fdb0f9ebc1b25987d4335ceaedfd91532539aaaf1cea9f85c954739707b971642619b40fa9cbce66f3168ed527d
@@ -4,6 +4,56 @@ require "ldclient-rb/interfaces"
4
4
  module LaunchDarkly
5
5
  module Impl
6
6
  module DataStore
7
+
8
+ class DataKind
9
+ FEATURES = "features".freeze
10
+ SEGMENTS = "segments".freeze
11
+
12
+ FEATURE_PREREQ_FN = lambda { |flag| (flag[:prerequisites] || []).map { |p| p[:key] } }.freeze
13
+
14
+ attr_reader :namespace
15
+ attr_reader :priority
16
+
17
+ #
18
+ # @param namespace [String]
19
+ # @param priority [Integer]
20
+ #
21
+ def initialize(namespace:, priority:)
22
+ @namespace = namespace
23
+ @priority = priority
24
+ end
25
+
26
+ #
27
+ # Maintain the same behavior when these data kinds were standard ruby hashes.
28
+ #
29
+ # @param key [Symbol]
30
+ # @return [Object]
31
+ #
32
+ def [](key)
33
+ return priority if key == :priority
34
+ return namespace if key == :namespace
35
+ return get_dependency_keys_fn() if key == :get_dependency_keys
36
+ nil
37
+ end
38
+
39
+ #
40
+ # Retrieve the dependency keys for a particular data kind. Right now, this is only defined for flags.
41
+ #
42
+ def get_dependency_keys_fn()
43
+ return nil unless @namespace == FEATURES
44
+
45
+ FEATURE_PREREQ_FN
46
+ end
47
+
48
+ def eql?(other)
49
+ other.is_a?(DataKind) && namespace == other.namespace && priority == other.priority
50
+ end
51
+
52
+ def hash
53
+ [namespace, priority].hash
54
+ end
55
+ end
56
+
7
57
  class StatusProvider
8
58
  include LaunchDarkly::Interfaces::DataStore::StatusProvider
9
59
 
@@ -11,17 +11,10 @@ module LaunchDarkly
11
11
  # to ensure data consistency during non-atomic updates.
12
12
 
13
13
  # @private
14
- FEATURES = {
15
- namespace: "features",
16
- priority: 1, # that is, features should be stored after segments
17
- get_dependency_keys: lambda { |flag| (flag[:prerequisites] || []).map { |p| p[:key] } },
18
- }.freeze
14
+ FEATURES = Impl::DataStore::DataKind.new(namespace: "features", priority: 1).freeze
19
15
 
20
16
  # @private
21
- SEGMENTS = {
22
- namespace: "segments",
23
- priority: 0,
24
- }.freeze
17
+ SEGMENTS = Impl::DataStore::DataKind.new(namespace: "segments", priority: 0).freeze
25
18
 
26
19
  # @private
27
20
  ALL_KINDS = [FEATURES, SEGMENTS].freeze
@@ -1,3 +1,3 @@
1
1
  module LaunchDarkly
2
- VERSION = "8.8.0" # x-release-please-version
2
+ VERSION = "8.8.2" # x-release-please-version
3
3
  end
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: 8.8.0
4
+ version: 8.8.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - LaunchDarkly
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-10-16 00:00:00.000000000 Z
11
+ date: 2024-11-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk-dynamodb
@@ -410,7 +410,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
410
410
  - !ruby/object:Gem::Version
411
411
  version: '0'
412
412
  requirements: []
413
- rubygems_version: 3.5.16
413
+ rubygems_version: 3.5.22
414
414
  signing_key:
415
415
  specification_version: 4
416
416
  summary: LaunchDarkly SDK for Ruby