launchdarkly-openfeature-server-sdk 0.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.release-please-manifest.json +3 -0
- data/.rspec +2 -0
- data/.rubocop.yml +902 -0
- data/Gemfile +10 -0
- data/LICENSE.txt +13 -0
- data/README.md +173 -0
- data/Rakefile +12 -0
- data/launchdarkly-openfeature-server-sdk.gemspec +30 -0
- data/lib/ldclient-openfeature/version.rb +7 -0
- data/lib/ldclient-openfeature.rb +13 -0
- metadata +55 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 1120d07e2dfc8caa553538ee9e81a28c0d8e49086251f5b267f6b7a81713beb8
|
4
|
+
data.tar.gz: aae128996f603273d9ca9eb4ea1dba80a5b14f67f027cf20840b87abb2973aca
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 7fe4363d6defdd32fa8ee9c1cd829d59d8945f7af4a2bd43532da96580d50a2d6068a2d116f954c418e89ba4acaef5fc793f44d84ca0374f98fd139941238fd1
|
7
|
+
data.tar.gz: 4e22e388a089408a98fab7ffffb299df6669749a5a2e6e0fc5db4e4b8c5f079ff7612709ca3d525df6f5b772a27357ff737287c77433a07da84275c8fe9cb25e
|
data/.rspec
ADDED
data/.rubocop.yml
ADDED
@@ -0,0 +1,902 @@
|
|
1
|
+
require:
|
2
|
+
- rubocop-performance
|
3
|
+
- rubocop-rake
|
4
|
+
- rubocop-rspec
|
5
|
+
|
6
|
+
AllCops:
|
7
|
+
TargetRubyVersion: 3.1
|
8
|
+
Include:
|
9
|
+
- lib/**/*.rb
|
10
|
+
- spec/**/*.rb
|
11
|
+
NewCops: disable
|
12
|
+
|
13
|
+
Naming/AccessorMethodName:
|
14
|
+
Description: Check the naming of accessor methods for get_/set_.
|
15
|
+
Enabled: false
|
16
|
+
|
17
|
+
Style/AccessModifierDeclarations:
|
18
|
+
Description: 'Access modifiers should be declared to apply to a group of methods or inline before each method, depending on configuration.'
|
19
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#alias-method'
|
20
|
+
Enabled: false
|
21
|
+
|
22
|
+
Style/Alias:
|
23
|
+
Description: 'Use alias_method instead of alias.'
|
24
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#alias-method'
|
25
|
+
Enabled: false
|
26
|
+
|
27
|
+
Style/ArrayJoin:
|
28
|
+
Description: 'Use Array#join instead of Array#*.'
|
29
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#array-join'
|
30
|
+
Enabled: false
|
31
|
+
|
32
|
+
Style/AsciiComments:
|
33
|
+
Description: 'Use only ascii symbols in comments.'
|
34
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#english-comments'
|
35
|
+
Enabled: false
|
36
|
+
|
37
|
+
Naming/AsciiIdentifiers:
|
38
|
+
Description: 'Use only ascii symbols in identifiers.'
|
39
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#english-identifiers'
|
40
|
+
Enabled: false
|
41
|
+
|
42
|
+
Naming/VariableName:
|
43
|
+
Description: 'Makes sure that all variables use the configured style, snake_case or camelCase, for their names.'
|
44
|
+
Enabled: false
|
45
|
+
|
46
|
+
Style/Attr:
|
47
|
+
Description: 'Checks for uses of Module#attr.'
|
48
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#attr'
|
49
|
+
Enabled: false
|
50
|
+
|
51
|
+
Metrics/AbcSize:
|
52
|
+
Description: 'Checks that the ABC size of methods is not higher than the configured maximum.'
|
53
|
+
Enabled: false
|
54
|
+
|
55
|
+
Metrics/BlockLength:
|
56
|
+
Description: 'Checks if the length of a block exceeds some maximum value.'
|
57
|
+
Enabled: false
|
58
|
+
|
59
|
+
Metrics/BlockNesting:
|
60
|
+
Description: 'Avoid excessive block nesting'
|
61
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#three-is-the-number-thou-shalt-count'
|
62
|
+
Enabled: false
|
63
|
+
|
64
|
+
Style/CaseEquality:
|
65
|
+
Description: 'Avoid explicit use of the case equality operator(===).'
|
66
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-case-equality'
|
67
|
+
Enabled: false
|
68
|
+
|
69
|
+
Style/CharacterLiteral:
|
70
|
+
Description: 'Checks for uses of character literals.'
|
71
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-character-literals'
|
72
|
+
Enabled: false
|
73
|
+
|
74
|
+
Style/ClassAndModuleChildren:
|
75
|
+
Description: 'Checks style of children classes and modules.'
|
76
|
+
Enabled: true
|
77
|
+
EnforcedStyle: nested
|
78
|
+
|
79
|
+
Metrics/ClassLength:
|
80
|
+
Description: 'Avoid classes longer than 100 lines of code.'
|
81
|
+
Enabled: false
|
82
|
+
|
83
|
+
Metrics/ModuleLength:
|
84
|
+
Description: 'Avoid modules longer than 100 lines of code.'
|
85
|
+
Enabled: false
|
86
|
+
|
87
|
+
Style/ClassVars:
|
88
|
+
Description: 'Avoid the use of class variables.'
|
89
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-class-vars'
|
90
|
+
Enabled: false
|
91
|
+
|
92
|
+
Style/CollectionMethods:
|
93
|
+
Enabled: true
|
94
|
+
PreferredMethods:
|
95
|
+
find: detect
|
96
|
+
inject: reduce
|
97
|
+
collect: map
|
98
|
+
find_all: select
|
99
|
+
|
100
|
+
Style/ColonMethodCall:
|
101
|
+
Description: 'Do not use :: for method call.'
|
102
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#double-colons'
|
103
|
+
Enabled: false
|
104
|
+
|
105
|
+
Style/CommentAnnotation:
|
106
|
+
Description: >-
|
107
|
+
Checks formatting of special comments
|
108
|
+
(TODO, FIXME, OPTIMIZE, HACK, REVIEW).
|
109
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#annotate-keywords'
|
110
|
+
Enabled: false
|
111
|
+
|
112
|
+
Metrics/CyclomaticComplexity:
|
113
|
+
Description: >-
|
114
|
+
A complexity metric that is strongly correlated to the number
|
115
|
+
of test cases needed to validate a method.
|
116
|
+
Enabled: false
|
117
|
+
|
118
|
+
Style/PreferredHashMethods:
|
119
|
+
Description: 'Checks for use of deprecated Hash methods.'
|
120
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#hash-key'
|
121
|
+
Enabled: false
|
122
|
+
|
123
|
+
Style/Documentation:
|
124
|
+
Description: 'Document classes and non-namespace modules.'
|
125
|
+
Enabled: false
|
126
|
+
|
127
|
+
Style/DoubleNegation:
|
128
|
+
Description: 'Checks for uses of double negation (!!).'
|
129
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-bang-bang'
|
130
|
+
Enabled: false
|
131
|
+
|
132
|
+
Style/EachWithObject:
|
133
|
+
Description: 'Prefer `each_with_object` over `inject` or `reduce`.'
|
134
|
+
Enabled: false
|
135
|
+
|
136
|
+
Style/EmptyLiteral:
|
137
|
+
Description: 'Prefer literals to Array.new/Hash.new/String.new.'
|
138
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#literal-array-hash'
|
139
|
+
Enabled: false
|
140
|
+
|
141
|
+
# Checks whether the source file has a utf-8 encoding comment or not
|
142
|
+
# AutoCorrectEncodingComment must match the regex
|
143
|
+
# /#.*coding\s?[:=]\s?(?:UTF|utf)-8/
|
144
|
+
Style/Encoding:
|
145
|
+
Enabled: false
|
146
|
+
|
147
|
+
Style/EvenOdd:
|
148
|
+
Description: 'Favor the use of Fixnum#even? && Fixnum#odd?'
|
149
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#predicate-methods'
|
150
|
+
Enabled: false
|
151
|
+
|
152
|
+
Naming/FileName:
|
153
|
+
Description: 'Use snake_case for source file names.'
|
154
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#snake-case-files'
|
155
|
+
Enabled: false
|
156
|
+
|
157
|
+
Lint/FlipFlop:
|
158
|
+
Description: 'Checks for flip flops'
|
159
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-flip-flops'
|
160
|
+
Enabled: false
|
161
|
+
|
162
|
+
Style/FrozenStringLiteralComment:
|
163
|
+
Description: 'Helps you transition from mutable string literals to frozen string literals.'
|
164
|
+
Enabled: false
|
165
|
+
|
166
|
+
Style/FormatString:
|
167
|
+
Description: 'Enforce the use of Kernel#sprintf, Kernel#format or String#%.'
|
168
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#sprintf'
|
169
|
+
Enabled: false
|
170
|
+
|
171
|
+
Style/GlobalVars:
|
172
|
+
Description: 'Do not introduce global variables.'
|
173
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#instance-vars'
|
174
|
+
Reference: 'https://www.zenspider.com/ruby/quickref.html'
|
175
|
+
Enabled: false
|
176
|
+
|
177
|
+
Style/GuardClause:
|
178
|
+
Description: 'Check for conditionals that can be replaced with guard clauses'
|
179
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-nested-conditionals'
|
180
|
+
Enabled: false
|
181
|
+
|
182
|
+
Style/IfUnlessModifier:
|
183
|
+
Description: >-
|
184
|
+
Favor modifier if/unless usage when you have a
|
185
|
+
single-line body.
|
186
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#if-as-a-modifier'
|
187
|
+
Enabled: false
|
188
|
+
|
189
|
+
Style/IfWithSemicolon:
|
190
|
+
Description: 'Do not use if x; .... Use the ternary operator instead.'
|
191
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-semicolon-ifs'
|
192
|
+
Enabled: false
|
193
|
+
|
194
|
+
Style/InlineComment:
|
195
|
+
Description: 'Avoid inline comments.'
|
196
|
+
Enabled: false
|
197
|
+
|
198
|
+
Style/Lambda:
|
199
|
+
Description: 'Use the new lambda literal syntax for single-line blocks.'
|
200
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#lambda-multi-line'
|
201
|
+
Enabled: false
|
202
|
+
|
203
|
+
Style/LambdaCall:
|
204
|
+
Description: 'Use lambda.call(...) instead of lambda.(...).'
|
205
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#proc-call'
|
206
|
+
Enabled: false
|
207
|
+
|
208
|
+
Style/LineEndConcatenation:
|
209
|
+
Description: >-
|
210
|
+
Use \ instead of + or << to concatenate two string literals at
|
211
|
+
line end.
|
212
|
+
Enabled: false
|
213
|
+
|
214
|
+
Layout/LineLength:
|
215
|
+
Description: 'Limit lines to 150 characters.'
|
216
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#80-character-limits'
|
217
|
+
Max: 180
|
218
|
+
|
219
|
+
Metrics/MethodLength:
|
220
|
+
Description: 'Avoid methods longer than 10 lines of code.'
|
221
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#short-methods'
|
222
|
+
Enabled: false
|
223
|
+
|
224
|
+
Style/ModuleFunction:
|
225
|
+
Description: 'Checks for usage of `extend self` in modules.'
|
226
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#module-function'
|
227
|
+
Enabled: false
|
228
|
+
|
229
|
+
Style/NegatedIf:
|
230
|
+
Description: >-
|
231
|
+
Favor unless over if for negative conditions
|
232
|
+
(or control flow or).
|
233
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#unless-for-negatives'
|
234
|
+
Enabled: true
|
235
|
+
|
236
|
+
Style/NegatedWhile:
|
237
|
+
Description: 'Favor until over while for negative conditions.'
|
238
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#until-for-negatives'
|
239
|
+
Enabled: true
|
240
|
+
|
241
|
+
Style/Next:
|
242
|
+
Description: 'Use `next` to skip iteration instead of a condition at the end.'
|
243
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-nested-conditionals'
|
244
|
+
Enabled: false
|
245
|
+
|
246
|
+
Style/NilComparison:
|
247
|
+
Description: 'Prefer x.nil? to x == nil.'
|
248
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#predicate-methods'
|
249
|
+
Enabled: false
|
250
|
+
|
251
|
+
Style/Not:
|
252
|
+
Description: 'Use ! instead of not.'
|
253
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#bang-not-not'
|
254
|
+
Enabled: false
|
255
|
+
|
256
|
+
Style/NumericLiterals:
|
257
|
+
Description: >-
|
258
|
+
Add underscores to large numeric literals to improve their
|
259
|
+
readability.
|
260
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#underscores-in-numerics'
|
261
|
+
Enabled: false
|
262
|
+
|
263
|
+
Style/OneLineConditional:
|
264
|
+
Description: >-
|
265
|
+
Favor the ternary operator(?:) over
|
266
|
+
if/then/else/end constructs.
|
267
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#ternary-operator'
|
268
|
+
Enabled: false
|
269
|
+
|
270
|
+
Naming/BinaryOperatorParameterName:
|
271
|
+
Description: 'When defining binary operators, name the argument other.'
|
272
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#other-arg'
|
273
|
+
Enabled: false
|
274
|
+
|
275
|
+
Metrics/ParameterLists:
|
276
|
+
Description: 'Avoid parameter lists longer than three or four parameters.'
|
277
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#too-many-params'
|
278
|
+
Enabled: false
|
279
|
+
|
280
|
+
Metrics/PerceivedComplexity:
|
281
|
+
Enabled: false
|
282
|
+
|
283
|
+
Style/PercentLiteralDelimiters:
|
284
|
+
Description: 'Use `%`-literal delimiters consistently'
|
285
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#percent-literal-braces'
|
286
|
+
Enabled: false
|
287
|
+
|
288
|
+
Style/PerlBackrefs:
|
289
|
+
Description: 'Avoid Perl-style regex back references.'
|
290
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-perl-regexp-last-matchers'
|
291
|
+
Enabled: false
|
292
|
+
|
293
|
+
Naming/PredicateName:
|
294
|
+
Description: 'Check the names of predicate methods.'
|
295
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#bool-methods-qmark'
|
296
|
+
ForbiddenPrefixes:
|
297
|
+
- is_
|
298
|
+
Exclude:
|
299
|
+
- spec/**/*
|
300
|
+
|
301
|
+
Style/Proc:
|
302
|
+
Description: 'Use proc instead of Proc.new.'
|
303
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#proc'
|
304
|
+
Enabled: false
|
305
|
+
|
306
|
+
Style/RaiseArgs:
|
307
|
+
Description: 'Checks the arguments passed to raise/fail.'
|
308
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#exception-class-messages'
|
309
|
+
Enabled: false
|
310
|
+
|
311
|
+
Style/RegexpLiteral:
|
312
|
+
Description: 'Use / or %r around regular expressions.'
|
313
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#percent-r'
|
314
|
+
Enabled: false
|
315
|
+
|
316
|
+
Style/SelfAssignment:
|
317
|
+
Description: >-
|
318
|
+
Checks for places where self-assignment shorthand should have
|
319
|
+
been used.
|
320
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#self-assignment'
|
321
|
+
Enabled: false
|
322
|
+
|
323
|
+
Style/SingleLineBlockParams:
|
324
|
+
Description: 'Enforces the names of some block params.'
|
325
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#reduce-blocks'
|
326
|
+
Enabled: false
|
327
|
+
|
328
|
+
Style/SingleLineMethods:
|
329
|
+
Description: 'Avoid single-line methods.'
|
330
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-single-line-methods'
|
331
|
+
Enabled: false
|
332
|
+
|
333
|
+
Style/SignalException:
|
334
|
+
Description: 'Checks for proper usage of fail and raise.'
|
335
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#fail-method'
|
336
|
+
Enabled: false
|
337
|
+
|
338
|
+
Style/SpecialGlobalVars:
|
339
|
+
Description: 'Avoid Perl-style global variables.'
|
340
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-cryptic-perlisms'
|
341
|
+
Enabled: false
|
342
|
+
|
343
|
+
Style/StringLiterals:
|
344
|
+
Description: 'Checks if uses of quotes match the configured preference.'
|
345
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#consistent-string-literals'
|
346
|
+
EnforcedStyle: double_quotes
|
347
|
+
Enabled: false
|
348
|
+
|
349
|
+
Style/TrailingCommaInArguments:
|
350
|
+
Description: 'Checks for trailing comma in argument lists.'
|
351
|
+
StyleGuide: '#no-trailing-params-comma'
|
352
|
+
Enabled: true
|
353
|
+
|
354
|
+
Style/TrailingCommaInArrayLiteral:
|
355
|
+
Description: 'Checks for trailing comma in array and hash literals.'
|
356
|
+
EnforcedStyleForMultiline: comma
|
357
|
+
|
358
|
+
Style/TrailingCommaInHashLiteral:
|
359
|
+
Description: 'Checks for trailing comma in array and hash literals.'
|
360
|
+
EnforcedStyleForMultiline: comma
|
361
|
+
|
362
|
+
Style/TrivialAccessors:
|
363
|
+
Description: 'Prefer attr_* methods to trivial readers/writers.'
|
364
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#attr_family'
|
365
|
+
Enabled: false
|
366
|
+
|
367
|
+
Style/VariableInterpolation:
|
368
|
+
Description: >-
|
369
|
+
Don't interpolate global, instance and class variables
|
370
|
+
directly in strings.
|
371
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#curlies-interpolate'
|
372
|
+
Enabled: false
|
373
|
+
|
374
|
+
Style/WhenThen:
|
375
|
+
Description: 'Use when x then ... for one-line cases.'
|
376
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#one-line-cases'
|
377
|
+
Enabled: false
|
378
|
+
|
379
|
+
Style/WhileUntilModifier:
|
380
|
+
Description: >-
|
381
|
+
Favor modifier while/until usage when you have a
|
382
|
+
single-line body.
|
383
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#while-as-a-modifier'
|
384
|
+
Enabled: false
|
385
|
+
|
386
|
+
Style/WordArray:
|
387
|
+
Description: 'Use %w or %W for arrays of words.'
|
388
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#percent-w'
|
389
|
+
Enabled: false
|
390
|
+
|
391
|
+
# Layout
|
392
|
+
Layout/DotPosition:
|
393
|
+
Description: 'Checks the position of the dot in multi-line method calls.'
|
394
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#consistent-multi-line-chains'
|
395
|
+
EnforcedStyle: leading
|
396
|
+
|
397
|
+
Layout/ExtraSpacing:
|
398
|
+
Description: 'Do not use unnecessary spacing.'
|
399
|
+
Enabled: true
|
400
|
+
AllowBeforeTrailingComments: true
|
401
|
+
|
402
|
+
Layout/MultilineOperationIndentation:
|
403
|
+
Description: >-
|
404
|
+
Checks indentation of binary operations that span more than
|
405
|
+
one line.
|
406
|
+
Enabled: true
|
407
|
+
EnforcedStyle: indented
|
408
|
+
|
409
|
+
Layout/InitialIndentation:
|
410
|
+
Description: >-
|
411
|
+
Checks the indentation of the first non-blank non-comment line in a file.
|
412
|
+
Enabled: false
|
413
|
+
|
414
|
+
Layout/SpaceInsideArrayLiteralBrackets:
|
415
|
+
Description: "Checks that brackets used for array literals have or don't have surrounding space depending on configuration."
|
416
|
+
Enabled: false
|
417
|
+
|
418
|
+
Layout/TrailingWhitespace:
|
419
|
+
Description: "Ensures all trailing whitespace has been removed"
|
420
|
+
Enabled: true
|
421
|
+
|
422
|
+
# Lint
|
423
|
+
|
424
|
+
Lint/AmbiguousOperator:
|
425
|
+
Description: >-
|
426
|
+
Checks for ambiguous operators in the first argument of a
|
427
|
+
method invocation without parentheses.
|
428
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#parens-as-args'
|
429
|
+
Enabled: false
|
430
|
+
|
431
|
+
Lint/AmbiguousRegexpLiteral:
|
432
|
+
Description: >-
|
433
|
+
Checks for ambiguous regexp literals in the first argument of
|
434
|
+
a method invocation without parenthesis.
|
435
|
+
Enabled: false
|
436
|
+
|
437
|
+
Lint/AssignmentInCondition:
|
438
|
+
Description: "Don't use assignment in conditions."
|
439
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#safe-assignment-in-condition'
|
440
|
+
Enabled: false
|
441
|
+
|
442
|
+
Lint/CircularArgumentReference:
|
443
|
+
Description: "Don't refer to the keyword argument in the default value."
|
444
|
+
Enabled: false
|
445
|
+
|
446
|
+
Layout/ConditionPosition:
|
447
|
+
Description: >-
|
448
|
+
Checks for condition placed in a confusing position relative to
|
449
|
+
the keyword.
|
450
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#same-line-condition'
|
451
|
+
Enabled: false
|
452
|
+
|
453
|
+
Lint/DeprecatedClassMethods:
|
454
|
+
Description: 'Check for deprecated class method calls.'
|
455
|
+
Enabled: false
|
456
|
+
|
457
|
+
Lint/DuplicateHashKey:
|
458
|
+
Description: 'Check for duplicate keys in hash literals.'
|
459
|
+
Enabled: false
|
460
|
+
|
461
|
+
Lint/EachWithObjectArgument:
|
462
|
+
Description: 'Check for immutable argument given to each_with_object.'
|
463
|
+
Enabled: false
|
464
|
+
|
465
|
+
Lint/ElseLayout:
|
466
|
+
Description: 'Check for odd code arrangement in an else block.'
|
467
|
+
Enabled: false
|
468
|
+
|
469
|
+
Lint/FormatParameterMismatch:
|
470
|
+
Description: 'The number of parameters to format/sprint must match the fields.'
|
471
|
+
Enabled: false
|
472
|
+
|
473
|
+
Lint/SuppressedException:
|
474
|
+
Description: "Don't suppress exception."
|
475
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#dont-hide-exceptions'
|
476
|
+
Enabled: false
|
477
|
+
|
478
|
+
Lint/LiteralAsCondition:
|
479
|
+
Description: 'Checks of literals used in conditions.'
|
480
|
+
Enabled: false
|
481
|
+
|
482
|
+
Lint/LiteralInInterpolation:
|
483
|
+
Description: 'Checks for literals used in interpolation.'
|
484
|
+
Enabled: false
|
485
|
+
|
486
|
+
Lint/Loop:
|
487
|
+
Description: >-
|
488
|
+
Use Kernel#loop with break rather than begin/end/until or
|
489
|
+
begin/end/while for post-loop tests.
|
490
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#loop-with-break'
|
491
|
+
Enabled: false
|
492
|
+
|
493
|
+
Lint/NestedMethodDefinition:
|
494
|
+
Description: 'Do not use nested method definitions.'
|
495
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-nested-methods'
|
496
|
+
Enabled: false
|
497
|
+
|
498
|
+
Lint/NonLocalExitFromIterator:
|
499
|
+
Description: 'Do not use return in iterator to cause non-local exit.'
|
500
|
+
Enabled: false
|
501
|
+
|
502
|
+
Lint/ParenthesesAsGroupedExpression:
|
503
|
+
Description: >-
|
504
|
+
Checks for method calls with a space before the opening
|
505
|
+
parenthesis.
|
506
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#parens-no-spaces'
|
507
|
+
Enabled: false
|
508
|
+
|
509
|
+
Lint/RequireParentheses:
|
510
|
+
Description: >-
|
511
|
+
Use parentheses in the method call to avoid confusion
|
512
|
+
about precedence.
|
513
|
+
Enabled: false
|
514
|
+
|
515
|
+
Lint/UnderscorePrefixedVariableName:
|
516
|
+
Description: 'Do not use prefix `_` for a variable that is used.'
|
517
|
+
Enabled: false
|
518
|
+
|
519
|
+
Lint/RedundantCopDisableDirective:
|
520
|
+
Description: >-
|
521
|
+
Checks for rubocop:disable comments that can be removed.
|
522
|
+
Note: this cop is not disabled when disabling all cops.
|
523
|
+
It must be explicitly disabled.
|
524
|
+
Enabled: false
|
525
|
+
|
526
|
+
Lint/Void:
|
527
|
+
Description: 'Possible use of operator/literal/variable in void context.'
|
528
|
+
Enabled: false
|
529
|
+
|
530
|
+
# Performance
|
531
|
+
|
532
|
+
Performance/CaseWhenSplat:
|
533
|
+
Description: >-
|
534
|
+
Place `when` conditions that use splat at the end
|
535
|
+
of the list of `when` branches.
|
536
|
+
Enabled: false
|
537
|
+
|
538
|
+
Performance/Count:
|
539
|
+
Description: >-
|
540
|
+
Use `count` instead of `select...size`, `reject...size`,
|
541
|
+
`select...count`, `reject...count`, `select...length`,
|
542
|
+
and `reject...length`.
|
543
|
+
Enabled: false
|
544
|
+
|
545
|
+
Performance/Detect:
|
546
|
+
Description: >-
|
547
|
+
Use `detect` instead of `select.first`, `find_all.first`,
|
548
|
+
`select.last`, and `find_all.last`.
|
549
|
+
Reference: 'https://github.com/JuanitoFatas/fast-ruby#enumerabledetect-vs-enumerableselectfirst-code'
|
550
|
+
Enabled: false
|
551
|
+
|
552
|
+
Performance/FlatMap:
|
553
|
+
Description: >-
|
554
|
+
Use `Enumerable#flat_map`
|
555
|
+
instead of `Enumerable#map...Array#flatten(1)`
|
556
|
+
or `Enumberable#collect..Array#flatten(1)`
|
557
|
+
Reference: 'https://github.com/JuanitoFatas/fast-ruby#enumerablemaparrayflatten-vs-enumerableflat_map-code'
|
558
|
+
Enabled: false
|
559
|
+
|
560
|
+
Performance/ReverseEach:
|
561
|
+
Description: 'Use `reverse_each` instead of `reverse.each`.'
|
562
|
+
Reference: 'https://github.com/JuanitoFatas/fast-ruby#enumerablereverseeach-vs-enumerablereverse_each-code'
|
563
|
+
Enabled: false
|
564
|
+
|
565
|
+
Style/Sample:
|
566
|
+
Description: >-
|
567
|
+
Use `sample` instead of `shuffle.first`,
|
568
|
+
`shuffle.last`, and `shuffle[Fixnum]`.
|
569
|
+
Reference: 'https://github.com/JuanitoFatas/fast-ruby#arrayshufflefirst-vs-arraysample-code'
|
570
|
+
Enabled: false
|
571
|
+
|
572
|
+
Performance/Size:
|
573
|
+
Description: >-
|
574
|
+
Use `size` instead of `count` for counting
|
575
|
+
the number of elements in `Array` and `Hash`.
|
576
|
+
Reference: 'https://github.com/JuanitoFatas/fast-ruby#arraycount-vs-arraysize-code'
|
577
|
+
Enabled: false
|
578
|
+
|
579
|
+
Performance/StringReplacement:
|
580
|
+
Description: >-
|
581
|
+
Use `tr` instead of `gsub` when you are replacing the same
|
582
|
+
number of characters. Use `delete` instead of `gsub` when
|
583
|
+
you are deleting characters.
|
584
|
+
Reference: 'https://github.com/JuanitoFatas/fast-ruby#stringgsub-vs-stringtr-code'
|
585
|
+
Enabled: false
|
586
|
+
|
587
|
+
# Disabled temporarily while we bring code base inline
|
588
|
+
Layout/ArgumentAlignment:
|
589
|
+
Enabled: false
|
590
|
+
|
591
|
+
Layout/ArrayAlignment:
|
592
|
+
Enabled: false
|
593
|
+
|
594
|
+
Layout/BlockEndNewline:
|
595
|
+
Enabled: false
|
596
|
+
|
597
|
+
Layout/CaseIndentation:
|
598
|
+
Enabled: false
|
599
|
+
|
600
|
+
Layout/ClosingHeredocIndentation:
|
601
|
+
Enabled: false
|
602
|
+
|
603
|
+
Layout/ClosingParenthesisIndentation:
|
604
|
+
Enabled: false
|
605
|
+
|
606
|
+
Layout/CommentIndentation:
|
607
|
+
Enabled: false
|
608
|
+
|
609
|
+
Layout/ElseAlignment:
|
610
|
+
Enabled: false
|
611
|
+
|
612
|
+
Layout/EmptyLineAfterGuardClause:
|
613
|
+
Enabled: false
|
614
|
+
|
615
|
+
Layout/EmptyLineBetweenDefs:
|
616
|
+
Enabled: false
|
617
|
+
|
618
|
+
Layout/EmptyLines:
|
619
|
+
Enabled: false
|
620
|
+
|
621
|
+
Layout/EmptyLinesAroundBlockBody:
|
622
|
+
Enabled: false
|
623
|
+
|
624
|
+
Layout/EmptyLinesAroundMethodBody:
|
625
|
+
Enabled: false
|
626
|
+
|
627
|
+
Layout/EmptyLinesAroundModuleBody:
|
628
|
+
Enabled: false
|
629
|
+
|
630
|
+
Layout/EndAlignment:
|
631
|
+
Enabled: false
|
632
|
+
|
633
|
+
Layout/FirstArgumentIndentation:
|
634
|
+
Enabled: false
|
635
|
+
|
636
|
+
Layout/FirstHashElementIndentation:
|
637
|
+
Enabled: false
|
638
|
+
|
639
|
+
Layout/HashAlignment:
|
640
|
+
Enabled: false
|
641
|
+
|
642
|
+
Layout/HeredocIndentation:
|
643
|
+
Enabled: false
|
644
|
+
|
645
|
+
Layout/IndentationWidth:
|
646
|
+
Enabled: false
|
647
|
+
|
648
|
+
Layout/LeadingCommentSpace:
|
649
|
+
Enabled: false
|
650
|
+
|
651
|
+
Layout/LeadingEmptyLines:
|
652
|
+
Enabled: false
|
653
|
+
|
654
|
+
Layout/MultilineArrayBraceLayout:
|
655
|
+
Enabled: false
|
656
|
+
|
657
|
+
Layout/MultilineBlockLayout:
|
658
|
+
Enabled: false
|
659
|
+
|
660
|
+
Layout/MultilineHashBraceLayout:
|
661
|
+
Enabled: false
|
662
|
+
|
663
|
+
Layout/MultilineMethodCallBraceLayout:
|
664
|
+
Enabled: false
|
665
|
+
|
666
|
+
Layout/MultilineMethodCallIndentation:
|
667
|
+
Enabled: false
|
668
|
+
|
669
|
+
Layout/ParameterAlignment:
|
670
|
+
Enabled: false
|
671
|
+
|
672
|
+
Layout/SpaceAfterComma:
|
673
|
+
Enabled: false
|
674
|
+
|
675
|
+
Layout/SpaceAroundBlockParameters:
|
676
|
+
Enabled: false
|
677
|
+
|
678
|
+
Layout/SpaceAroundEqualsInParameterDefault:
|
679
|
+
Enabled: false
|
680
|
+
|
681
|
+
Layout/SpaceAroundOperators:
|
682
|
+
Enabled: false
|
683
|
+
|
684
|
+
Layout/SpaceBeforeBlockBraces:
|
685
|
+
Enabled: false
|
686
|
+
|
687
|
+
Layout/SpaceBeforeComma:
|
688
|
+
Enabled: false
|
689
|
+
|
690
|
+
Layout/SpaceInsideBlockBraces:
|
691
|
+
Enabled: false
|
692
|
+
|
693
|
+
Layout/SpaceInsideHashLiteralBraces:
|
694
|
+
Enabled: false
|
695
|
+
|
696
|
+
Layout/SpaceInsideReferenceBrackets:
|
697
|
+
Enabled: false
|
698
|
+
|
699
|
+
Layout/TrailingEmptyLines:
|
700
|
+
Enabled: false
|
701
|
+
|
702
|
+
Lint/ConstantDefinitionInBlock:
|
703
|
+
Enabled: false
|
704
|
+
|
705
|
+
Lint/IneffectiveAccessModifier:
|
706
|
+
Enabled: false
|
707
|
+
|
708
|
+
Lint/MissingCopEnableDirective:
|
709
|
+
Enabled: false
|
710
|
+
|
711
|
+
Lint/RedundantRequireStatement:
|
712
|
+
Enabled: false
|
713
|
+
|
714
|
+
Lint/StructNewOverride:
|
715
|
+
Enabled: false
|
716
|
+
|
717
|
+
Lint/UnusedBlockArgument:
|
718
|
+
Enabled: false
|
719
|
+
|
720
|
+
Lint/UnusedMethodArgument:
|
721
|
+
Enabled: false
|
722
|
+
|
723
|
+
Lint/UselessAccessModifier:
|
724
|
+
Enabled: false
|
725
|
+
|
726
|
+
Lint/UselessAssignment:
|
727
|
+
Enabled: false
|
728
|
+
|
729
|
+
Lint/UselessMethodDefinition:
|
730
|
+
Enabled: false
|
731
|
+
|
732
|
+
Naming/BlockParameterName:
|
733
|
+
Enabled: false
|
734
|
+
|
735
|
+
Naming/HeredocDelimiterNaming:
|
736
|
+
Enabled: false
|
737
|
+
|
738
|
+
Naming/MethodParameterName:
|
739
|
+
Enabled: false
|
740
|
+
|
741
|
+
Naming/RescuedExceptionsVariableName:
|
742
|
+
Enabled: false
|
743
|
+
|
744
|
+
Naming/VariableNumber:
|
745
|
+
Enabled: false
|
746
|
+
|
747
|
+
Style/AccessorGrouping:
|
748
|
+
Enabled: false
|
749
|
+
|
750
|
+
Style/AndOr:
|
751
|
+
Enabled: false
|
752
|
+
|
753
|
+
Style/BlockDelimiters:
|
754
|
+
Enabled: false
|
755
|
+
|
756
|
+
Style/CaseLikeIf:
|
757
|
+
Enabled: false
|
758
|
+
|
759
|
+
Style/CombinableLoops:
|
760
|
+
Enabled: false
|
761
|
+
|
762
|
+
Style/CommentedKeyword:
|
763
|
+
Enabled: false
|
764
|
+
|
765
|
+
Style/ConditionalAssignment:
|
766
|
+
Enabled: false
|
767
|
+
|
768
|
+
Style/DefWithParentheses:
|
769
|
+
Enabled: false
|
770
|
+
|
771
|
+
Style/EmptyElse:
|
772
|
+
Enabled: false
|
773
|
+
|
774
|
+
Style/EmptyMethod:
|
775
|
+
Enabled: false
|
776
|
+
|
777
|
+
Style/ExplicitBlockArgument:
|
778
|
+
Enabled: false
|
779
|
+
|
780
|
+
Style/For:
|
781
|
+
Enabled: false
|
782
|
+
|
783
|
+
Style/FormatStringToken:
|
784
|
+
Enabled: false
|
785
|
+
|
786
|
+
Style/GlobalStdStream:
|
787
|
+
Enabled: false
|
788
|
+
|
789
|
+
Style/HashEachMethods:
|
790
|
+
Enabled: false
|
791
|
+
|
792
|
+
Style/HashSyntax:
|
793
|
+
Enabled: false
|
794
|
+
|
795
|
+
Style/InfiniteLoop:
|
796
|
+
Enabled: false
|
797
|
+
|
798
|
+
Style/InverseMethods:
|
799
|
+
Enabled: false
|
800
|
+
|
801
|
+
Style/MethodCallWithoutArgsParentheses:
|
802
|
+
Enabled: false
|
803
|
+
|
804
|
+
Style/MissingRespondToMissing:
|
805
|
+
Enabled: false
|
806
|
+
|
807
|
+
Style/MultilineIfThen:
|
808
|
+
Enabled: false
|
809
|
+
|
810
|
+
Style/MultilineTernaryOperator:
|
811
|
+
Enabled: false
|
812
|
+
|
813
|
+
Style/MultipleComparison:
|
814
|
+
Enabled: false
|
815
|
+
|
816
|
+
Style/MutableConstant:
|
817
|
+
Enabled: false
|
818
|
+
|
819
|
+
Style/NumericPredicate:
|
820
|
+
Enabled: false
|
821
|
+
|
822
|
+
Style/OptionalBooleanParameter:
|
823
|
+
Enabled: false
|
824
|
+
|
825
|
+
Style/ParallelAssignment:
|
826
|
+
Enabled: false
|
827
|
+
|
828
|
+
Style/RedundantAssignment:
|
829
|
+
Enabled: false
|
830
|
+
|
831
|
+
Style/RedundantBegin:
|
832
|
+
Enabled: false
|
833
|
+
|
834
|
+
Style/RedundantCondition:
|
835
|
+
Enabled: true
|
836
|
+
|
837
|
+
Style/RedundantException:
|
838
|
+
Enabled: false
|
839
|
+
|
840
|
+
Style/RedundantFileExtensionInRequire:
|
841
|
+
Enabled: false
|
842
|
+
|
843
|
+
Style/RedundantParentheses:
|
844
|
+
Enabled: true
|
845
|
+
|
846
|
+
Style/RedundantRegexpEscape:
|
847
|
+
Enabled: false
|
848
|
+
|
849
|
+
Style/RedundantReturn:
|
850
|
+
Enabled: true
|
851
|
+
|
852
|
+
Style/RedundantSelf:
|
853
|
+
Enabled: false
|
854
|
+
|
855
|
+
Style/RescueStandardError:
|
856
|
+
Enabled: false
|
857
|
+
|
858
|
+
Style/SafeNavigation:
|
859
|
+
Enabled: false
|
860
|
+
|
861
|
+
Style/Semicolon:
|
862
|
+
Enabled: true
|
863
|
+
AllowAsExpressionSeparator: true
|
864
|
+
|
865
|
+
Style/SlicingWithRange:
|
866
|
+
Enabled: false
|
867
|
+
|
868
|
+
Style/SoleNestedConditional:
|
869
|
+
Enabled: false
|
870
|
+
|
871
|
+
Style/StringConcatenation:
|
872
|
+
Enabled: false
|
873
|
+
|
874
|
+
Style/SymbolArray:
|
875
|
+
Enabled: false
|
876
|
+
|
877
|
+
Style/SymbolProc:
|
878
|
+
Enabled: false
|
879
|
+
|
880
|
+
Style/TernaryParentheses:
|
881
|
+
Enabled: false
|
882
|
+
|
883
|
+
Style/TrailingUnderscoreVariable:
|
884
|
+
Enabled: false
|
885
|
+
|
886
|
+
Style/WhileUntilDo:
|
887
|
+
Enabled: false
|
888
|
+
|
889
|
+
Style/ZeroLengthPredicate:
|
890
|
+
Enabled: false
|
891
|
+
|
892
|
+
RSpec/FilePath:
|
893
|
+
SpecSuffixOnly: true
|
894
|
+
|
895
|
+
RSpec/ExampleLength:
|
896
|
+
Enabled: false
|
897
|
+
|
898
|
+
RSpec/MultipleExpectations:
|
899
|
+
Enabled: false
|
900
|
+
|
901
|
+
RSpec/MultipleMemoizedHelpers:
|
902
|
+
Enabled: false
|
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
Copyright 2024 Catamorphic, Co.
|
2
|
+
|
3
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
+
you may not use this file except in compliance with the License.
|
5
|
+
You may obtain a copy of the License at
|
6
|
+
|
7
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
8
|
+
|
9
|
+
Unless required by applicable law or agreed to in writing, software
|
10
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
+
See the License for the specific language governing permissions and
|
13
|
+
limitations under the License.
|
data/README.md
ADDED
@@ -0,0 +1,173 @@
|
|
1
|
+
# LaunchDarkly OpenFeature provider for the Server-Side SDK for Ruby
|
2
|
+
|
3
|
+
[](http://badge.fury.io/rb/launchdarkly-openfeature-server-sdk)
|
4
|
+
|
5
|
+
[](https://github.com/launchdarkly/openfeature-ruby-server/actions/workflows/ci.yml)
|
6
|
+
[](https://www.rubydoc.info/gems/launchdarkly-openfeature-server-sdk)
|
7
|
+
[](https://launchdarkly.github.io/openfeature-ruby-server)
|
8
|
+
|
9
|
+
This provider allows for using LaunchDarkly with the OpenFeature SDK for Ruby.
|
10
|
+
|
11
|
+
This provider is designed primarily for use in multi-user systems such as web servers and applications. It follows the server-side LaunchDarkly model for multi-user contexts. It is not intended for use in desktop and embedded systems applications.
|
12
|
+
|
13
|
+
> [!WARNING]
|
14
|
+
> This is a beta version. The API is not stabilized and may introduce breaking changes.
|
15
|
+
|
16
|
+
> [!NOTE]
|
17
|
+
> This OpenFeature provider uses production versions of the LaunchDarkly SDK, which adhere to our standard [versioning policy](https://docs.launchdarkly.com/sdk/concepts/versioning).
|
18
|
+
|
19
|
+
# LaunchDarkly overview
|
20
|
+
|
21
|
+
[LaunchDarkly](https://www.launchdarkly.com) is a feature management platform that serves trillions of feature flags daily to help teams build better software, faster. [Get started](https://docs.launchdarkly.com/home/getting-started) using LaunchDarkly today!
|
22
|
+
|
23
|
+
[](https://twitter.com/intent/follow?screen_name=launchdarkly)
|
24
|
+
|
25
|
+
## Supported Ruby versions
|
26
|
+
|
27
|
+
This version of the LaunchDarkly provider works with Ruby 3.1 and above.
|
28
|
+
|
29
|
+
## Getting started
|
30
|
+
|
31
|
+
### Requisites
|
32
|
+
|
33
|
+
Install the library
|
34
|
+
|
35
|
+
```shell
|
36
|
+
$ gem install launchdarkly-openfeature-server
|
37
|
+
```
|
38
|
+
|
39
|
+
### Usage
|
40
|
+
|
41
|
+
```ruby
|
42
|
+
require 'open_feature/sdk'
|
43
|
+
require 'ldclient-rb'
|
44
|
+
require 'ldclient-openfeature'
|
45
|
+
|
46
|
+
provider = LaunchDarkly::OpenFeature::Provider.new(
|
47
|
+
'sdk-key',
|
48
|
+
LaunchDarkly::Config.new
|
49
|
+
)
|
50
|
+
|
51
|
+
OpenFeature::SDK.configure do |config|
|
52
|
+
config.set_provider(provider)
|
53
|
+
end
|
54
|
+
|
55
|
+
# Refer to OpenFeature documentation for getting a client and performing evaluations.
|
56
|
+
```
|
57
|
+
|
58
|
+
Refer to the [SDK reference guide](https://docs.launchdarkly.com/sdk/server-side/ruby) for instructions on getting started with using the SDK.
|
59
|
+
|
60
|
+
For information on using the OpenFeature client please refer to the [OpenFeature Documentation](https://docs.openfeature.dev/docs/reference/concepts/evaluation-api/).
|
61
|
+
|
62
|
+
## OpenFeature Specific Considerations
|
63
|
+
|
64
|
+
LaunchDarkly evaluates contexts, and it can either evaluate a single-context, or a multi-context. When using OpenFeature both single and multi-contexts must be encoded into a single `EvaluationContext`. This is accomplished by looking for an attribute named `kind` in the `EvaluationContext`.
|
65
|
+
|
66
|
+
There are 4 different scenarios related to the `kind`:
|
67
|
+
1. There is no `kind` attribute. In this case the provider will treat the context as a single context containing a "user" kind.
|
68
|
+
2. There is a `kind` attribute, and the value of that attribute is "multi". This will indicate to the provider that the context is a multi-context.
|
69
|
+
3. There is a `kind` attribute, and the value of that attribute is a string other than "multi". This will indicate to the provider a single context of the kind specified.
|
70
|
+
4. There is a `kind` attribute, and the attribute is not a string. In this case the value of the attribute will be discarded, and the context will be treated as a "user". An error message will be logged.
|
71
|
+
|
72
|
+
The `kind` attribute should be a string containing only contain ASCII letters, numbers, `.`, `_` or `-`.
|
73
|
+
|
74
|
+
The OpenFeature specification allows for an optional targeting key, but LaunchDarkly requires a key for evaluation. A targeting key must be specified for each context being evaluated. It may be specified using either `targeting_key`, as it is in the OpenFeature specification, or `key`, which is the typical LaunchDarkly identifier for the targeting key. If a `targeting_key` and a `key` are specified, then the `targeting_key` will take precedence.
|
75
|
+
|
76
|
+
There are several other attributes which have special functionality within a single or multi-context.
|
77
|
+
- A key of `privateAttributes`. Must be an array of string values.
|
78
|
+
- A key of `anonymous`. Must be a boolean value.
|
79
|
+
- A key of `name`. Must be a string.
|
80
|
+
|
81
|
+
### Examples
|
82
|
+
|
83
|
+
#### A single user context
|
84
|
+
|
85
|
+
```ruby
|
86
|
+
context = EvaluationContext(key: "the-key")
|
87
|
+
```
|
88
|
+
|
89
|
+
#### A single context of kind "organization"
|
90
|
+
|
91
|
+
```ruby
|
92
|
+
context = EvaluationContext(key: "org-key", kind: "organization")
|
93
|
+
```
|
94
|
+
|
95
|
+
#### A multi-context containing a "user" and an "organization"
|
96
|
+
|
97
|
+
```ruby
|
98
|
+
attributes = {
|
99
|
+
kind: "multi",
|
100
|
+
organization: {
|
101
|
+
name: "the-org-name",
|
102
|
+
key, "my-org-key",
|
103
|
+
myCustomAttribute, "myAttributeValue"
|
104
|
+
},
|
105
|
+
user: {
|
106
|
+
key: "my-user-key",
|
107
|
+
anonymous, true
|
108
|
+
}
|
109
|
+
}
|
110
|
+
context = EvaluationContext(**attributes)
|
111
|
+
```
|
112
|
+
|
113
|
+
#### Setting private attributes in a single context
|
114
|
+
|
115
|
+
```ruby
|
116
|
+
attributes = {
|
117
|
+
key: "org-key",
|
118
|
+
kind: "organization",
|
119
|
+
myCustomAttribute: "myAttributeValue",
|
120
|
+
privateAttributes: ["myCustomAttribute"]
|
121
|
+
}
|
122
|
+
|
123
|
+
context = EvaluationContext(**attributes)
|
124
|
+
```
|
125
|
+
|
126
|
+
#### Setting private attributes in a multi-context
|
127
|
+
|
128
|
+
```ruby
|
129
|
+
attributes = {
|
130
|
+
kind: "organization",
|
131
|
+
organization: {
|
132
|
+
name: "the-org-name",
|
133
|
+
key: "my-org-key",
|
134
|
+
# This will ONLY apply to the "organization" attributes.
|
135
|
+
privateAttributes: ["myCustomAttribute"],
|
136
|
+
# This attribute will be private.
|
137
|
+
myCustomAttribute: "myAttributeValue",
|
138
|
+
},
|
139
|
+
user: [
|
140
|
+
key: "my-user-key",
|
141
|
+
anonymous = > true,
|
142
|
+
# This attribute will not be private.
|
143
|
+
myCustomAttribute: "myAttributeValue",
|
144
|
+
]
|
145
|
+
}
|
146
|
+
|
147
|
+
context = EvaluationContext(**attributes)
|
148
|
+
```
|
149
|
+
|
150
|
+
## Learn more
|
151
|
+
|
152
|
+
Check out our [documentation](http://docs.launchdarkly.com) for in-depth instructions on configuring and using LaunchDarkly. You can also head straight to the [complete reference guide for this SDK](https://docs.launchdarkly.com/sdk/server-side/ruby).
|
153
|
+
|
154
|
+
The authoritative description of all properties and methods is in the [ruby documentation](https://launchdarkly.github.io/openfeature-ruby-server/).
|
155
|
+
|
156
|
+
## Contributing
|
157
|
+
|
158
|
+
We encourage pull requests and other contributions from the community. Check out our [contributing guidelines](CONTRIBUTING.md) for instructions on how to contribute to this SDK.
|
159
|
+
|
160
|
+
## About LaunchDarkly
|
161
|
+
|
162
|
+
* LaunchDarkly is a continuous delivery platform that provides feature flags as a service and allows developers to iterate quickly and safely. We allow you to easily flag your features and manage them from the LaunchDarkly dashboard. With LaunchDarkly, you can:
|
163
|
+
* Roll out a new feature to a subset of your users (like a group of users who opt-in to a beta tester group), gathering feedback and bug reports from real-world use cases.
|
164
|
+
* Gradually roll out a feature to an increasing percentage of users, and track the effect that the feature has on key metrics (for instance, how likely is a user to complete a purchase if they have feature A versus feature B?).
|
165
|
+
* Turn off a feature that you realize is causing performance problems in production, without needing to re-deploy, or even restart the application with a changed configuration file.
|
166
|
+
* Grant access to certain features based on user attributes, like payment plan (eg: users on the ‘gold’ plan get access to more features than users in the ‘silver’ plan). Disable parts of your application to facilitate maintenance, without taking everything offline.
|
167
|
+
* LaunchDarkly provides feature flag SDKs for a wide variety of languages and technologies. Check out [our documentation](https://docs.launchdarkly.com/sdk) for a complete list.
|
168
|
+
* Explore LaunchDarkly
|
169
|
+
* [launchdarkly.com](https://www.launchdarkly.com/ "LaunchDarkly Main Website") for more information
|
170
|
+
* [docs.launchdarkly.com](https://docs.launchdarkly.com/ "LaunchDarkly Documentation") for our documentation and SDK reference guides
|
171
|
+
* [apidocs.launchdarkly.com](https://apidocs.launchdarkly.com/ "LaunchDarkly API Documentation") for our API documentation
|
172
|
+
* [blog.launchdarkly.com](https://blog.launchdarkly.com/ "LaunchDarkly Blog Documentation") for the latest product updates
|
173
|
+
|
data/Rakefile
ADDED
@@ -0,0 +1,30 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "lib/ldclient-openfeature/version"
|
4
|
+
|
5
|
+
Gem::Specification.new do |spec|
|
6
|
+
spec.name = "launchdarkly-openfeature-server-sdk"
|
7
|
+
spec.version = LaunchDarkly::OpenFeature::VERSION
|
8
|
+
spec.authors = ["LaunchDarkly"]
|
9
|
+
spec.email = ["team@launchdarkly.com"]
|
10
|
+
|
11
|
+
spec.summary = "LaunchDarkly OpenFeature Server SDK"
|
12
|
+
spec.description = "A LaunchDarkly provider for use with the OpenFeature SDK"
|
13
|
+
spec.homepage = "https://github.com/launchdarkly/openfeature-ruby-server"
|
14
|
+
spec.required_ruby_version = ">= 3.1"
|
15
|
+
|
16
|
+
spec.metadata["homepage_uri"] = spec.homepage
|
17
|
+
spec.metadata["source_code_uri"] = "https://github.com/launchdarkly/openfeature-ruby-server"
|
18
|
+
spec.metadata["changelog_uri"] = "https://github.com/launchdarkly/openfeature-ruby-server/blob/main/CHANGELOG.md"
|
19
|
+
|
20
|
+
# Specify which files should be added to the gem when it is released.
|
21
|
+
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
22
|
+
spec.files = Dir.chdir(__dir__) do
|
23
|
+
`git ls-files -z`.split("\x0").reject do |f|
|
24
|
+
(File.expand_path(f) == __FILE__) || f.start_with?(*%w[bin/ test/ spec/ features/ .git .circleci appveyor])
|
25
|
+
end
|
26
|
+
end
|
27
|
+
spec.bindir = "exe"
|
28
|
+
spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
|
29
|
+
spec.require_paths = ["lib"]
|
30
|
+
end
|
metadata
ADDED
@@ -0,0 +1,55 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: launchdarkly-openfeature-server-sdk
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- LaunchDarkly
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2024-07-19 00:00:00.000000000 Z
|
12
|
+
dependencies: []
|
13
|
+
description: A LaunchDarkly provider for use with the OpenFeature SDK
|
14
|
+
email:
|
15
|
+
- team@launchdarkly.com
|
16
|
+
executables: []
|
17
|
+
extensions: []
|
18
|
+
extra_rdoc_files: []
|
19
|
+
files:
|
20
|
+
- ".release-please-manifest.json"
|
21
|
+
- ".rspec"
|
22
|
+
- ".rubocop.yml"
|
23
|
+
- Gemfile
|
24
|
+
- LICENSE.txt
|
25
|
+
- README.md
|
26
|
+
- Rakefile
|
27
|
+
- launchdarkly-openfeature-server-sdk.gemspec
|
28
|
+
- lib/ldclient-openfeature.rb
|
29
|
+
- lib/ldclient-openfeature/version.rb
|
30
|
+
homepage: https://github.com/launchdarkly/openfeature-ruby-server
|
31
|
+
licenses: []
|
32
|
+
metadata:
|
33
|
+
homepage_uri: https://github.com/launchdarkly/openfeature-ruby-server
|
34
|
+
source_code_uri: https://github.com/launchdarkly/openfeature-ruby-server
|
35
|
+
changelog_uri: https://github.com/launchdarkly/openfeature-ruby-server/blob/main/CHANGELOG.md
|
36
|
+
post_install_message:
|
37
|
+
rdoc_options: []
|
38
|
+
require_paths:
|
39
|
+
- lib
|
40
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
41
|
+
requirements:
|
42
|
+
- - ">="
|
43
|
+
- !ruby/object:Gem::Version
|
44
|
+
version: '3.1'
|
45
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
46
|
+
requirements:
|
47
|
+
- - ">="
|
48
|
+
- !ruby/object:Gem::Version
|
49
|
+
version: '0'
|
50
|
+
requirements: []
|
51
|
+
rubygems_version: 3.3.26
|
52
|
+
signing_key:
|
53
|
+
specification_version: 4
|
54
|
+
summary: LaunchDarkly OpenFeature Server SDK
|
55
|
+
test_files: []
|