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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ae26e043c16d15e17bcd0754199d98bc6b04c02da1df32b6598ee28c1a18e9dc
4
- data.tar.gz: 24e8f4738be97277bc60973019bfc1272ce9ec91512281bbec7eb21e4fb820a2
3
+ metadata.gz: b3c2aaf794a8af5d3292e13a8c38b76e455f5f7c86eeefa4458a8ce16cde6a49
4
+ data.tar.gz: 244bc6166f3c7e731f0ebd8ec35a6542c6d04249a6404ffc25021c4505a07a7f
5
5
  SHA512:
6
- metadata.gz: a9a6cc240d5b274707ef68df0471ac484a62ad4a5a346e512edd7c1afcc6d8025fbc353274bdd8b619a967a87478b8984796376ca9996bbdf2a1b3257e99b70d
7
- data.tar.gz: 062421f2b3d0b8967bd42326a5b23ac1fcb98ec9767e0d08e77d32c3030dc30484607e8d2aaede18949b5df41faa28a972d37d77b1b76163a232013866fad81d
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.info("New config received, etag: #{resp.headers['Etag']}")
69
+ @logger.debug("New config received, etag: #{resp.headers['Etag']}")
70
70
  set_config(resp.body, resp.headers['Etag'])
71
- @logger.info("New config stored, etag: #{@config_e_tag}")
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
@@ -11,5 +11,5 @@ OpenAPI Generator version: 5.3.0
11
11
  =end
12
12
 
13
13
  module DevCycle
14
- VERSION = '2.3.4'
14
+ VERSION = '2.4.0'
15
15
  end
@@ -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.3.4
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-04-25 00:00:00.000000000 Z
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.2.33
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: