statsig 1.8.2 → 1.8.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/evaluator.rb +7 -0
- data/lib/statsig.rb +1 -1
- data/lib/statsig_logger.rb +11 -5
- 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: e6b5d1c640eab6b3173784683e1e87c41c97410631aaea5e9e68306cd45df829
|
4
|
+
data.tar.gz: c78cb2b73b63f496672a2486a8fb7fe212dc4192838b4cf72a5e191f9b4d065f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2b4601bb00d1287c24aceca4e85d9e4c786225d6c42a8abb8bd70ab687d6d0ce508e3e762b302306617d3f17e81d693293509aa1f1550ab3ad670c4bca464737
|
7
|
+
data.tar.gz: d5518fc18cd937879281663b1592e286fbe45cd2a222e5ef6ab7659443fb5f5db4875ba7f29d7acbe28a5f81b8bec54195123617f58db09fa442b2ec224c1559
|
data/lib/evaluator.rb
CHANGED
@@ -159,17 +159,24 @@ module Statsig
|
|
159
159
|
return EvaluationHelpers::compare_numbers(value, target, ->(a, b) { a <= b })
|
160
160
|
|
161
161
|
# version comparison
|
162
|
+
# need to check for nil or empty value because Version takes them as valid values
|
162
163
|
when 'version_gt'
|
164
|
+
return false if value.to_s.empty?
|
163
165
|
return (Gem::Version.new(value) > Gem::Version.new(target) rescue false)
|
164
166
|
when 'version_gte'
|
167
|
+
return false if value.to_s.empty?
|
165
168
|
return (Gem::Version.new(value) >= Gem::Version.new(target) rescue false)
|
166
169
|
when 'version_lt'
|
170
|
+
return false if value.to_s.empty?
|
167
171
|
return (Gem::Version.new(value) < Gem::Version.new(target) rescue false)
|
168
172
|
when 'version_lte'
|
173
|
+
return false if value.to_s.empty?
|
169
174
|
return (Gem::Version.new(value) <= Gem::Version.new(target) rescue false)
|
170
175
|
when 'version_eq'
|
176
|
+
return false if value.to_s.empty?
|
171
177
|
return (Gem::Version.new(value) == Gem::Version.new(target) rescue false)
|
172
178
|
when 'version_neq'
|
179
|
+
return false if value.to_s.empty?
|
173
180
|
return (Gem::Version.new(value) != Gem::Version.new(target) rescue false)
|
174
181
|
|
175
182
|
# array operations
|
data/lib/statsig.rb
CHANGED
data/lib/statsig_logger.rb
CHANGED
@@ -8,10 +8,7 @@ module Statsig
|
|
8
8
|
def initialize(network)
|
9
9
|
@network = network
|
10
10
|
@events = []
|
11
|
-
@background_flush =
|
12
|
-
sleep 60
|
13
|
-
flush
|
14
|
-
end
|
11
|
+
@background_flush = periodic_flush
|
15
12
|
end
|
16
13
|
|
17
14
|
def log_event(event)
|
@@ -46,9 +43,18 @@ module Statsig
|
|
46
43
|
log_event(event)
|
47
44
|
end
|
48
45
|
|
46
|
+
def periodic_flush
|
47
|
+
Thread.new do
|
48
|
+
loop do
|
49
|
+
sleep 60
|
50
|
+
flush
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
54
|
+
|
49
55
|
def flush(closing = false)
|
50
56
|
if closing
|
51
|
-
@background_flush
|
57
|
+
@background_flush&.exit
|
52
58
|
end
|
53
59
|
if @events.length == 0
|
54
60
|
return
|
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.8.
|
4
|
+
version: 1.8.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Statsig, Inc
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-02-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|