launchdarkly-server-sdk 8.8.0 → 8.8.1

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: 508b6894ca8b1448c28d0358429561282e11b08569750eb2bc6200fa25b7a9ea
4
+ data.tar.gz: 335c7acd3d8903907489b88488976fdbe399f3f60e7a8ee4a1b99f525a42b2a0
5
5
  SHA512:
6
- metadata.gz: be9ca147365077934dbeb17eb70df914679fb2dbf2360d971f7f2dd2fc1e72e2dfbf72be371ef5757bfaf9809cd7057f749936fcb89635d2a7ff530f8f590945
7
- data.tar.gz: 2a8e19486d6897dd4eb5ed5bac30374087cb79817b1970218d7e360595da72a727360d50cddebdfcf3db6e340cffdfbbd8c042c5daece294b9233755a9a0d8cc
6
+ metadata.gz: 1656cd73d98bbfabf94b0efb14a07254c8018eee30e204fa0eca1ab531f8b314cb044404a023e6e51c04c967e46d2cecab8db880785540cd072c72e220152cad
7
+ data.tar.gz: 59fa0d6dff4c5ae6f366dca1da7831370c7838145bd4f21883ef74deb1897ebe76f26a8851b75beccace2d242bb0531d374a3cd047ff45638b1a445d2dd56b8d
@@ -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
+ 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.1" # 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.1
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-10-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk-dynamodb