statsig 1.33.1 → 1.33.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: b4fb72ccd9119baf09c70ec9a04e47098af84e2203bed686b424d6bac54cadc2
4
- data.tar.gz: 83d67e1bca413aeca2cee515fc82cd6ec28eeca12af328a6c2590c670b68b025
3
+ metadata.gz: 7496f0ffb0bb7a06d8377193b93659d31fd2b1f1df55eb81ad061e2e0ef42167
4
+ data.tar.gz: 2a0b10e6e7e18a11df14667858957abfead96833ee7a9ca7b7470f22426f3160
5
5
  SHA512:
6
- metadata.gz: b23677eaadd49a7291b35f8fb68fccf19eb1e00a7d60873f3431cfdb60c99c39650760821dceeface487a0046906a851b76980cee0cb6547672396848582915a
7
- data.tar.gz: 7cb1c39caf9d3d068345e256a45858cd5e7e9b2fbdbf27b6a2a64a765a379af41073d56a74c6d1ba45c97ec43e87357396d0e045e1251db8b3054668449ad096
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
- module Statsig
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:, pass_percentage:, return_value:, id:, salt:, conditions:, id_type:,
55
- group_name: nil, config_delegate: nil, is_experiment_group: nil)
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
- @pass_percentage = pass_percentage.to_f
58
- @return_value = JSON.parse(JSON.generate(return_value))
59
- @id = id
35
+ @type = type.to_sym unless type.nil?
36
+ @is_active = is_active
60
37
  @salt = salt
61
- @conditions = conditions
38
+ @default_value = JSON.parse(JSON.generate(default_value))
39
+ @enabled = enabled
40
+ @rules = rules
62
41
  @id_type = id_type
63
- @group_name = group_name
64
- @config_delegate = config_delegate
65
- @is_experiment_group = is_experiment_group
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 = sync_config_specs
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 = sync_id_lists
167
+ @id_lists_sync_thread = spawn_sync_id_lists_thread
168
168
  end
169
169
  end
170
170
 
data/lib/statsig.rb CHANGED
@@ -356,7 +356,7 @@ module Statsig
356
356
  def self.get_statsig_metadata
357
357
  {
358
358
  'sdkType' => 'ruby-server',
359
- 'sdkVersion' => '1.33.1',
359
+ 'sdkVersion' => '1.33.2',
360
360
  'languageVersion' => RUBY_VERSION
361
361
  }
362
362
  end
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.1
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-02-26 00:00:00.000000000 Z
11
+ date: 2024-03-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler