devcycle-ruby-server-sdk 2.3.5 → 2.4.1

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: 40bc3727e8d09d7e8262340fc95f3e171c9634fb6dbca1f7ec77c08bf26e928e
4
- data.tar.gz: f7b808fda1a36db48d6858583c397dff9a1e363faf9ad90dd514ca0a5263dd9b
3
+ metadata.gz: be778d76e51c7963c9808b17dd26f5d4b996de230d7d1c9533877cb31d382b43
4
+ data.tar.gz: aec14f328d569f505b5ab3a44349964aaa62b8a802594d46d8b2ded68291fd8e
5
5
  SHA512:
6
- metadata.gz: '087daa311bad8eeeaff30dc1b3ea098b554aef19b8340893f0776a8aa2e6e7ade6946d4005c248af0ee7feadbf8f802e56f0b6630270a03cb963d2442e293259'
7
- data.tar.gz: e6f00489f8db1cc44878d2279523e9980e830aee7992a6dbc53d11dd7f62a136bc77c83e3ff9aa0877797a099bfdbdb171890126bf7821f20fd93f2bf192cb8a
6
+ metadata.gz: 0ca58aff68ce611b7416a0432a632fabf5b9882c6de44fe40dbffdd2e117fc89fef59ecbc5814be2064b376568b42d93fb31a2eef83ba9ff12c5e30f0dd02774
7
+ data.tar.gz: 20b2d432d5c55ad4545930ff744ddb7cb35fbbf72982303f513a1829a5ec90c2d708f7f805620db708b53d4aa99ca1d7e555367c8b94ca7564d44fc6b4b80e7b
@@ -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
@@ -74,11 +74,16 @@ module DevCycle
74
74
  stop_polling
75
75
  @logger.error("Failed to download DevCycle config; Invalid SDK Key.")
76
76
  break
77
+ when 404
78
+ stop_polling
79
+ @logger.error("Failed to download DevCycle config; Config not found.")
80
+ break
77
81
  when 500...599
78
82
  @logger.error("Failed to download DevCycle config. Status: #{resp.code}")
79
83
  else
80
- stop_polling
81
- @logger.error("Unexpected response code - DevCycle Response: #{Oj.dump(resp)}")
84
+ @logger.error("Unexpected response from DevCycle CDN")
85
+ @logger.error("Response code: #{resp.code}")
86
+ @logger.error("Response body: #{resp.body}")
82
87
  break
83
88
  end
84
89
  end
@@ -11,5 +11,5 @@ OpenAPI Generator version: 5.3.0
11
11
  =end
12
12
 
13
13
  module DevCycle
14
- VERSION = '2.3.5'
14
+ VERSION = '2.4.1'
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.5
4
+ version: 2.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - DevCycleHQ
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-05-05 00:00:00.000000000 Z
11
+ date: 2023-05-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: typhoeus