statsig 1.33.1 → 1.33.2
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 +4 -4
- data/lib/api_config.rb +45 -43
- data/lib/spec_store.rb +2 -2
- data/lib/statsig.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7496f0ffb0bb7a06d8377193b93659d31fd2b1f1df55eb81ad061e2e0ef42167
|
4
|
+
data.tar.gz: 2a0b10e6e7e18a11df14667858957abfead96833ee7a9ca7b7470f22426f3160
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9bf0bdc595846b6a531d83984e2d75e0649ec6485fe971c3bbb3bc496d9ca6950d227756e88be75f0b33331d0b503248a02dec8fa72c3e398b39eb735d1e4bb2
|
7
|
+
data.tar.gz: 82f6ee222688547e1d264d337e7bc532ab7ac5801d112c5ecf36f0755ecd3b82e07fd57b71e50c5df0f672899fbab2f3c18e868abf0c4fe80924e7ccabfcee33
|
data/lib/api_config.rb
CHANGED
@@ -8,22 +8,6 @@ module Statsig
|
|
8
8
|
attr_accessor :name, :type, :is_active, :salt, :default_value, :enabled,
|
9
9
|
:rules, :id_type, :entity, :explicit_parameters, :has_shared_params, :target_app_ids
|
10
10
|
|
11
|
-
def initialize(name:, type:, is_active:, salt:, default_value:, enabled:, rules:, id_type:, entity:,
|
12
|
-
explicit_parameters: nil, has_shared_params: nil, target_app_ids: nil)
|
13
|
-
@name = name
|
14
|
-
@type = type.to_sym unless entity.nil?
|
15
|
-
@is_active = is_active
|
16
|
-
@salt = salt
|
17
|
-
@default_value = JSON.parse(JSON.generate(default_value))
|
18
|
-
@enabled = enabled
|
19
|
-
@rules = rules
|
20
|
-
@id_type = id_type
|
21
|
-
@entity = entity.to_sym unless entity.nil?
|
22
|
-
@explicit_parameters = explicit_parameters
|
23
|
-
@has_shared_params = has_shared_params
|
24
|
-
@target_app_ids = target_app_ids
|
25
|
-
end
|
26
|
-
|
27
11
|
def self.from_json(json)
|
28
12
|
new(
|
29
13
|
name: json[:name],
|
@@ -42,28 +26,30 @@ module Statsig
|
|
42
26
|
target_app_ids: json[:targetAppIDs]
|
43
27
|
)
|
44
28
|
end
|
45
|
-
end
|
46
|
-
end
|
47
29
|
|
48
|
-
|
49
|
-
class APIRule
|
50
|
-
|
51
|
-
attr_accessor :name, :pass_percentage, :return_value, :id, :salt,
|
52
|
-
:conditions, :id_type, :group_name, :config_delegate, :is_experiment_group
|
30
|
+
private
|
53
31
|
|
54
|
-
def initialize(name:,
|
55
|
-
|
32
|
+
def initialize(name:, type:, is_active:, salt:, default_value:, enabled:, rules:, id_type:, entity:,
|
33
|
+
explicit_parameters: nil, has_shared_params: nil, target_app_ids: nil)
|
56
34
|
@name = name
|
57
|
-
@
|
58
|
-
@
|
59
|
-
@id = id
|
35
|
+
@type = type.to_sym unless type.nil?
|
36
|
+
@is_active = is_active
|
60
37
|
@salt = salt
|
61
|
-
@
|
38
|
+
@default_value = JSON.parse(JSON.generate(default_value))
|
39
|
+
@enabled = enabled
|
40
|
+
@rules = rules
|
62
41
|
@id_type = id_type
|
63
|
-
@
|
64
|
-
@
|
65
|
-
@
|
42
|
+
@entity = entity.to_sym unless entity.nil?
|
43
|
+
@explicit_parameters = explicit_parameters
|
44
|
+
@has_shared_params = has_shared_params
|
45
|
+
@target_app_ids = target_app_ids
|
66
46
|
end
|
47
|
+
end
|
48
|
+
|
49
|
+
class APIRule
|
50
|
+
|
51
|
+
attr_accessor :name, :pass_percentage, :return_value, :id, :salt,
|
52
|
+
:conditions, :id_type, :group_name, :config_delegate, :is_experiment_group
|
67
53
|
|
68
54
|
def self.from_json(json)
|
69
55
|
new(
|
@@ -81,23 +67,28 @@ module Statsig
|
|
81
67
|
is_experiment_group: json[:isExperimentGroup]
|
82
68
|
)
|
83
69
|
end
|
70
|
+
|
71
|
+
private
|
72
|
+
|
73
|
+
def initialize(name:, pass_percentage:, return_value:, id:, salt:, conditions:, id_type:,
|
74
|
+
group_name: nil, config_delegate: nil, is_experiment_group: nil)
|
75
|
+
@name = name
|
76
|
+
@pass_percentage = pass_percentage.to_f
|
77
|
+
@return_value = JSON.parse(JSON.generate(return_value))
|
78
|
+
@id = id
|
79
|
+
@salt = salt
|
80
|
+
@conditions = conditions
|
81
|
+
@id_type = id_type
|
82
|
+
@group_name = group_name
|
83
|
+
@config_delegate = config_delegate
|
84
|
+
@is_experiment_group = is_experiment_group
|
85
|
+
end
|
84
86
|
end
|
85
|
-
end
|
86
87
|
|
87
|
-
module Statsig
|
88
88
|
class APICondition
|
89
89
|
|
90
90
|
attr_accessor :type, :target_value, :operator, :field, :additional_values, :id_type
|
91
91
|
|
92
|
-
def initialize(type:, target_value:, operator:, field:, additional_values:, id_type:)
|
93
|
-
@type = type.to_sym unless type.nil?
|
94
|
-
@target_value = target_value
|
95
|
-
@operator = operator.to_sym unless operator.nil?
|
96
|
-
@field = field
|
97
|
-
@additional_values = additional_values || {}
|
98
|
-
@id_type = id_type
|
99
|
-
end
|
100
|
-
|
101
92
|
def self.from_json(json)
|
102
93
|
operator = json[:operator]
|
103
94
|
unless operator.nil?
|
@@ -124,5 +115,16 @@ module Statsig
|
|
124
115
|
id_type: json[:idType]
|
125
116
|
)
|
126
117
|
end
|
118
|
+
|
119
|
+
private
|
120
|
+
|
121
|
+
def initialize(type:, target_value:, operator:, field:, additional_values:, id_type:)
|
122
|
+
@type = type.to_sym unless type.nil?
|
123
|
+
@target_value = target_value
|
124
|
+
@operator = operator.to_sym unless operator.nil?
|
125
|
+
@field = field
|
126
|
+
@additional_values = additional_values || {}
|
127
|
+
@id_type = id_type
|
128
|
+
end
|
127
129
|
end
|
128
130
|
end
|
data/lib/spec_store.rb
CHANGED
@@ -161,10 +161,10 @@ module Statsig
|
|
161
161
|
|
162
162
|
def maybe_restart_background_threads
|
163
163
|
if @config_sync_thread.nil? || !@config_sync_thread.alive?
|
164
|
-
@config_sync_thread =
|
164
|
+
@config_sync_thread = spawn_sync_config_specs_thread
|
165
165
|
end
|
166
166
|
if @id_lists_sync_thread.nil? || !@id_lists_sync_thread.alive?
|
167
|
-
@id_lists_sync_thread =
|
167
|
+
@id_lists_sync_thread = spawn_sync_id_lists_thread
|
168
168
|
end
|
169
169
|
end
|
170
170
|
|
data/lib/statsig.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: statsig
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.33.
|
4
|
+
version: 1.33.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Statsig, Inc
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-03-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|