splitclient-rb 8.1.3.pre.rc1 → 8.1.3.pre.rc2

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: 9a0ec791812addfdc81c560cc797d8c1e8e457fb7087622c2f891166725c4dcd
4
- data.tar.gz: 95d672b4f213ebaac3e12073fcdafcf29aa15f7b4d1c2c5df573e30f545e9b51
3
+ metadata.gz: 5508fee5ba933e333d48d3659f2193cba3e0ac5d3ef9c6a11fcf1b9c171919a1
4
+ data.tar.gz: 64db776591fe9f3db5f9820114338cf05270a881d8b249881941f416bfd28b48
5
5
  SHA512:
6
- metadata.gz: 3c9c1d2fb2239e9efdf33d725cfee6a99104b995767812820b2b80e3b863e4f3a087d4a0b84191b4d45e2c8779e41e405f2592a2aa9e49048787f06f6c5e4ac7
7
- data.tar.gz: 20288247d0976a7b8468b8a5c190612283df8f23a5360841bb9ec21990715efa2c5582fdfd9ae5fe8de7948ac969aa95aa3e80bc231902cffd7391558a8dcf1a
6
+ metadata.gz: a7890055fe01a272791d102927aef116bbafe7acec3075a05d9ccdbec4587cca96643a8c801a8519d6a47a9a73ec37dce3500da00fada9ec17e0ce5092c58b1e
7
+ data.tar.gz: 67c6b57d9b30adde1e99c071c16d3b616e83a283f37b264e7f020cbfa8e4830f9ae72bf39cce27b5a054efd96cc1daee3017713da8b7656449eaf44799e93309
@@ -39,20 +39,31 @@ module SplitIoClient
39
39
 
40
40
  private
41
41
 
42
+ def return_split_from_json(notification)
43
+ JSON.parse(
44
+ SplitIoClient::Helpers::DecryptionHelper.get_encoded_definition(
45
+ notification.data['c'],
46
+ notification.data['d']
47
+ ),
48
+ symbolize_names: true
49
+ )
50
+ end
51
+
52
+ def check_update(notification)
53
+ @feature_flags_repository.get_change_number == notification.data['pcn'] && !notification.data['d'].nil?
54
+ end
55
+
42
56
  def update_feature_flag(notification)
43
57
  return if @feature_flags_repository.get_change_number.to_i > notification.data['changeNumber']
44
58
 
45
- if @feature_flags_repository.get_change_number == notification.data['pcn']
59
+ if check_update(notification)
46
60
  begin
47
- @feature_flags_repository.add_split(
48
- JSON.parse(
49
- SplitIoClient::Helpers::DecryptionHelper.get_encoded_definition(
50
- notification.data['c'],
51
- notification.data['d']
52
- ),
53
- symbolize_names: true
54
- )
55
- )
61
+ new_split = return_split_from_json(notification)
62
+ if SplitIoClient::Engine::Models::Split.archived?(new_split)
63
+ @feature_flags_repository.remove_split(new_split)
64
+ else
65
+ @feature_flags_repository.add_split(new_split)
66
+ end
56
67
  @feature_flags_repository.set_change_number(notification.data['changeNumber'])
57
68
  return
58
69
  rescue StandardError => e
@@ -1,3 +1,3 @@
1
1
  module SplitIoClient
2
- VERSION = '8.1.3.pre.rc1'
2
+ VERSION = '8.1.3.pre.rc2'
3
3
  end
@@ -37,6 +37,7 @@ Gem::Specification.new do |spec|
37
37
 
38
38
  spec.add_development_dependency 'allocation_stats', '~> 0.1'
39
39
  spec.add_development_dependency 'bundler', '~> 2.2'
40
+ spec.add_development_dependency 'byebug', '~> 11.1'
40
41
  spec.add_development_dependency 'pry', '~> 0.14'
41
42
  spec.add_development_dependency 'pry-nav', '~> 1.0'
42
43
  spec.add_development_dependency 'rake', '~> 13.0'
@@ -48,7 +49,6 @@ Gem::Specification.new do |spec|
48
49
  spec.add_development_dependency 'timecop', '~> 0.9'
49
50
  spec.add_development_dependency 'webmock', '~> 3.14'
50
51
  spec.add_development_dependency 'webrick', '~> 1.7'
51
- spec.add_development_dependency 'byebug', '~> 11.1'
52
52
 
53
53
  spec.add_runtime_dependency 'bitarray', '~> 1.3'
54
54
  spec.add_runtime_dependency 'concurrent-ruby', '~> 1.0'
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: 8.1.3.pre.rc1
4
+ version: 8.1.3.pre.rc2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Split Software
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-06-06 00:00:00.000000000 Z
11
+ date: 2023-06-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: allocation_stats
@@ -38,6 +38,20 @@ dependencies:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
40
  version: '2.2'
41
+ - !ruby/object:Gem::Dependency
42
+ name: byebug
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '11.1'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '11.1'
41
55
  - !ruby/object:Gem::Dependency
42
56
  name: pry
43
57
  requirement: !ruby/object:Gem::Requirement
@@ -192,20 +206,6 @@ dependencies:
192
206
  - - "~>"
193
207
  - !ruby/object:Gem::Version
194
208
  version: '1.7'
195
- - !ruby/object:Gem::Dependency
196
- name: byebug
197
- requirement: !ruby/object:Gem::Requirement
198
- requirements:
199
- - - "~>"
200
- - !ruby/object:Gem::Version
201
- version: '11.1'
202
- type: :development
203
- prerelease: false
204
- version_requirements: !ruby/object:Gem::Requirement
205
- requirements:
206
- - - "~>"
207
- - !ruby/object:Gem::Version
208
- version: '11.1'
209
209
  - !ruby/object:Gem::Dependency
210
210
  name: bitarray
211
211
  requirement: !ruby/object:Gem::Requirement