vwo-fme-ruby-sdk 1.6.0 → 1.6.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.
- checksums.yaml +4 -4
- data/lib/vwo/constants/constants.rb +1 -1
- data/lib/vwo/services/settings_service.rb +12 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: a12277288f7279e70a3e9377bef0abb653f2839d6c704dd3df5d366de985ed7c
|
|
4
|
+
data.tar.gz: 123e0ac3771a2a186fb28b1cb2110455696ec8aa845d63d01896ad903a99a612
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 1de38f2c5a1f84e25a724337120f355230a36b49dc42c44b953bde59b937ac4bf00d5ef520d75c41e49564d34f6f4b463154786237ecd7084ae46e30dd6915f3
|
|
7
|
+
data.tar.gz: 794c80eab52fb093c203ee3dd0c3f0b39e37049c12ae032e56a9054acdcd3f566ea0e1218b6a9015d577562fa27179aeab34b7554ea1c8d8fa0aa27af25a2fdb
|
|
@@ -31,6 +31,13 @@ class SettingsService
|
|
|
31
31
|
def get_instance
|
|
32
32
|
@instance ||= SettingsService.new
|
|
33
33
|
end
|
|
34
|
+
|
|
35
|
+
def normalize_settings(settings)
|
|
36
|
+
normalized_settings = settings.dup
|
|
37
|
+
normalized_settings['features'] = [] if normalized_settings['features'].is_a?(Hash) && normalized_settings['features'].empty?
|
|
38
|
+
normalized_settings['campaigns'] = [] if normalized_settings['campaigns'].is_a?(Hash) && normalized_settings['campaigns'].empty?
|
|
39
|
+
normalized_settings
|
|
40
|
+
end
|
|
34
41
|
end
|
|
35
42
|
|
|
36
43
|
def initialize(options)
|
|
@@ -102,7 +109,11 @@ class SettingsService
|
|
|
102
109
|
settings_fetch_end_time = (Time.now.to_f * 1000).to_i
|
|
103
110
|
time_taken = settings_fetch_end_time - settings_fetch_start_time
|
|
104
111
|
@settings_fetch_time = time_taken.to_s
|
|
105
|
-
response.get_data
|
|
112
|
+
settings = response.get_data
|
|
113
|
+
# Deep duplicate the settings to avoid modifying the original object
|
|
114
|
+
normalized_settings = SettingsService.normalize_settings(settings)
|
|
115
|
+
|
|
116
|
+
normalized_settings
|
|
106
117
|
rescue => e
|
|
107
118
|
LoggerService.log(LogLevelEnum::ERROR, "Error fetching settings: #{e.message}", nil)
|
|
108
119
|
raise e
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: vwo-fme-ruby-sdk
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.6.
|
|
4
|
+
version: 1.6.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- VWO
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2025-09
|
|
11
|
+
date: 2025-12-09 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: uuidtools
|