statsig 1.8.4.beta.pre.2 → 1.8.4

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: 8bea35d8e01c06aa973c41af533542e10256eb12ff1b8c790affe92d28e6f762
4
- data.tar.gz: 183446325403fc29ffafd0ea498557ae56c59d6959a59d5e96a1c88806b57147
3
+ metadata.gz: e6b5d1c640eab6b3173784683e1e87c41c97410631aaea5e9e68306cd45df829
4
+ data.tar.gz: c78cb2b73b63f496672a2486a8fb7fe212dc4192838b4cf72a5e191f9b4d065f
5
5
  SHA512:
6
- metadata.gz: 116a1a145265084de0877fda45b017f36eda5eed8a19c093e25588e1f4720ac10ef903dfdc9c6f13ae4989565a8b01e4e20ac2aa3efd661a34e1c16bb91d680b
7
- data.tar.gz: aa0d99ff3b38ae0e73f037bf31efc4a364fe0e6831efa6347329f525e38c2148837c19e21768fece6b921fbbe6404664e30d9549aa9d4ace4544519c5830dd8b
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
@@ -40,7 +40,7 @@ module Statsig
40
40
  def self.get_statsig_metadata
41
41
  {
42
42
  'sdkType' => 'ruby-server',
43
- 'sdkVersion' => '1.8.4.beta-2',
43
+ 'sdkVersion' => '1.8.4',
44
44
  }
45
45
  end
46
46
 
@@ -13,7 +13,6 @@ module Statsig
13
13
 
14
14
  def log_event(event)
15
15
  @events.push(event)
16
- puts "Statsig:: log_event called, new count: #{@events.length.to_s}"
17
16
  if @events.length >= 500
18
17
  flush
19
18
  end
@@ -45,27 +44,21 @@ module Statsig
45
44
  end
46
45
 
47
46
  def periodic_flush
48
- puts "Statsig:: starting a thread"
49
47
  Thread.new do
50
48
  loop do
51
- puts "Statsig:: beginning to sleep for 60 seconds"
52
49
  sleep 60
53
- puts "Statsig:: finished sleeping"
54
50
  flush
55
- puts "Statsig:: flushed"
56
51
  end
57
52
  end
58
53
  end
59
54
 
60
55
  def flush(closing = false)
61
- puts "Statsig:: calling flush function, count: #{@events.length.to_s}"
62
56
  if closing
63
57
  @background_flush&.exit
64
58
  end
65
59
  if @events.length == 0
66
60
  return
67
61
  end
68
- puts "Statsig:: flushing events, count: #{@events.length.to_s}"
69
62
  flush_events = @events.map { |e| e.serialize }
70
63
  @events = []
71
64
 
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.beta.pre.2
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-01-18 00:00:00.000000000 Z
11
+ date: 2022-02-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -141,9 +141,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
141
141
  version: '0'
142
142
  required_rubygems_version: !ruby/object:Gem::Requirement
143
143
  requirements:
144
- - - ">"
144
+ - - ">="
145
145
  - !ruby/object:Gem::Version
146
- version: 1.3.1
146
+ version: '0'
147
147
  requirements: []
148
148
  rubygems_version: 3.2.3
149
149
  signing_key: