splitclient-rb 3.1.0.pre.rc4 → 3.1.0.pre.rc5

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8d86d4f7f7e1e0794c835f22916d06176c5df0a6
4
- data.tar.gz: 275b5bc5b7876dbd0a55e1dcb90bf4b0bdbffbbd
3
+ metadata.gz: 3b87eb417698ad4261d7875bf106cbdd68454f44
4
+ data.tar.gz: bf1bbfa658d60391665cbba727552a9bf63a08ec
5
5
  SHA512:
6
- metadata.gz: a409d2f655ec55ffd75bb82c2879997277119188035701bdbbf1f8c2ff02a09690963fb636a7d77d7dd6784a8ec42903ea5cbccceb170982b172b772a2b60771
7
- data.tar.gz: 2f63641202e9a2cf981b1a327dd767f6a8be8d06663fd41444eae6b6307edea6318efc0a3fa3170f709ccad80f62a74586c5777c9c9021d3bde8476ec06c562c
6
+ metadata.gz: ac75a102f260b28e54a65354593bca386f1c603d0521c2b99b2ace068f76337454dd06834d75de7af22483dbbdacbd66a33e7d3349bfd5bc81326e0a3a8498e6
7
+ data.tar.gz: 11d3e31a4fb3adcc0e15dcd42c956e679a557dc2da7a423211ee44f15bc01bc5cc8537a64caee76faeab0cc3a841491d6e5ef8dd370e2daafdbd2d4529807588
data/CHANGES.txt CHANGED
@@ -1,5 +1,6 @@
1
1
  3.1.0
2
2
  - Add RedisAdapter
3
+ - adds manager.splitNames()
3
4
 
4
5
  3.0.3
5
6
  - Fix nil ref in manager
@@ -19,30 +19,29 @@ module SplitIoClient
19
19
  @adapter.delete(namespace_key("split.#{name}"))
20
20
  end
21
21
 
22
- def get_split(name, prefixed = false)
23
- split = prefixed ? @adapter.string(name) : @adapter.string(namespace_key("split.#{name}"))
22
+ def get_split(name)
23
+ split = @adapter.string(namespace_key("split.#{name}"))
24
24
 
25
25
  JSON.parse(split, symbolize_names: true)
26
26
  end
27
27
 
28
28
  def splits
29
29
  splits_hash = {}
30
- splits = []
31
- split_names = @adapter.find_strings_by_prefix(namespace_key('split'))
32
30
 
33
31
  split_names.each do |name|
34
- next if name == namespace_key('split.till')
35
-
36
- splits << get_split(name, true)
37
- end
38
-
39
- splits.each do |split|
40
- splits_hash[split[:name]] = split
32
+ splits_hash[name] = get_split(name)
41
33
  end
42
34
 
43
35
  splits_hash
44
36
  end
45
37
 
38
+ # Return an array of Split Names excluding control keys like split.till
39
+ def split_names
40
+ @adapter.find_strings_by_prefix(namespace_key('split'))
41
+ .reject { |split| split == namespace_key('split.till') }
42
+ .map { |split| split.gsub(namespace_key('split.'), '') }
43
+ end
44
+
46
45
  def set_change_number(since)
47
46
  @adapter.set_string(namespace_key('split.till'), since)
48
47
  end
@@ -57,6 +57,24 @@ module SplitIoClient
57
57
  end
58
58
  end
59
59
 
60
+ #
61
+ # method to get the list of just split names. Ideal for ietrating and calling client.get_treatment
62
+ #
63
+ # @returns [object] array of split names (String)
64
+ def splitNames
65
+ if @localhost_mode
66
+ local_feature_names = []
67
+ @localhost_mode_features.each do |split|
68
+ local_feature_names << split[:feature]
69
+ end
70
+ return local_feature_names
71
+ end
72
+
73
+ return if @splits_repository.nil?
74
+
75
+ @splits_repository.splitNames
76
+ end
77
+
60
78
  #
61
79
  # method to get a split view
62
80
  #
@@ -1,3 +1,3 @@
1
1
  module SplitIoClient
2
- VERSION = '3.1.0-rc4'
2
+ VERSION = '3.1.0-rc5'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: splitclient-rb
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.0.pre.rc4
4
+ version: 3.1.0.pre.rc5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Split Software