devcycle-ruby-server-sdk 1.0.0 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +70 -0
- data/README.md +4 -134
- data/docs/DevcycleApi.md +6 -6
- data/docs/ErrorResponse.md +1 -1
- data/docs/UserData.md +1 -1
- data/examples/sinatra/Gemfile +3 -1
- data/examples/sinatra/Gemfile.lock +16 -13
- data/examples/sinatra/app.rb +2 -1
- data/lib/devcycle-ruby-server-sdk/api/devcycle_api.rb +2 -2
- data/lib/devcycle-ruby-server-sdk/api_client.rb +4 -0
- data/lib/devcycle-ruby-server-sdk/configuration.rb +11 -0
- data/lib/devcycle-ruby-server-sdk/models/feature.rb +31 -1
- data/lib/devcycle-ruby-server-sdk/version.rb +1 -1
- data/spec/api/devcycle_api_spec.rb +1 -1
- data/spec/api_client_spec.rb +17 -0
- data/spec/spec_helper.rb +1 -1
- metadata +7 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b37103165cc47272d718527f01a20fd41e5a4fa851329a1b9ae472d04c561e87
|
4
|
+
data.tar.gz: dc33b920301e236e1f4829c3c5b2bfa811c4c7649146d59719aefb81111bded1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bd9a35095127bfd7e51a9af0894b7d0244e9d8f494566a85b95b71179c1090f79cf4d757d427a98553aaccbc90bbcb1cd8606f0001b3b09f36dedc3629286588
|
7
|
+
data.tar.gz: 5ca612fe98bad4539f5b5d87ac1b3512d0eca2fbb285a3482d5675c1b4cfd52643bd94ff3dbebca585cf5f288e8bb08d7bee5ccee869b45d27e44c08bd472116
|
data/Gemfile.lock
ADDED
@@ -0,0 +1,70 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
devcycle-ruby-server-sdk (1.2.0)
|
5
|
+
typhoeus (~> 1.0, >= 1.0.1)
|
6
|
+
|
7
|
+
GEM
|
8
|
+
remote: https://rubygems.org/
|
9
|
+
specs:
|
10
|
+
ast (2.4.2)
|
11
|
+
byebug (11.1.3)
|
12
|
+
coderay (1.1.3)
|
13
|
+
diff-lcs (1.5.0)
|
14
|
+
ethon (0.15.0)
|
15
|
+
ffi (>= 1.15.0)
|
16
|
+
ffi (1.15.5)
|
17
|
+
jaro_winkler (1.5.4)
|
18
|
+
method_source (1.0.0)
|
19
|
+
parallel (1.22.1)
|
20
|
+
parser (3.1.2.0)
|
21
|
+
ast (~> 2.4.1)
|
22
|
+
pry (0.13.1)
|
23
|
+
coderay (~> 1.1)
|
24
|
+
method_source (~> 1.0)
|
25
|
+
pry-byebug (3.9.0)
|
26
|
+
byebug (~> 11.0)
|
27
|
+
pry (~> 0.13.0)
|
28
|
+
psych (4.0.4)
|
29
|
+
stringio
|
30
|
+
rainbow (3.1.1)
|
31
|
+
rake (13.0.6)
|
32
|
+
rspec (3.11.0)
|
33
|
+
rspec-core (~> 3.11.0)
|
34
|
+
rspec-expectations (~> 3.11.0)
|
35
|
+
rspec-mocks (~> 3.11.0)
|
36
|
+
rspec-core (3.11.0)
|
37
|
+
rspec-support (~> 3.11.0)
|
38
|
+
rspec-expectations (3.11.0)
|
39
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
40
|
+
rspec-support (~> 3.11.0)
|
41
|
+
rspec-mocks (3.11.1)
|
42
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
43
|
+
rspec-support (~> 3.11.0)
|
44
|
+
rspec-support (3.11.0)
|
45
|
+
rubocop (0.66.0)
|
46
|
+
jaro_winkler (~> 1.5.1)
|
47
|
+
parallel (~> 1.10)
|
48
|
+
parser (>= 2.5, != 2.5.1.1)
|
49
|
+
psych (>= 3.1.0)
|
50
|
+
rainbow (>= 2.2.2, < 4.0)
|
51
|
+
ruby-progressbar (~> 1.7)
|
52
|
+
unicode-display_width (>= 1.4.0, < 1.6)
|
53
|
+
ruby-progressbar (1.11.0)
|
54
|
+
stringio (3.0.2)
|
55
|
+
typhoeus (1.4.0)
|
56
|
+
ethon (>= 0.9.0)
|
57
|
+
unicode-display_width (1.5.0)
|
58
|
+
|
59
|
+
PLATFORMS
|
60
|
+
ruby
|
61
|
+
|
62
|
+
DEPENDENCIES
|
63
|
+
devcycle-ruby-server-sdk!
|
64
|
+
pry-byebug
|
65
|
+
rake (~> 13.0.1)
|
66
|
+
rspec (~> 3.6, >= 3.6.0)
|
67
|
+
rubocop (~> 0.66.0)
|
68
|
+
|
69
|
+
BUNDLED WITH
|
70
|
+
1.17.2
|
data/README.md
CHANGED
@@ -1,14 +1,6 @@
|
|
1
|
-
#
|
1
|
+
# DevCycle Ruby Server SDK
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
Documents the DevCycle Bucketing API which provides and API interface to User Bucketing and for generated SDKs.
|
6
|
-
|
7
|
-
This SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
|
8
|
-
|
9
|
-
- API version: 1.0.0
|
10
|
-
- Package version: 1.0.0
|
11
|
-
- Build package: org.openapitools.codegen.languages.RubyClientCodegen
|
3
|
+
Welcome to the the DevCycle Ruby SDK, initially generated via the [DevCycle Bucketing API](https://docs.devcycle.com/bucketing-api/#tag/devcycle).
|
12
4
|
|
13
5
|
## Installation
|
14
6
|
|
@@ -23,7 +15,7 @@ Please follow the [installation](#installation) procedure and then run the follo
|
|
23
15
|
|
24
16
|
```ruby
|
25
17
|
# Load the gem
|
26
|
-
require 'devcycle-server-sdk'
|
18
|
+
require 'devcycle-ruby-server-sdk'
|
27
19
|
|
28
20
|
# Setup authorization
|
29
21
|
DevCycle.configure do |config|
|
@@ -46,126 +38,4 @@ end
|
|
46
38
|
|
47
39
|
## Usage
|
48
40
|
|
49
|
-
|
50
|
-
```ruby
|
51
|
-
# Load the gem
|
52
|
-
require 'devcycle-server-sdk'
|
53
|
-
|
54
|
-
# Setup authorization
|
55
|
-
DevCycle.configure do |config|
|
56
|
-
# Configure API key authorization
|
57
|
-
config.api_key['bearerAuth'] = 'YOUR API KEY'
|
58
|
-
end
|
59
|
-
|
60
|
-
api_instance = DevCycle::DVCClient.new
|
61
|
-
user_data = DevCycle::UserData.new({user_id: 'user_id_example'}) # UserData |
|
62
|
-
```
|
63
|
-
|
64
|
-
### Get all features
|
65
|
-
```ruby
|
66
|
-
begin
|
67
|
-
#Get all features for user data
|
68
|
-
result = api_instance.all_features(user_data)
|
69
|
-
p result
|
70
|
-
rescue DevCycle::ApiError => e
|
71
|
-
puts "Exception when calling DVCClient->all_features: #{e}"
|
72
|
-
end
|
73
|
-
```
|
74
|
-
|
75
|
-
### Get variable by key
|
76
|
-
```ruby
|
77
|
-
begin
|
78
|
-
# Get value of given variable by key, using default value if segmentation is not passed or variable does not exit
|
79
|
-
result = api_instance.variable("variable-key", user_data, true)
|
80
|
-
p "Received value for #{result.key}: #{result.value}"
|
81
|
-
rescue DevCycle::ApiError => e
|
82
|
-
puts "Exception when calling DVCClient->variable: #{e}"
|
83
|
-
end
|
84
|
-
```
|
85
|
-
|
86
|
-
### Get all variables
|
87
|
-
```ruby
|
88
|
-
begin
|
89
|
-
#Get all variables for user data
|
90
|
-
result = api_instance.all_variables(user_data)
|
91
|
-
p result
|
92
|
-
rescue DevCycle::ApiError => e
|
93
|
-
puts "Exception when calling DVCClient->all_variables: #{e}"
|
94
|
-
end
|
95
|
-
```
|
96
|
-
|
97
|
-
### Send events
|
98
|
-
```ruby
|
99
|
-
|
100
|
-
event_data = DevCycle::Event.new({
|
101
|
-
type: "my-event",
|
102
|
-
target: "some_event_target",
|
103
|
-
value: 12,
|
104
|
-
meta_data: {
|
105
|
-
myKey: "my-value"
|
106
|
-
}
|
107
|
-
})
|
108
|
-
|
109
|
-
begin
|
110
|
-
# Post events for given user data
|
111
|
-
result = api_instance.track(user_data, event_data)
|
112
|
-
p result
|
113
|
-
rescue DevCycle::ApiError => e
|
114
|
-
puts "Exception when calling DVCClient->track: #{e}"
|
115
|
-
end
|
116
|
-
```
|
117
|
-
|
118
|
-
### Override Logger
|
119
|
-
To provide a custom logger, override the `logger` property of the SDK configuration.
|
120
|
-
```ruby
|
121
|
-
DevCycle.configure do |config|
|
122
|
-
# Configure API key authorization
|
123
|
-
config.api_key['bearerAuth'] = 'YOUR API KEY'
|
124
|
-
|
125
|
-
# Override the default logger
|
126
|
-
config.logger = MyLogger
|
127
|
-
end
|
128
|
-
```
|
129
|
-
|
130
|
-
### Troubleshooting
|
131
|
-
To see a detailed log of the requests being made to the DevCycle API, enable SDK debug logging:
|
132
|
-
```ruby
|
133
|
-
DevCycle.configure do |config|
|
134
|
-
# Configure API key authorization
|
135
|
-
config.api_key['bearerAuth'] = 'YOUR API KEY'
|
136
|
-
|
137
|
-
# Enable detailed debug logs of requests being sent to the DevCycle API
|
138
|
-
config.debugging = true
|
139
|
-
end
|
140
|
-
```
|
141
|
-
|
142
|
-
|
143
|
-
## Documentation for Models
|
144
|
-
|
145
|
-
- [DevCycle::ErrorResponse](docs/ErrorResponse.md)
|
146
|
-
- [DevCycle::Event](docs/Event.md)
|
147
|
-
- [DevCycle::Feature](docs/Feature.md)
|
148
|
-
- [DevCycle::UserData](docs/UserData.md)
|
149
|
-
- [DevCycle::Variable](docs/Variable.md)
|
150
|
-
|
151
|
-
### Development
|
152
|
-
|
153
|
-
To build the Ruby code into a gem:
|
154
|
-
|
155
|
-
```shell
|
156
|
-
gem build devcycle-ruby-server-sdk.gemspec
|
157
|
-
```
|
158
|
-
|
159
|
-
Then either install the gem locally:
|
160
|
-
|
161
|
-
```shell
|
162
|
-
gem install ./devcycle-ruby-server-sdk-1.0.0.gem
|
163
|
-
```
|
164
|
-
|
165
|
-
(for development, run `gem install --dev ./devcycle-ruby-server-sdk-1.0.0.gem` to install the development dependencies)
|
166
|
-
|
167
|
-
or publish the gem to a gem hosting service, e.g. [RubyGems](https://rubygems.org/).
|
168
|
-
|
169
|
-
Finally add this to the Gemfile:
|
170
|
-
|
171
|
-
gem 'ruby-server-sdk', '~> 1.0.0'
|
41
|
+
To find usage documentation, visit our [docs](https://docs.devcycle.com/docs/sdk/server-side-sdks/ruby#usage).
|
data/docs/DevcycleApi.md
CHANGED
@@ -20,7 +20,7 @@ Get all features by key for user data
|
|
20
20
|
|
21
21
|
```ruby
|
22
22
|
require 'time'
|
23
|
-
require 'devcycle-server-sdk'
|
23
|
+
require 'devcycle-ruby-server-sdk'
|
24
24
|
# setup authorization
|
25
25
|
DevCycle.configure do |config|
|
26
26
|
# Configure API key authorization: bearerAuth
|
@@ -81,7 +81,7 @@ end
|
|
81
81
|
|
82
82
|
## variable
|
83
83
|
|
84
|
-
> <Variable> variable(
|
84
|
+
> <Variable> variable(user_data, key)
|
85
85
|
|
86
86
|
Get variable by key for user data
|
87
87
|
|
@@ -89,7 +89,7 @@ Get variable by key for user data
|
|
89
89
|
|
90
90
|
```ruby
|
91
91
|
require 'time'
|
92
|
-
require 'devcycle-server-sdk'
|
92
|
+
require 'devcycle-ruby-server-sdk'
|
93
93
|
# setup authorization
|
94
94
|
DevCycle.configure do |config|
|
95
95
|
# Configure API key authorization: bearerAuth
|
@@ -104,7 +104,7 @@ user_data = DevCycle::UserData.new({user_id: 'user_id_example'}) # UserData |
|
|
104
104
|
|
105
105
|
begin
|
106
106
|
# Get variable by key for user data
|
107
|
-
result = api_instance.variable(
|
107
|
+
result = api_instance.variable(user_data, key)
|
108
108
|
p result
|
109
109
|
rescue DevCycle::ApiError => e
|
110
110
|
puts "Error when calling DevcycleApi->variable: #{e}"
|
@@ -160,7 +160,7 @@ Get all variables by key for user data
|
|
160
160
|
|
161
161
|
```ruby
|
162
162
|
require 'time'
|
163
|
-
require 'devcycle-server-sdk'
|
163
|
+
require 'devcycle-ruby-server-sdk'
|
164
164
|
# setup authorization
|
165
165
|
DevCycle.configure do |config|
|
166
166
|
# Configure API key authorization: bearerAuth
|
@@ -229,7 +229,7 @@ Post events to DevCycle for user
|
|
229
229
|
|
230
230
|
```ruby
|
231
231
|
require 'time'
|
232
|
-
require 'devcycle-server-sdk'
|
232
|
+
require 'devcycle-ruby-server-sdk'
|
233
233
|
# setup authorization
|
234
234
|
DevCycle.configure do |config|
|
235
235
|
# Configure API key authorization: bearerAuth
|
data/docs/ErrorResponse.md
CHANGED
data/docs/UserData.md
CHANGED
data/examples/sinatra/Gemfile
CHANGED
@@ -1,3 +1,9 @@
|
|
1
|
+
PATH
|
2
|
+
remote: ../..
|
3
|
+
specs:
|
4
|
+
devcycle-ruby-server-sdk (1.2.0)
|
5
|
+
typhoeus (~> 1.0, >= 1.0.1)
|
6
|
+
|
1
7
|
GEM
|
2
8
|
remote: https://rubygems.org/
|
3
9
|
specs:
|
@@ -5,26 +11,24 @@ GEM
|
|
5
11
|
ethon (0.15.0)
|
6
12
|
ffi (>= 1.15.0)
|
7
13
|
eventmachine (1.2.7)
|
8
|
-
ffi (1.15.
|
14
|
+
ffi (1.15.5)
|
9
15
|
multi_json (1.15.0)
|
10
16
|
mustermann (1.1.1)
|
11
17
|
ruby2_keywords (~> 0.0.1)
|
12
18
|
rack (2.2.3)
|
13
|
-
rack-protection (2.
|
19
|
+
rack-protection (2.2.0)
|
14
20
|
rack
|
15
|
-
ruby-server-sdk (1.0.1)
|
16
|
-
typhoeus (~> 1.0, >= 1.0.1)
|
17
21
|
ruby2_keywords (0.0.5)
|
18
|
-
sinatra (2.
|
22
|
+
sinatra (2.2.0)
|
19
23
|
mustermann (~> 1.0)
|
20
24
|
rack (~> 2.2)
|
21
|
-
rack-protection (= 2.
|
25
|
+
rack-protection (= 2.2.0)
|
22
26
|
tilt (~> 2.0)
|
23
|
-
sinatra-contrib (2.
|
27
|
+
sinatra-contrib (2.2.0)
|
24
28
|
multi_json
|
25
29
|
mustermann (~> 1.0)
|
26
|
-
rack-protection (= 2.
|
27
|
-
sinatra (= 2.
|
30
|
+
rack-protection (= 2.2.0)
|
31
|
+
sinatra (= 2.2.0)
|
28
32
|
tilt (~> 2.0)
|
29
33
|
thin (1.8.1)
|
30
34
|
daemons (~> 1.0, >= 1.0.9)
|
@@ -35,14 +39,13 @@ GEM
|
|
35
39
|
ethon (>= 0.9.0)
|
36
40
|
|
37
41
|
PLATFORMS
|
38
|
-
|
39
|
-
x86_64-darwin-19
|
42
|
+
ruby
|
40
43
|
|
41
44
|
DEPENDENCIES
|
42
|
-
ruby-server-sdk
|
45
|
+
devcycle-ruby-server-sdk!
|
43
46
|
sinatra
|
44
47
|
sinatra-contrib
|
45
48
|
thin
|
46
49
|
|
47
50
|
BUNDLED WITH
|
48
|
-
|
51
|
+
1.17.3
|
data/examples/sinatra/app.rb
CHANGED
@@ -12,6 +12,7 @@ DevCycle.configure do |config|
|
|
12
12
|
# Configure API key authorization: bearerAuth
|
13
13
|
config.api_key['bearerAuth'] = token
|
14
14
|
# config.debugging = true
|
15
|
+
config.enable_edge_db = false
|
15
16
|
end
|
16
17
|
|
17
18
|
api_instance = DevCycle::DVCClient.new
|
@@ -25,7 +26,7 @@ get '/' do
|
|
25
26
|
end
|
26
27
|
|
27
28
|
get '/experiment' do
|
28
|
-
result = api_instance.variable("test-feature",
|
29
|
+
result = api_instance.variable(user_data, "test-feature", false)
|
29
30
|
p result
|
30
31
|
|
31
32
|
"Your variable result is: #{result.value}"
|
@@ -98,12 +98,12 @@ module DevCycle
|
|
98
98
|
end
|
99
99
|
|
100
100
|
# Get variable by key for user data
|
101
|
-
# @param key [String] Variable key
|
102
101
|
# @param user_data [UserData]
|
102
|
+
# @param key [String] Variable key
|
103
103
|
# @param default Default value for variable if none is retrieved
|
104
104
|
# @param [Hash] opts the optional parameters
|
105
105
|
# @return [Variable]
|
106
|
-
def variable(
|
106
|
+
def variable(user_data, key, default, opts = {})
|
107
107
|
if !user_data.is_a?(DevCycle::UserData)
|
108
108
|
fail ArgumentError, "user_data param must be an instance of UserData!"
|
109
109
|
end
|
@@ -94,6 +94,10 @@ module DevCycle
|
|
94
94
|
query_params = opts[:query_params] || {}
|
95
95
|
form_params = opts[:form_params] || {}
|
96
96
|
|
97
|
+
if @config.enable_edge_db
|
98
|
+
query_params.store("enableEdgeDB", true)
|
99
|
+
end
|
100
|
+
|
97
101
|
update_params_for_auth! header_params, query_params, opts[:auth_names]
|
98
102
|
|
99
103
|
# set ssl_verifyhosts option based on @config.verify_ssl_host (true/false)
|
@@ -137,6 +137,10 @@ module DevCycle
|
|
137
137
|
|
138
138
|
attr_accessor :force_ending_format
|
139
139
|
|
140
|
+
# Define if EdgeDB is Enabled (Boolean)
|
141
|
+
# Default to false
|
142
|
+
attr_accessor :enable_edge_db
|
143
|
+
|
140
144
|
def initialize
|
141
145
|
@scheme = 'https'
|
142
146
|
@host = 'bucketing-api.devcycle.com'
|
@@ -158,6 +162,7 @@ module DevCycle
|
|
158
162
|
@inject_format = false
|
159
163
|
@force_ending_format = false
|
160
164
|
@logger = defined?(Rails) ? Rails.logger : Logger.new(STDOUT)
|
165
|
+
@enable_edge_db = false
|
161
166
|
|
162
167
|
yield(self) if block_given?
|
163
168
|
end
|
@@ -274,5 +279,11 @@ module DevCycle
|
|
274
279
|
url
|
275
280
|
end
|
276
281
|
|
282
|
+
def enable_edge_db=(enable_edge_db = false)
|
283
|
+
if(enable_edge_db)
|
284
|
+
@enable_edge_db = true
|
285
|
+
end
|
286
|
+
end
|
287
|
+
|
277
288
|
end
|
278
289
|
end
|
@@ -27,6 +27,12 @@ module DevCycle
|
|
27
27
|
# Bucketed feature variation
|
28
28
|
attr_accessor :_variation
|
29
29
|
|
30
|
+
# Bucketed feature variation key
|
31
|
+
attr_accessor :variationKey
|
32
|
+
|
33
|
+
# Bucketed feature variation name
|
34
|
+
attr_accessor :variationName
|
35
|
+
|
30
36
|
# Evaluation reasoning
|
31
37
|
attr_accessor :eval_reason
|
32
38
|
|
@@ -59,6 +65,8 @@ module DevCycle
|
|
59
65
|
:'key' => :'key',
|
60
66
|
:'type' => :'type',
|
61
67
|
:'_variation' => :'_variation',
|
68
|
+
:'variationKey' => :'variationKey',
|
69
|
+
:'variationName' => :'variationName',
|
62
70
|
:'eval_reason' => :'evalReason'
|
63
71
|
}
|
64
72
|
end
|
@@ -75,6 +83,8 @@ module DevCycle
|
|
75
83
|
:'key' => :'String',
|
76
84
|
:'type' => :'String',
|
77
85
|
:'_variation' => :'String',
|
86
|
+
:'variationKey' => :'String',
|
87
|
+
:'variationName' => :'String',
|
78
88
|
:'eval_reason' => :'String'
|
79
89
|
}
|
80
90
|
end
|
@@ -116,6 +126,14 @@ module DevCycle
|
|
116
126
|
self._variation = attributes[:'_variation']
|
117
127
|
end
|
118
128
|
|
129
|
+
if attributes.key?(:'variationKey')
|
130
|
+
self.variationKey = attributes[:'variationKey']
|
131
|
+
end
|
132
|
+
|
133
|
+
if attributes.key?(:'variationName')
|
134
|
+
self.variationName = attributes[:'variationName']
|
135
|
+
end
|
136
|
+
|
119
137
|
if attributes.key?(:'eval_reason')
|
120
138
|
self.eval_reason = attributes[:'eval_reason']
|
121
139
|
end
|
@@ -141,6 +159,14 @@ module DevCycle
|
|
141
159
|
invalid_properties.push('invalid value for "_variation", _variation cannot be nil.')
|
142
160
|
end
|
143
161
|
|
162
|
+
if @variationKey.nil?
|
163
|
+
invalid_properties.push('invalid value for "variationKey", variationKey cannot be nil.')
|
164
|
+
end
|
165
|
+
|
166
|
+
if @variationName.nil?
|
167
|
+
invalid_properties.push('invalid value for "variationName", variationName cannot be nil.')
|
168
|
+
end
|
169
|
+
|
144
170
|
invalid_properties
|
145
171
|
end
|
146
172
|
|
@@ -153,6 +179,8 @@ module DevCycle
|
|
153
179
|
type_validator = EnumAttributeValidator.new('String', ["release", "experiment", "permission", "ops"])
|
154
180
|
return false unless type_validator.valid?(@type)
|
155
181
|
return false if @_variation.nil?
|
182
|
+
return false if @variationKey.nil?
|
183
|
+
return false if @variationName.nil?
|
156
184
|
true
|
157
185
|
end
|
158
186
|
|
@@ -175,6 +203,8 @@ module DevCycle
|
|
175
203
|
key == o.key &&
|
176
204
|
type == o.type &&
|
177
205
|
_variation == o._variation &&
|
206
|
+
variationKey == o.variationKey &&
|
207
|
+
variationName == o.variationName &&
|
178
208
|
eval_reason == o.eval_reason
|
179
209
|
end
|
180
210
|
|
@@ -187,7 +217,7 @@ module DevCycle
|
|
187
217
|
# Calculates hash code according to all attributes.
|
188
218
|
# @return [Integer] Hash code
|
189
219
|
def hash
|
190
|
-
[_id, key, type, _variation, eval_reason].hash
|
220
|
+
[_id, key, type, _variation, variationKey, variationName, eval_reason].hash
|
191
221
|
end
|
192
222
|
|
193
223
|
# Builds the object from hash
|
@@ -63,7 +63,7 @@ describe 'DVCClient' do
|
|
63
63
|
# @return [Variable]
|
64
64
|
describe 'get_variable_by_key test' do
|
65
65
|
it 'should work' do
|
66
|
-
result = @api_instance.variable("activate-flag",
|
66
|
+
result = @api_instance.variable(@user_data, "activate-flag", false)
|
67
67
|
|
68
68
|
expect(result.isDefaulted).to eq false
|
69
69
|
end
|
data/spec/api_client_spec.rb
CHANGED
@@ -49,6 +49,23 @@ describe DevCycle::ApiClient do
|
|
49
49
|
end
|
50
50
|
end
|
51
51
|
end
|
52
|
+
|
53
|
+
context 'Enabled Edge DB' do
|
54
|
+
it 'defaults the enable_edge_db value to false when no value is provided' do
|
55
|
+
DevCycle.configure { }
|
56
|
+
expect(DevCycle::Configuration.default.enable_edge_db).to eq(false)
|
57
|
+
end
|
58
|
+
|
59
|
+
it 'sets the enable_edge_db value to false when false is provided' do
|
60
|
+
DevCycle.configure { |c| c.enable_edge_db = false }
|
61
|
+
expect(DevCycle::Configuration.default.enable_edge_db).to eq(false)
|
62
|
+
end
|
63
|
+
|
64
|
+
it 'sets the enable_edge_db value to true when true is provided' do
|
65
|
+
DevCycle.configure { |c| c.enable_edge_db = true }
|
66
|
+
expect(DevCycle::Configuration.default.enable_edge_db).to eq(true)
|
67
|
+
end
|
68
|
+
end
|
52
69
|
end
|
53
70
|
|
54
71
|
describe 'params_encoding in #build_request' do
|
data/spec/spec_helper.rb
CHANGED
@@ -11,7 +11,7 @@ OpenAPI Generator version: 5.3.0
|
|
11
11
|
=end
|
12
12
|
|
13
13
|
# load the gem
|
14
|
-
require 'devcycle-server-sdk'
|
14
|
+
require 'devcycle-ruby-server-sdk'
|
15
15
|
|
16
16
|
# The following was generated by the `rspec --init` command. Conventionally, all
|
17
17
|
# specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
|
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: 1.
|
4
|
+
version: 1.2.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:
|
11
|
+
date: 2022-06-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: typhoeus
|
@@ -59,6 +59,7 @@ extensions: []
|
|
59
59
|
extra_rdoc_files: []
|
60
60
|
files:
|
61
61
|
- Gemfile
|
62
|
+
- Gemfile.lock
|
62
63
|
- LICENSE
|
63
64
|
- README.md
|
64
65
|
- Rakefile
|
@@ -95,7 +96,7 @@ homepage: https://devcycle.com
|
|
95
96
|
licenses:
|
96
97
|
- MIT
|
97
98
|
metadata: {}
|
98
|
-
post_install_message:
|
99
|
+
post_install_message:
|
99
100
|
rdoc_options: []
|
100
101
|
require_paths:
|
101
102
|
- lib
|
@@ -110,8 +111,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
110
111
|
- !ruby/object:Gem::Version
|
111
112
|
version: '0'
|
112
113
|
requirements: []
|
113
|
-
rubygems_version: 3.0.3
|
114
|
-
signing_key:
|
114
|
+
rubygems_version: 3.0.3.1
|
115
|
+
signing_key:
|
115
116
|
specification_version: 4
|
116
117
|
summary: DevCycle Bucketing API Ruby Gem
|
117
118
|
test_files:
|