devcycle-ruby-server-sdk 2.3.4 → 2.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/devcycle-ruby-server-sdk/api/devcycle_api.rb +11 -0
- data/lib/devcycle-ruby-server-sdk/localbucketing/config_manager.rb +2 -2
- data/lib/devcycle-ruby-server-sdk/localbucketing/local_bucketing.rb +2 -1
- data/lib/devcycle-ruby-server-sdk/version.rb +1 -1
- data/spec/api/devcycle_api_spec.rb +6 -2
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b3c2aaf794a8af5d3292e13a8c38b76e455f5f7c86eeefa4458a8ce16cde6a49
|
4
|
+
data.tar.gz: 244bc6166f3c7e731f0ebd8ec35a6542c6d04249a6404ffc25021c4505a07a7f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bdb757f3a1587695a4c632c592de1599492faadfcb6218a65bf4d9ef439bb62590d97c9bd0fc5e5a4d9410dab856160d7561e68c33c8623da7ea300838605219
|
7
|
+
data.tar.gz: 5175738e9469f764871e93cb777ce3ec8cec681e2a1a3b5fd5dbdd178478fa9b021a7bbc8541e74defee711f3ed943975c573563c053aae610835f68844be0fd
|
@@ -158,6 +158,17 @@ module DevCycle
|
|
158
158
|
return data, status_code, headers
|
159
159
|
end
|
160
160
|
|
161
|
+
# Get variable value by key for user data
|
162
|
+
# @param user_data [UserData]
|
163
|
+
# @param key [String] Variable key
|
164
|
+
# @param default Default value for variable if none is retrieved
|
165
|
+
# @param [Hash] opts the optional parameters
|
166
|
+
# @return variable value which can be: string, number, boolean, or JSON
|
167
|
+
def variable_value(user_data, key, default, opts = {})
|
168
|
+
variable_obj = variable(user_data, key, default, opts)
|
169
|
+
variable_obj.value
|
170
|
+
end
|
171
|
+
|
161
172
|
# Get variable by key for user data
|
162
173
|
# @param user_data [UserData]
|
163
174
|
# @param key [String] Variable key
|
@@ -66,9 +66,9 @@ module DevCycle
|
|
66
66
|
@logger.debug("Config not modified, using cache, etag: #{@config_e_tag}")
|
67
67
|
break
|
68
68
|
when 200
|
69
|
-
@logger.
|
69
|
+
@logger.debug("New config received, etag: #{resp.headers['Etag']}")
|
70
70
|
set_config(resp.body, resp.headers['Etag'])
|
71
|
-
@logger.
|
71
|
+
@logger.debug("New config stored, etag: #{@config_e_tag}")
|
72
72
|
break
|
73
73
|
when 403
|
74
74
|
stop_polling
|
@@ -23,7 +23,8 @@ module DevCycle
|
|
23
23
|
HEADER_ID = 9
|
24
24
|
|
25
25
|
@@rand = Random.new(seed = Random.new_seed)
|
26
|
-
@@engine = Wasmtime::Engine.new
|
26
|
+
@@engine = Wasmtime::Engine.new(parallel_compilation: false)
|
27
|
+
# added to ensure that there is no processes deadlock when compiling wasm before forking
|
27
28
|
|
28
29
|
@@wasmmodule = Wasmtime::Module.from_file(@@engine, "#{__dir__}/bucketing-lib.release.wasm")
|
29
30
|
@@wasi_ctx = Wasmtime::WasiCtxBuilder.new
|
@@ -60,8 +60,10 @@ describe 'DVCClient' do
|
|
60
60
|
describe 'get_variable_by_key activate-flag' do
|
61
61
|
it 'should work' do
|
62
62
|
result = @api_instance.variable(@user_data, "activate-flag", false)
|
63
|
-
|
64
63
|
expect(result.isDefaulted).to eq true
|
64
|
+
|
65
|
+
result = @api_instance.variable_value(@user_data, "activate-flag", true)
|
66
|
+
expect(result).to eq true
|
65
67
|
end
|
66
68
|
end
|
67
69
|
|
@@ -74,9 +76,11 @@ describe 'DVCClient' do
|
|
74
76
|
describe 'get_variable_by_key test' do
|
75
77
|
it 'should work' do
|
76
78
|
result = @api_instance.variable(@user_data, "test", false)
|
77
|
-
|
78
79
|
expect(result.isDefaulted).to eq false
|
79
80
|
expect(result.value).to eq true
|
81
|
+
|
82
|
+
result = @api_instance.variable_value(@user_data, "test", true)
|
83
|
+
expect(result).to eq true
|
80
84
|
end
|
81
85
|
end
|
82
86
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: devcycle-ruby-server-sdk
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- DevCycleHQ
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-05-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: typhoeus
|
@@ -165,7 +165,7 @@ homepage: https://devcycle.com
|
|
165
165
|
licenses:
|
166
166
|
- MIT
|
167
167
|
metadata: {}
|
168
|
-
post_install_message:
|
168
|
+
post_install_message:
|
169
169
|
rdoc_options: []
|
170
170
|
require_paths:
|
171
171
|
- lib
|
@@ -180,8 +180,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
180
180
|
- !ruby/object:Gem::Version
|
181
181
|
version: '0'
|
182
182
|
requirements: []
|
183
|
-
rubygems_version: 3.
|
184
|
-
signing_key:
|
183
|
+
rubygems_version: 3.4.10
|
184
|
+
signing_key:
|
185
185
|
specification_version: 4
|
186
186
|
summary: DevCycle Bucketing API Ruby Gem
|
187
187
|
test_files:
|