splitclient-rb 4.2.1 → 4.2.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
  SHA1:
3
- metadata.gz: 74a4925604de05a5e5d9422be5f62b1ec8d66a07
4
- data.tar.gz: 879a2f9cad369b6dd0f52d6f23f5ebf6fd514475
3
+ metadata.gz: 364fd2e02b4eb154e24b7495b828fe90de57281f
4
+ data.tar.gz: 188dcf371f6b9c88916f56283b38cba859d8062c
5
5
  SHA512:
6
- metadata.gz: 98e87182688107a90fefd26ac3d7d108ba09a99024afd0f3a3620b2fe1f64fabc917da6f1a54d71f5af560c680f1321ae0516ed26d4643e5daa7291ecf41f482
7
- data.tar.gz: 24af1504410b5075632ffc8e06d1fa2704218438bb91375f01a45d5b564be73ecf44bd66a6ad3cbfb96d8913f53e0b04b5d285fc794396b89e5c223e7f8e28e8
6
+ metadata.gz: 75f8301c25574564e35414edd40c0e8ebe07d4a433c2e39d804d97aef27e1cd3b503badeb26718d2d31d5e8c342fbf96581721a356ce5c79c20bc1ef2c54ec1d
7
+ data.tar.gz: d5ed059d54883256b1d2dc33257cd6a9fc88ce8f5ee5d3e1354b8c0d175b2b47f52e98dc2c24a1f85e1aa34c10ad5f41ccc0ba694ca5c61e849277bc62e5d71b
data/CHANGES.txt CHANGED
@@ -1,3 +1,6 @@
1
+ 4.2.2 (July 28, 2017)
2
+ - Fix treatments array in SplitManager
3
+
1
4
  4.2.1 (July 20, 2017)
2
5
  - Coerce string to regexp for Regexp matcher
3
6
 
@@ -45,7 +45,7 @@ module SplitIoClient
45
45
  # @returns a split view
46
46
  def split(split_name)
47
47
  return unless @splits_repository
48
-
48
+
49
49
  split = @splits_repository.get_split(split_name)
50
50
 
51
51
  return if split.nil? || Engine::Models::Split.archived?(split)
@@ -56,12 +56,14 @@ module SplitIoClient
56
56
  def build_split_view(name, split)
57
57
  return {} unless split
58
58
 
59
- treatments =
60
- if split[:conditions] && split[:conditions][0][:partitions]
61
- split[:conditions][0][:partitions].map { |partition| partition[:treatment] }
62
- else
63
- []
64
- end
59
+ begin
60
+ treatments = split[:conditions]
61
+ .detect { |c| c[:conditionType] == 'ROLLOUT' }[:partitions]
62
+ .map { |partition| partition[:treatment] }
63
+ rescue StandardError
64
+ treatments = []
65
+ end
66
+
65
67
 
66
68
  {
67
69
  name: name,
@@ -1,3 +1,3 @@
1
1
  module SplitIoClient
2
- VERSION = '4.2.1'
2
+ VERSION = '4.2.2'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: splitclient-rb
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.2.1
4
+ version: 4.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Split Software
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-07-27 00:00:00.000000000 Z
11
+ date: 2017-07-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler