statsig 2.5.0 → 2.5.1

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.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/evaluator.rb +8 -5
  3. data/lib/statsig.rb +1 -1
  4. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9d4842b01ba9c40089bbf689984a0c9a59234d83f0d070c2570856335ad012fc
4
- data.tar.gz: 44afa2a46886c397ecc2975f123d9808f08548fadd7e9703130cd6099033d159
3
+ metadata.gz: 270fe13b6b756794826634e8256e0ffd19ff1df35c265942e721fe7c81807ac9
4
+ data.tar.gz: 96d33f20e9df4c35291e88a84a816336f183e70189c0cfb4f6a21ba7859e65b4
5
5
  SHA512:
6
- metadata.gz: 13ec911e8fb874d705ace7bc92d857dfa8a71171812b822f2af2826e9f52af01d03af8661bfd42866d7c7560b5a050a9ff2e936084eb61d18a46c67555bf5ea7
7
- data.tar.gz: 61c0be14ffc93a7bc0db3fe25932a09e8dab52fdb7eaf50b2e15ffef44cba975ddf5706b328ba8f9e0eef6ef0b744856b691efbfae72c247fb58a0d04465a86e
6
+ metadata.gz: dff47718c7ea99367818542ce9dd2f5d2825577fc5b74563e6d1bf3c71677c4e524dabed63772981f5c5bd685ec16d22e86bd39b6f75c091b0343fed30fc958f
7
+ data.tar.gz: 9c3b51ce54bf65e47ae8041a2dc1c8aae17f2a05e166f2c75607fc11bdb93c4b92a42dff9703dff5e0528ebf3fed8c442cb858680dadd276dc3b29692b3dfaa8
data/lib/evaluator.rb CHANGED
@@ -591,19 +591,22 @@ module Statsig
591
591
  def eval_rule(user, rule, end_result)
592
592
  pass = true
593
593
  i = 0
594
-
594
+ memo = user.get_memo
595
595
  until i >= rule[:conditions].length
596
596
  condition_hash = rule[:conditions][i]
597
597
  condition = @spec_store.get_condition(condition_hash)
598
598
 
599
599
  if condition.nil?
600
600
  puts "[Statsig]: Warning - Condition with hash #{condition_hash} could not be found."
601
- pass = false
602
- else
601
+ result = false
602
+ elsif condition[:type] == Const::CND_FAIL_GATE || condition[:type] == Const::CND_PASS_GATE
603
603
  result = eval_condition(user, condition, end_result)
604
- pass = false if result != true
604
+ else
605
+ result = Memo.for(memo, :eval_rule, condition_hash) do
606
+ eval_condition(user, condition, end_result)
607
+ end
605
608
  end
606
-
609
+ pass = false if result != true
607
610
  i += 1
608
611
  end
609
612
 
data/lib/statsig.rb CHANGED
@@ -386,7 +386,7 @@ module Statsig
386
386
  def self.get_statsig_metadata
387
387
  {
388
388
  'sdkType' => 'ruby-server',
389
- 'sdkVersion' => '2.5.0',
389
+ 'sdkVersion' => '2.5.1',
390
390
  'languageVersion' => RUBY_VERSION
391
391
  }
392
392
  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: 2.5.0
4
+ version: 2.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Statsig, Inc
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-05-27 00:00:00.000000000 Z
11
+ date: 2025-06-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler