launchdarkly-server-sdk 6.1.0 → 6.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.circleci/config.yml +1 -1
- data/.github/ISSUE_TEMPLATE/bug_report.md +1 -1
- data/.github/ISSUE_TEMPLATE/config.yml +5 -0
- data/.gitignore +1 -0
- data/CHANGELOG.md +5 -0
- data/azure-pipelines.yml +1 -1
- data/lib/ldclient-rb/events.rb +3 -3
- data/lib/ldclient-rb/ldclient.rb +6 -7
- data/lib/ldclient-rb/version.rb +1 -1
- data/spec/ldclient_spec.rb +11 -11
- metadata +3 -3
- data/Gemfile.lock +0 -116
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 631066b2968b323ed2e12aed1565c76cf1f8bb6284e8372121771577b49bda18
|
4
|
+
data.tar.gz: 3e6b7c3b9769c917996e844c598796912f19c20e796692b877a885886d8fa070
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5a885a5714a9cc157e295dd1a88a353a546847a702a771b4edf49f33c081eb19c4141ee7a0b4a8004620c1a4c20ef0111af0c0900ee3a28845f29e2385ebd13c
|
7
|
+
data.tar.gz: 6e604eac4e997431d09257bf97ec115f3a130293e4bc83fa08254baaa921eb28a2230e5bc2bd080c855293e773331e5eed006741db6cd9943132a1f2a1dc243d
|
data/.circleci/config.yml
CHANGED
@@ -8,7 +8,7 @@ assignees: ''
|
|
8
8
|
---
|
9
9
|
|
10
10
|
**Is this a support request?**
|
11
|
-
This issue tracker is maintained by LaunchDarkly SDK developers and is intended for feedback on the SDK code. If you're not sure whether the problem you are having is specifically related to the SDK, or to the LaunchDarkly service overall, it may be more appropriate to contact the LaunchDarkly support team; they can help to investigate the problem and will consult the SDK team if necessary. You can submit a support request by going [here](https://support.launchdarkly.com/)
|
11
|
+
This issue tracker is maintained by LaunchDarkly SDK developers and is intended for feedback on the SDK code. If you're not sure whether the problem you are having is specifically related to the SDK, or to the LaunchDarkly service overall, it may be more appropriate to contact the LaunchDarkly support team; they can help to investigate the problem and will consult the SDK team if necessary. You can submit a support request by going [here](https://support.launchdarkly.com/hc/en-us/requests/new) or by emailing support@launchdarkly.com.
|
12
12
|
|
13
13
|
Note that issues filed on this issue tracker are publicly accessible. Do not provide any private account information on your issues. If your problem is specific to your account, you should submit a support request as described above.
|
14
14
|
|
data/.gitignore
CHANGED
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,11 @@
|
|
2
2
|
|
3
3
|
All notable changes to the LaunchDarkly Ruby SDK will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org).
|
4
4
|
|
5
|
+
## [6.1.0] - 2021-02-04
|
6
|
+
### Added:
|
7
|
+
- Added the `alias` method. This can be used to associate two user objects for analytics purposes by generating an alias event.
|
8
|
+
|
9
|
+
|
5
10
|
## [6.0.0] - 2021-01-26
|
6
11
|
### Added:
|
7
12
|
- Added a `socket_factory` configuration option which can be used for socket creation by the HTTP client if provided. The value of `socket_factory` must be an object providing an `open(uri, timeout)` method and returning a connected socket.
|
data/azure-pipelines.yml
CHANGED
@@ -45,7 +45,7 @@ jobs:
|
|
45
45
|
workingDirectory: $(System.DefaultWorkingDirectory)
|
46
46
|
script: |
|
47
47
|
ruby -v
|
48
|
-
gem install bundler
|
48
|
+
gem install bundler
|
49
49
|
bundle install
|
50
50
|
mkdir rspec
|
51
51
|
bundle exec rspec --format progress --format RspecJunitFormatter -o ./rspec/rspec.xml spec
|
data/lib/ldclient-rb/events.rb
CHANGED
@@ -443,7 +443,7 @@ module LaunchDarkly
|
|
443
443
|
if @inline_users || is_debug
|
444
444
|
out[:user] = process_user(event)
|
445
445
|
else
|
446
|
-
out[:userKey] = event[:user]
|
446
|
+
out[:userKey] = event[:user][:key]
|
447
447
|
end
|
448
448
|
out[:reason] = event[:reason] if !event[:reason].nil?
|
449
449
|
out
|
@@ -451,7 +451,7 @@ module LaunchDarkly
|
|
451
451
|
{
|
452
452
|
kind: "identify",
|
453
453
|
creationDate: event[:creationDate],
|
454
|
-
key: event[:user]
|
454
|
+
key: event[:user][:key].to_s,
|
455
455
|
user: process_user(event)
|
456
456
|
}
|
457
457
|
when "custom"
|
@@ -464,7 +464,7 @@ module LaunchDarkly
|
|
464
464
|
if @inline_users
|
465
465
|
out[:user] = process_user(event)
|
466
466
|
else
|
467
|
-
out[:userKey] = event[:user]
|
467
|
+
out[:userKey] = event[:user][:key]
|
468
468
|
end
|
469
469
|
out[:metricValue] = event[:metricValue] if event.has_key?(:metricValue)
|
470
470
|
out[:contextKind] = event[:contextKind] if event.has_key?(:contextKind)
|
data/lib/ldclient-rb/ldclient.rb
CHANGED
@@ -401,6 +401,12 @@ module LaunchDarkly
|
|
401
401
|
return Evaluator.error_result(EvaluationReason::ERROR_CLIENT_NOT_READY, default)
|
402
402
|
end
|
403
403
|
|
404
|
+
unless user
|
405
|
+
@config.logger.error { "[LDClient] Must specify user" }
|
406
|
+
detail = Evaluator.error_result(EvaluationReason::ERROR_USER_NOT_SPECIFIED, default)
|
407
|
+
return detail
|
408
|
+
end
|
409
|
+
|
404
410
|
if !initialized?
|
405
411
|
if @store.initialized?
|
406
412
|
@config.logger.warn { "[LDClient] Client has not finished initializing; using last known values from feature store" }
|
@@ -421,13 +427,6 @@ module LaunchDarkly
|
|
421
427
|
return detail
|
422
428
|
end
|
423
429
|
|
424
|
-
unless user
|
425
|
-
@config.logger.error { "[LDClient] Must specify user" }
|
426
|
-
detail = Evaluator.error_result(EvaluationReason::ERROR_USER_NOT_SPECIFIED, default)
|
427
|
-
@event_processor.add_event(event_factory.new_default_event(feature, user, default, detail.reason))
|
428
|
-
return detail
|
429
|
-
end
|
430
|
-
|
431
430
|
begin
|
432
431
|
res = @evaluator.evaluate(feature, user, event_factory)
|
433
432
|
if !res.events.nil?
|
data/lib/ldclient-rb/version.rb
CHANGED
data/spec/ldclient_spec.rb
CHANGED
@@ -145,19 +145,11 @@ describe LaunchDarkly::LDClient do
|
|
145
145
|
client.variation("key", user, "default")
|
146
146
|
end
|
147
147
|
|
148
|
-
it "
|
148
|
+
it "does not send an event if user is nil" do
|
149
149
|
config.feature_store.init({ LaunchDarkly::FEATURES => {} })
|
150
150
|
config.feature_store.upsert(LaunchDarkly::FEATURES, feature_with_value)
|
151
|
-
expect(event_processor).
|
152
|
-
|
153
|
-
key: "key",
|
154
|
-
version: 100,
|
155
|
-
user: nil,
|
156
|
-
value: "default",
|
157
|
-
default: "default",
|
158
|
-
trackEvents: true,
|
159
|
-
debugEventsUntilDate: 1000
|
160
|
-
))
|
151
|
+
expect(event_processor).not_to receive(:add_event)
|
152
|
+
expect(logger).to receive(:error)
|
161
153
|
client.variation("key", nil, "default")
|
162
154
|
end
|
163
155
|
|
@@ -313,6 +305,14 @@ describe LaunchDarkly::LDClient do
|
|
313
305
|
))
|
314
306
|
client.variation_detail("key", user, "default")
|
315
307
|
end
|
308
|
+
|
309
|
+
it "does not send an event if user is nil" do
|
310
|
+
config.feature_store.init({ LaunchDarkly::FEATURES => {} })
|
311
|
+
config.feature_store.upsert(LaunchDarkly::FEATURES, feature_with_value)
|
312
|
+
expect(event_processor).not_to receive(:add_event)
|
313
|
+
expect(logger).to receive(:error)
|
314
|
+
client.variation_detail("key", nil, "default")
|
315
|
+
end
|
316
316
|
end
|
317
317
|
|
318
318
|
describe '#all_flags' do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: launchdarkly-server-sdk
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 6.1.
|
4
|
+
version: 6.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- LaunchDarkly
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-05-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aws-sdk-dynamodb
|
@@ -243,6 +243,7 @@ extra_rdoc_files: []
|
|
243
243
|
files:
|
244
244
|
- ".circleci/config.yml"
|
245
245
|
- ".github/ISSUE_TEMPLATE/bug_report.md"
|
246
|
+
- ".github/ISSUE_TEMPLATE/config.yml"
|
246
247
|
- ".github/ISSUE_TEMPLATE/feature_request.md"
|
247
248
|
- ".github/pull_request_template.md"
|
248
249
|
- ".gitignore"
|
@@ -264,7 +265,6 @@ files:
|
|
264
265
|
- CODEOWNERS
|
265
266
|
- CONTRIBUTING.md
|
266
267
|
- Gemfile
|
267
|
-
- Gemfile.lock
|
268
268
|
- LICENSE.txt
|
269
269
|
- README.md
|
270
270
|
- azure-pipelines.yml
|
data/Gemfile.lock
DELETED
@@ -1,116 +0,0 @@
|
|
1
|
-
PATH
|
2
|
-
remote: .
|
3
|
-
specs:
|
4
|
-
launchdarkly-server-sdk (6.1.0)
|
5
|
-
concurrent-ruby (~> 1.1)
|
6
|
-
http (~> 4.4.1)
|
7
|
-
json (~> 2.3.1)
|
8
|
-
ld-eventsource (~> 2.0)
|
9
|
-
semantic (~> 1.6)
|
10
|
-
|
11
|
-
GEM
|
12
|
-
remote: https://rubygems.org/
|
13
|
-
specs:
|
14
|
-
addressable (2.7.0)
|
15
|
-
public_suffix (>= 2.0.2, < 5.0)
|
16
|
-
ansi (1.5.0)
|
17
|
-
ast (2.4.2)
|
18
|
-
aws-eventstream (1.1.0)
|
19
|
-
aws-partitions (1.418.0)
|
20
|
-
aws-sdk-core (3.111.2)
|
21
|
-
aws-eventstream (~> 1, >= 1.0.2)
|
22
|
-
aws-partitions (~> 1, >= 1.239.0)
|
23
|
-
aws-sigv4 (~> 1.1)
|
24
|
-
jmespath (~> 1.0)
|
25
|
-
aws-sdk-dynamodb (1.58.0)
|
26
|
-
aws-sdk-core (~> 3, >= 3.109.0)
|
27
|
-
aws-sigv4 (~> 1.1)
|
28
|
-
aws-sigv4 (1.2.2)
|
29
|
-
aws-eventstream (~> 1, >= 1.0.2)
|
30
|
-
concurrent-ruby (1.1.8)
|
31
|
-
connection_pool (2.2.3)
|
32
|
-
deep_merge (1.2.1)
|
33
|
-
diff-lcs (1.4.4)
|
34
|
-
diplomat (2.4.2)
|
35
|
-
deep_merge (~> 1.0, >= 1.0.1)
|
36
|
-
faraday (>= 0.9, < 1.1.0)
|
37
|
-
domain_name (0.5.20190701)
|
38
|
-
unf (>= 0.0.5, < 1.0.0)
|
39
|
-
faraday (1.0.1)
|
40
|
-
multipart-post (>= 1.2, < 3)
|
41
|
-
ffi (1.14.2)
|
42
|
-
ffi-compiler (1.0.1)
|
43
|
-
ffi (>= 1.0.0)
|
44
|
-
rake
|
45
|
-
http (4.4.1)
|
46
|
-
addressable (~> 2.3)
|
47
|
-
http-cookie (~> 1.0)
|
48
|
-
http-form_data (~> 2.2)
|
49
|
-
http-parser (~> 1.2.0)
|
50
|
-
http-cookie (1.0.3)
|
51
|
-
domain_name (~> 0.5)
|
52
|
-
http-form_data (2.3.0)
|
53
|
-
http-parser (1.2.3)
|
54
|
-
ffi-compiler (>= 1.0, < 2.0)
|
55
|
-
jmespath (1.4.0)
|
56
|
-
json (2.3.1)
|
57
|
-
ld-eventsource (2.0.0)
|
58
|
-
concurrent-ruby (~> 1.0)
|
59
|
-
http (~> 4.4.1)
|
60
|
-
listen (3.4.1)
|
61
|
-
rb-fsevent (~> 0.10, >= 0.10.3)
|
62
|
-
rb-inotify (~> 0.9, >= 0.9.10)
|
63
|
-
multipart-post (2.1.1)
|
64
|
-
oga (2.15)
|
65
|
-
ast
|
66
|
-
ruby-ll (~> 2.1)
|
67
|
-
public_suffix (4.0.6)
|
68
|
-
rake (13.0.3)
|
69
|
-
rb-fsevent (0.10.4)
|
70
|
-
rb-inotify (0.10.1)
|
71
|
-
ffi (~> 1.0)
|
72
|
-
redis (4.2.5)
|
73
|
-
rspec (3.10.0)
|
74
|
-
rspec-core (~> 3.10.0)
|
75
|
-
rspec-expectations (~> 3.10.0)
|
76
|
-
rspec-mocks (~> 3.10.0)
|
77
|
-
rspec-core (3.10.1)
|
78
|
-
rspec-support (~> 3.10.0)
|
79
|
-
rspec-expectations (3.10.1)
|
80
|
-
diff-lcs (>= 1.2.0, < 2.0)
|
81
|
-
rspec-support (~> 3.10.0)
|
82
|
-
rspec-mocks (3.10.1)
|
83
|
-
diff-lcs (>= 1.2.0, < 2.0)
|
84
|
-
rspec-support (~> 3.10.0)
|
85
|
-
rspec-support (3.10.1)
|
86
|
-
rspec_junit_formatter (0.4.1)
|
87
|
-
rspec-core (>= 2, < 4, != 2.12.0)
|
88
|
-
ruby-ll (2.1.2)
|
89
|
-
ansi
|
90
|
-
ast
|
91
|
-
semantic (1.6.1)
|
92
|
-
timecop (0.9.2)
|
93
|
-
unf (0.1.4)
|
94
|
-
unf_ext
|
95
|
-
unf_ext (0.0.7.7)
|
96
|
-
webrick (1.7.0)
|
97
|
-
|
98
|
-
PLATFORMS
|
99
|
-
ruby
|
100
|
-
|
101
|
-
DEPENDENCIES
|
102
|
-
aws-sdk-dynamodb (~> 1.57)
|
103
|
-
bundler (~> 2.1)
|
104
|
-
connection_pool (~> 2.2.3)
|
105
|
-
diplomat (~> 2.4.2)
|
106
|
-
launchdarkly-server-sdk!
|
107
|
-
listen (~> 3.3)
|
108
|
-
oga (~> 2.2)
|
109
|
-
redis (~> 4.2)
|
110
|
-
rspec (~> 3.10)
|
111
|
-
rspec_junit_formatter (~> 0.4)
|
112
|
-
timecop (~> 0.9)
|
113
|
-
webrick (~> 1.7)
|
114
|
-
|
115
|
-
BUNDLED WITH
|
116
|
-
2.2.8
|