cucumber-cucumber-expressions 16.1.2 → 17.0.2

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.
Files changed (42) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +37 -0
  3. data/.rubocop_todo.yml +443 -0
  4. data/Gemfile +2 -1
  5. data/Rakefile +4 -17
  6. data/VERSION +1 -1
  7. data/cucumber-cucumber-expressions.gemspec +22 -17
  8. data/lib/cucumber/cucumber_expressions/argument.rb +7 -3
  9. data/lib/cucumber/cucumber_expressions/ast.rb +24 -59
  10. data/lib/cucumber/cucumber_expressions/combinatorial_generated_expression_factory.rb +6 -13
  11. data/lib/cucumber/cucumber_expressions/cucumber_expression.rb +17 -19
  12. data/lib/cucumber/cucumber_expressions/cucumber_expression_generator.rb +11 -15
  13. data/lib/cucumber/cucumber_expressions/cucumber_expression_parser.rb +37 -53
  14. data/lib/cucumber/cucumber_expressions/cucumber_expression_tokenizer.rb +13 -18
  15. data/lib/cucumber/cucumber_expressions/errors.rb +121 -103
  16. data/lib/cucumber/cucumber_expressions/expression_factory.rb +2 -0
  17. data/lib/cucumber/cucumber_expressions/generated_expression.rb +2 -0
  18. data/lib/cucumber/cucumber_expressions/group.rb +2 -0
  19. data/lib/cucumber/cucumber_expressions/group_builder.rb +3 -1
  20. data/lib/cucumber/cucumber_expressions/parameter_type.rb +14 -26
  21. data/lib/cucumber/cucumber_expressions/parameter_type_matcher.rb +9 -7
  22. data/lib/cucumber/cucumber_expressions/parameter_type_registry.rb +27 -22
  23. data/lib/cucumber/cucumber_expressions/regular_expression.rb +3 -2
  24. data/lib/cucumber/cucumber_expressions/tree_regexp.rb +8 -7
  25. data/spec/cucumber/cucumber_expressions/argument_spec.rb +4 -2
  26. data/spec/cucumber/cucumber_expressions/combinatorial_generated_expression_factory_spec.rb +41 -0
  27. data/spec/cucumber/cucumber_expressions/cucumber_expression_generator_spec.rb +106 -103
  28. data/spec/cucumber/cucumber_expressions/cucumber_expression_parser_spec.rb +3 -1
  29. data/spec/cucumber/cucumber_expressions/cucumber_expression_spec.rb +90 -93
  30. data/spec/cucumber/cucumber_expressions/cucumber_expression_tokenizer_spec.rb +4 -2
  31. data/spec/cucumber/cucumber_expressions/cucumber_expression_transformation_spec.rb +4 -2
  32. data/spec/cucumber/cucumber_expressions/custom_parameter_type_spec.rb +80 -61
  33. data/spec/cucumber/cucumber_expressions/expression_factory_spec.rb +3 -1
  34. data/spec/cucumber/cucumber_expressions/parameter_type_registry_spec.rb +44 -49
  35. data/spec/cucumber/cucumber_expressions/parameter_type_spec.rb +5 -2
  36. data/spec/cucumber/cucumber_expressions/regular_expression_spec.rb +39 -30
  37. data/spec/cucumber/cucumber_expressions/tree_regexp_spec.rb +49 -49
  38. metadata +80 -25
  39. data/.rspec +0 -1
  40. data/scripts/update-gemspec +0 -32
  41. data/spec/capture_warnings.rb +0 -74
  42. data/spec/cucumber/cucumber_expressions/combinatorial_generated_expression_factory_test.rb +0 -43
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3292e1a5438afffcfbc8f3c34cb1ebe7529d9087e8f86a14deebdb7646abc027
4
- data.tar.gz: 671b555f547d195a883a7012704f881b6bbbda692ecd49e32fb52f26f351b822
3
+ metadata.gz: 6b49e9f64d889645dcee283e717f9b6c268293166219700c1e95435ce318e6f6
4
+ data.tar.gz: eda9b64c55c72304d1fa7d8509f16a9f5eb9c347cbf38125c41a3bbbf8d61f1f
5
5
  SHA512:
6
- metadata.gz: dd0989b60bc8048947f251fcf309e6a81f7e034123a5dd89c1f959150a71ff2d95bdc87700697b911bed175e44cf17d763b15dbb901c3da7e2d18cb14bf4e235
7
- data.tar.gz: da4fb18fe6dc9661b96bd30806d58dd326416c02548bae2d884b8cdb6f06c8cfb31339a73ae52badf4786cfdc95b53e429f677ba942d87ddaa321a528d84b92f
6
+ metadata.gz: 38a2e12bed97250bb03688aef8fcb596d78be09229ba5c33c7aee2957596b35f92abecd8a2fa6cc7b946ea7f05b9a9cd585dd4168898a38d3bc4aeb500ae8df1
7
+ data.tar.gz: a75778aa75c97f1e110e5d03725ae0a447429f2b1aac28bb5c7d947803ef95b4a38e23730f6d98459050bcd7c4cbae80e08a8c10b1a215d77ef537ca2319ff90
data/.rubocop.yml ADDED
@@ -0,0 +1,37 @@
1
+ require:
2
+ - rubocop-performance
3
+ - rubocop-rake
4
+ - rubocop-rspec
5
+
6
+ inherit_from: .rubocop_todo.yml
7
+
8
+ inherit_mode:
9
+ merge:
10
+ - Exclude
11
+
12
+ AllCops:
13
+ TargetRubyVersion: 2.5
14
+ NewCops: enable
15
+
16
+ # Disabled on our repo's to enable polyglot-release
17
+ Gemspec/RequireMFA:
18
+ Enabled: false
19
+
20
+ Layout/LineLength:
21
+ Max: 200
22
+
23
+ # This is documented in this spec to showcase why it's not working and people shouldn't use it
24
+ # cf:
25
+ Lint/MixedRegexpCaptureTypes:
26
+ Exclude:
27
+ - 'spec/cucumber/cucumber_expressions/tree_regexp_spec.rb'
28
+
29
+ Style/Documentation:
30
+ Enabled: false
31
+
32
+ Style/RegexpLiteral:
33
+ EnforcedStyle: slashes
34
+ AllowInnerSlashes: true
35
+
36
+ RSpec/MessageSpies:
37
+ EnforcedStyle: receive
data/.rubocop_todo.yml ADDED
@@ -0,0 +1,443 @@
1
+ # This configuration was generated by
2
+ # `rubocop --auto-gen-config`
3
+ # on 2023-11-27 17:52:56 UTC using RuboCop version 1.27.0.
4
+ # The point is for the user to remove these configuration records
5
+ # one by one as the offenses are removed from the code base.
6
+ # Note that changes in the inspected code, or installation of new
7
+ # versions of RuboCop, may require this file to be generated again.
8
+
9
+ # TODO: Oct '23 -> 33 files inspected, 1004 offenses detected, 859 offenses auto-correctable
10
+ # TODO: Oct '23 (later) -> 33 files inspected, 344 offenses detected, 205 offenses auto-correctable
11
+ # TODO: Nov '23 -> 33 files inspected, 399 offenses detected, 192 offenses auto-correctable
12
+
13
+ # Offense count: 2
14
+ # This cop supports safe auto-correction (--auto-correct).
15
+ # Configuration parameters: IndentationWidth.
16
+ # SupportedStyles: special_inside_parentheses, consistent, align_brackets
17
+ Layout/FirstArrayElementIndentation:
18
+ EnforcedStyle: consistent
19
+
20
+ # Offense count: 1
21
+ # This cop supports safe auto-correction (--auto-correct).
22
+ Lint/AmbiguousOperatorPrecedence:
23
+ Exclude:
24
+ - 'lib/cucumber/cucumber_expressions/errors.rb'
25
+
26
+ # Offense count: 3
27
+ # Configuration parameters: AllowedMethods.
28
+ # AllowedMethods: enums
29
+ Lint/ConstantDefinitionInBlock:
30
+ Exclude:
31
+ - 'spec/cucumber/cucumber_expressions/cucumber_expression_generator_spec.rb'
32
+ - 'spec/cucumber/cucumber_expressions/cucumber_expression_spec.rb'
33
+
34
+ # Offense count: 8
35
+ # Configuration parameters: IgnoreLiteralBranches, IgnoreConstantBranches.
36
+ Lint/DuplicateBranch:
37
+ Exclude:
38
+ - 'lib/cucumber/cucumber_expressions/ast.rb'
39
+ - 'lib/cucumber/cucumber_expressions/cucumber_expression_parser.rb'
40
+
41
+ # Offense count: 5
42
+ # Configuration parameters: AllowComments.
43
+ Lint/EmptyClass:
44
+ Exclude:
45
+ - 'spec/cucumber/cucumber_expressions/cucumber_expression_generator_spec.rb'
46
+ - 'spec/cucumber/cucumber_expressions/cucumber_expression_spec.rb'
47
+ - 'spec/cucumber/cucumber_expressions/parameter_type_registry_spec.rb'
48
+
49
+ # Offense count: 1
50
+ # This cop supports unsafe auto-correction (--auto-correct-all).
51
+ Lint/NonDeterministicRequireOrder:
52
+ Exclude:
53
+ - 'Rakefile'
54
+
55
+ # Offense count: 5
56
+ # Configuration parameters: AllowKeywordBlockArguments.
57
+ Lint/UnderscorePrefixedVariableName:
58
+ Exclude:
59
+ - 'lib/cucumber/cucumber_expressions/cucumber_expression_parser.rb'
60
+ - 'lib/cucumber/cucumber_expressions/group.rb'
61
+
62
+ # Offense count: 10
63
+ # Configuration parameters: IgnoredMethods, CountRepeatedAttributes.
64
+ Metrics/AbcSize:
65
+ Max: 59
66
+
67
+ # Offense count: 11
68
+ # Configuration parameters: CountComments, CountAsOne, ExcludedMethods, IgnoredMethods.
69
+ # IgnoredMethods: refine
70
+ Metrics/BlockLength:
71
+ Max: 183
72
+
73
+ # Offense count: 1
74
+ # Configuration parameters: CountBlocks.
75
+ Metrics/BlockNesting:
76
+ Max: 4
77
+
78
+ # Offense count: 1
79
+ # Configuration parameters: CountComments, CountAsOne.
80
+ Metrics/ClassLength:
81
+ Max: 141
82
+
83
+ # Offense count: 7
84
+ # Configuration parameters: IgnoredMethods.
85
+ Metrics/CyclomaticComplexity:
86
+ Max: 15
87
+
88
+ # Offense count: 20
89
+ # Configuration parameters: CountComments, CountAsOne, ExcludedMethods, IgnoredMethods.
90
+ Metrics/MethodLength:
91
+ Max: 61
92
+
93
+ # Offense count: 4
94
+ # Configuration parameters: CountComments, CountAsOne.
95
+ Metrics/ModuleLength:
96
+ Max: 184
97
+
98
+ # Offense count: 1
99
+ # Configuration parameters: CountKeywordArgs, MaxOptionalParameters.
100
+ Metrics/ParameterLists:
101
+ Max: 6
102
+
103
+ # Offense count: 6
104
+ # Configuration parameters: IgnoredMethods.
105
+ Metrics/PerceivedComplexity:
106
+ Max: 17
107
+
108
+ # Offense count: 7
109
+ # Configuration parameters: MinNameLength, AllowNamesEndingInNumbers, AllowedNames, ForbiddenNames.
110
+ # AllowedNames: at, by, db, id, in, io, ip, of, on, os, pp, to
111
+ Naming/MethodParameterName:
112
+ Exclude:
113
+ - 'lib/cucumber/cucumber_expressions/cucumber_expression_generator.rb'
114
+ - 'lib/cucumber/cucumber_expressions/tree_regexp.rb'
115
+ - 'spec/cucumber/cucumber_expressions/cucumber_expression_spec.rb'
116
+ - 'spec/cucumber/cucumber_expressions/custom_parameter_type_spec.rb'
117
+
118
+ # Offense count: 3
119
+ # Configuration parameters: NamePrefix, ForbiddenPrefixes, AllowedMethods, MethodDefinitionMacros.
120
+ # NamePrefix: is_, has_, have_
121
+ # ForbiddenPrefixes: is_, has_, have_
122
+ # AllowedMethods: is_a?
123
+ # MethodDefinitionMacros: define_method, define_singleton_method
124
+ Naming/PredicateName:
125
+ Exclude:
126
+ - 'lib/cucumber/cucumber_expressions/ast.rb'
127
+ - 'lib/cucumber/cucumber_expressions/parameter_type.rb'
128
+ - 'lib/cucumber/cucumber_expressions/tree_regexp.rb'
129
+
130
+ # Offense count: 3
131
+ # This cop supports safe auto-correction (--auto-correct).
132
+ Performance/RedundantBlockCall:
133
+ Exclude:
134
+ - 'lib/cucumber/cucumber_expressions/cucumber_expression.rb'
135
+
136
+ # Offense count: 2
137
+ # Configuration parameters: Prefixes.
138
+ # Prefixes: when, with, without
139
+ RSpec/ContextWording:
140
+ Exclude:
141
+ - 'spec/cucumber/cucumber_expressions/cucumber_expression_generator_spec.rb'
142
+
143
+ # Offense count: 29
144
+ # Configuration parameters: Max.
145
+ RSpec/ExampleLength:
146
+ Exclude:
147
+ - 'spec/cucumber/cucumber_expressions/combinatorial_generated_expression_factory_spec.rb'
148
+ - 'spec/cucumber/cucumber_expressions/cucumber_expression_generator_spec.rb'
149
+ - 'spec/cucumber/cucumber_expressions/cucumber_expression_parser_spec.rb'
150
+ - 'spec/cucumber/cucumber_expressions/cucumber_expression_spec.rb'
151
+ - 'spec/cucumber/cucumber_expressions/cucumber_expression_tokenizer_spec.rb'
152
+ - 'spec/cucumber/cucumber_expressions/cucumber_expression_transformation_spec.rb'
153
+ - 'spec/cucumber/cucumber_expressions/custom_parameter_type_spec.rb'
154
+ - 'spec/cucumber/cucumber_expressions/parameter_type_registry_spec.rb'
155
+ - 'spec/cucumber/cucumber_expressions/parameter_type_spec.rb'
156
+ - 'spec/cucumber/cucumber_expressions/regular_expression_spec.rb'
157
+ - 'spec/cucumber/cucumber_expressions/tree_regexp_spec.rb'
158
+
159
+ # Offense count: 3
160
+ RSpec/LeakyConstantDeclaration:
161
+ Exclude:
162
+ - 'spec/cucumber/cucumber_expressions/cucumber_expression_generator_spec.rb'
163
+ - 'spec/cucumber/cucumber_expressions/cucumber_expression_spec.rb'
164
+
165
+ # Offense count: 34
166
+ RSpec/MultipleExpectations:
167
+ Max: 30
168
+
169
+ # Offense count: 1
170
+ # Configuration parameters: AllowSubject.
171
+ RSpec/MultipleMemoizedHelpers:
172
+ Max: 6
173
+
174
+ # Offense count: 2
175
+ RSpec/RepeatedDescription:
176
+ Exclude:
177
+ - 'spec/cucumber/cucumber_expressions/tree_regexp_spec.rb'
178
+
179
+ # Offense count: 2
180
+ RSpec/RepeatedExample:
181
+ Exclude:
182
+ - 'spec/cucumber/cucumber_expressions/tree_regexp_spec.rb'
183
+
184
+ # Offense count: 2
185
+ # Configuration parameters: EnforcedStyle, AllowModifiersOnSymbols.
186
+ # SupportedStyles: inline, group
187
+ Style/AccessModifierDeclarations:
188
+ Exclude:
189
+ - 'lib/cucumber/cucumber_expressions/tree_regexp.rb'
190
+
191
+ # Offense count: 4
192
+ # This cop supports safe auto-correction (--auto-correct).
193
+ # Configuration parameters: EnforcedStyle, ProceduralMethods, FunctionalMethods, IgnoredMethods, AllowBracesOnProceduralOneLiners, BracesRequiredMethods.
194
+ # SupportedStyles: line_count_based, semantic, braces_for_chaining, always_braces
195
+ # ProceduralMethods: benchmark, bm, bmbm, create, each_with_object, measure, new, realtime, tap, with_object
196
+ # FunctionalMethods: let, let!, subject, watch
197
+ # IgnoredMethods: lambda, proc, it
198
+ Style/BlockDelimiters:
199
+ Exclude:
200
+ - 'lib/cucumber/cucumber_expressions/cucumber_expression.rb'
201
+ - 'spec/cucumber/cucumber_expressions/cucumber_expression_spec.rb'
202
+ - 'spec/cucumber/cucumber_expressions/cucumber_expression_transformation_spec.rb'
203
+ - 'spec/cucumber/cucumber_expressions/custom_parameter_type_spec.rb'
204
+
205
+ # Offense count: 1
206
+ # This cop supports unsafe auto-correction (--auto-correct-all).
207
+ Style/CaseLikeIf:
208
+ Exclude:
209
+ - 'lib/cucumber/cucumber_expressions/cucumber_expression_parser.rb'
210
+
211
+ # Offense count: 3
212
+ # This cop supports safe auto-correction (--auto-correct).
213
+ Style/ColonMethodCall:
214
+ Exclude:
215
+ - 'lib/cucumber/cucumber_expressions/errors.rb'
216
+
217
+ # Offense count: 1
218
+ # This cop supports safe auto-correction (--auto-correct).
219
+ Style/EmptyLiteral:
220
+ Exclude:
221
+ - 'lib/cucumber/cucumber_expressions/ast.rb'
222
+
223
+ # Offense count: 1
224
+ # This cop supports safe auto-correction (--auto-correct).
225
+ Style/Encoding:
226
+ Exclude:
227
+ - 'cucumber-cucumber-expressions.gemspec'
228
+
229
+ # Offense count: 1
230
+ # This cop supports safe auto-correction (--auto-correct).
231
+ Style/ExpandPathArguments:
232
+ Exclude:
233
+ - 'Rakefile'
234
+
235
+ # Offense count: 2
236
+ # This cop supports safe auto-correction (--auto-correct).
237
+ # Configuration parameters: EnforcedStyle.
238
+ # SupportedStyles: each, for
239
+ Style/For:
240
+ Exclude:
241
+ - 'lib/cucumber/cucumber_expressions/errors.rb'
242
+ - 'spec/cucumber/cucumber_expressions/cucumber_expression_generator_spec.rb'
243
+
244
+ # Offense count: 1
245
+ # This cop supports safe auto-correction (--auto-correct).
246
+ # Configuration parameters: EnforcedStyle.
247
+ # SupportedStyles: format, sprintf, percent
248
+ Style/FormatString:
249
+ Exclude:
250
+ - 'lib/cucumber/cucumber_expressions/generated_expression.rb'
251
+
252
+ # Offense count: 2
253
+ # Configuration parameters: MinBodyLength.
254
+ Style/GuardClause:
255
+ Exclude:
256
+ - 'lib/cucumber/cucumber_expressions/cucumber_expression_generator.rb'
257
+ - 'lib/cucumber/cucumber_expressions/parameter_type_registry.rb'
258
+
259
+ # Offense count: 1
260
+ # This cop supports unsafe auto-correction (--auto-correct-all).
261
+ # Configuration parameters: InverseMethods, InverseBlocks.
262
+ Style/InverseMethods:
263
+ Exclude:
264
+ - 'lib/cucumber/cucumber_expressions/parameter_type.rb'
265
+
266
+ # Offense count: 1
267
+ # This cop supports safe auto-correction (--auto-correct).
268
+ Style/MultilineTernaryOperator:
269
+ Exclude:
270
+ - 'spec/cucumber/cucumber_expressions/cucumber_expression_spec.rb'
271
+
272
+ # Offense count: 1
273
+ # This cop supports safe auto-correction (--auto-correct).
274
+ Style/NegatedIfElseCondition:
275
+ Exclude:
276
+ - 'lib/cucumber/cucumber_expressions/parameter_type_registry.rb'
277
+
278
+ # Offense count: 1
279
+ # This cop supports safe auto-correction (--auto-correct).
280
+ Style/NestedTernaryOperator:
281
+ Exclude:
282
+ - 'spec/cucumber/cucumber_expressions/cucumber_expression_spec.rb'
283
+
284
+ # Offense count: 2
285
+ # This cop supports safe auto-correction (--auto-correct).
286
+ # Configuration parameters: IncludeSemanticChanges.
287
+ Style/NonNilCheck:
288
+ Exclude:
289
+ - 'lib/cucumber/cucumber_expressions/parameter_type_registry.rb'
290
+
291
+ # Offense count: 11
292
+ # This cop supports unsafe auto-correction (--auto-correct-all).
293
+ # Configuration parameters: EnforcedStyle, IgnoredMethods.
294
+ # SupportedStyles: predicate, comparison
295
+ Style/NumericPredicate:
296
+ Exclude:
297
+ - 'lib/cucumber/cucumber_expressions/cucumber_expression.rb'
298
+ - 'lib/cucumber/cucumber_expressions/cucumber_expression_parser.rb'
299
+ - 'lib/cucumber/cucumber_expressions/cucumber_expression_tokenizer.rb'
300
+ - 'lib/cucumber/cucumber_expressions/parameter_type_matcher.rb'
301
+ - 'lib/cucumber/cucumber_expressions/parameter_type_registry.rb'
302
+
303
+ # Offense count: 6
304
+ # This cop supports safe auto-correction (--auto-correct).
305
+ Style/ParallelAssignment:
306
+ Exclude:
307
+ - 'lib/cucumber/cucumber_expressions/argument.rb'
308
+ - 'lib/cucumber/cucumber_expressions/ast.rb'
309
+ - 'lib/cucumber/cucumber_expressions/generated_expression.rb'
310
+ - 'lib/cucumber/cucumber_expressions/parameter_type.rb'
311
+ - 'lib/cucumber/cucumber_expressions/parameter_type_matcher.rb'
312
+ - 'spec/cucumber/cucumber_expressions/custom_parameter_type_spec.rb'
313
+
314
+ # Offense count: 1
315
+ # This cop supports unsafe auto-correction (--auto-correct-all).
316
+ # Configuration parameters: EnforcedStyle.
317
+ # SupportedStyles: short, verbose
318
+ Style/PreferredHashMethods:
319
+ Exclude:
320
+ - 'lib/cucumber/cucumber_expressions/parameter_type_registry.rb'
321
+
322
+ # Offense count: 9
323
+ # This cop supports safe auto-correction (--auto-correct).
324
+ # Configuration parameters: AllowedCompactTypes.
325
+ # SupportedStyles: compact, exploded
326
+ Style/RaiseArgs:
327
+ EnforcedStyle: compact
328
+
329
+ # Offense count: 6
330
+ # This cop supports unsafe auto-correction (--auto-correct-all).
331
+ # Configuration parameters: Methods.
332
+ Style/RedundantArgument:
333
+ Exclude:
334
+ - 'lib/cucumber/cucumber_expressions/ast.rb'
335
+ - 'lib/cucumber/cucumber_expressions/cucumber_expression.rb'
336
+ - 'lib/cucumber/cucumber_expressions/cucumber_expression_tokenizer.rb'
337
+ - 'lib/cucumber/cucumber_expressions/errors.rb'
338
+
339
+ # Offense count: 1
340
+ # This cop supports safe auto-correction (--auto-correct).
341
+ Style/RedundantInterpolation:
342
+ Exclude:
343
+ - 'lib/cucumber/cucumber_expressions/cucumber_expression.rb'
344
+
345
+ # Offense count: 1
346
+ # This cop supports safe auto-correction (--auto-correct).
347
+ Style/RedundantRegexpCharacterClass:
348
+ Exclude:
349
+ - 'lib/cucumber/cucumber_expressions/parameter_type_registry.rb'
350
+
351
+ # Offense count: 19
352
+ # This cop supports safe auto-correction (--auto-correct).
353
+ # Configuration parameters: AllowMultipleReturnValues.
354
+ Style/RedundantReturn:
355
+ Exclude:
356
+ - 'lib/cucumber/cucumber_expressions/ast.rb'
357
+ - 'lib/cucumber/cucumber_expressions/cucumber_expression.rb'
358
+ - 'lib/cucumber/cucumber_expressions/parameter_type.rb'
359
+
360
+ # Offense count: 1
361
+ # This cop supports safe auto-correction (--auto-correct).
362
+ Style/RedundantSelf:
363
+ Exclude:
364
+ - 'spec/cucumber/cucumber_expressions/cucumber_expression_spec.rb'
365
+
366
+ # Offense count: 1
367
+ # This cop supports safe auto-correction (--auto-correct).
368
+ Style/SelectByRegexp:
369
+ Exclude:
370
+ - 'cucumber-cucumber-expressions.gemspec'
371
+
372
+ # Offense count: 1
373
+ # This cop supports safe auto-correction (--auto-correct).
374
+ # Configuration parameters: AllowAsExpressionSeparator.
375
+ Style/Semicolon:
376
+ Exclude:
377
+ - 'lib/cucumber/cucumber_expressions/parameter_type_registry.rb'
378
+
379
+ # Offense count: 1
380
+ # This cop supports safe auto-correction (--auto-correct).
381
+ # Configuration parameters: RequireEnglish.
382
+ # SupportedStyles: use_perl_names, use_english_names
383
+ Style/SpecialGlobalVars:
384
+ EnforcedStyle: use_perl_names
385
+
386
+ # Offense count: 3
387
+ # This cop supports unsafe auto-correction (--auto-correct-all).
388
+ # Configuration parameters: Mode.
389
+ Style/StringConcatenation:
390
+ Exclude:
391
+ - 'lib/cucumber/cucumber_expressions/cucumber_expression_parser.rb'
392
+ - 'lib/cucumber/cucumber_expressions/errors.rb'
393
+
394
+ # Offense count: 7
395
+ # This cop supports unsafe auto-correction (--auto-correct-all).
396
+ # Configuration parameters: AllowMethodsWithArguments, IgnoredMethods.
397
+ # IgnoredMethods: respond_to, define_method
398
+ Style/SymbolProc:
399
+ Exclude:
400
+ - 'lib/cucumber/cucumber_expressions/ast.rb'
401
+ - 'lib/cucumber/cucumber_expressions/cucumber_expression_parser.rb'
402
+ - 'lib/cucumber/cucumber_expressions/errors.rb'
403
+ - 'spec/cucumber/cucumber_expressions/combinatorial_generated_expression_factory_spec.rb'
404
+ - 'spec/cucumber/cucumber_expressions/cucumber_expression_tokenizer_spec.rb'
405
+ - 'spec/cucumber/cucumber_expressions/tree_regexp_spec.rb'
406
+
407
+ # Offense count: 2
408
+ # This cop supports safe auto-correction (--auto-correct).
409
+ # Configuration parameters: EnforcedStyleForMultiline.
410
+ # SupportedStylesForMultiline: comma, consistent_comma, no_comma
411
+ Style/TrailingCommaInArrayLiteral:
412
+ Exclude:
413
+ - 'lib/cucumber/cucumber_expressions/cucumber_expression_parser.rb'
414
+ - 'spec/cucumber/cucumber_expressions/combinatorial_generated_expression_factory_spec.rb'
415
+
416
+ # Offense count: 1
417
+ # This cop supports safe auto-correction (--auto-correct).
418
+ # Configuration parameters: EnforcedStyleForMultiline.
419
+ # SupportedStylesForMultiline: comma, consistent_comma, no_comma
420
+ Style/TrailingCommaInHashLiteral:
421
+ Exclude:
422
+ - 'cucumber-cucumber-expressions.gemspec'
423
+
424
+ # Offense count: 1
425
+ # This cop supports safe auto-correction (--auto-correct).
426
+ Style/WhileUntilDo:
427
+ Exclude:
428
+ - 'lib/cucumber/cucumber_expressions/cucumber_expression_parser.rb'
429
+
430
+ # Offense count: 6
431
+ # This cop supports safe auto-correction (--auto-correct).
432
+ # Configuration parameters: MinSize, WordRegex.
433
+ # SupportedStyles: percent, brackets
434
+ Style/WordArray:
435
+ EnforcedStyle: brackets
436
+
437
+ # Offense count: 6
438
+ # This cop supports unsafe auto-correction (--auto-correct-all).
439
+ Style/ZeroLengthPredicate:
440
+ Exclude:
441
+ - 'lib/cucumber/cucumber_expressions/cucumber_expression.rb'
442
+ - 'lib/cucumber/cucumber_expressions/cucumber_expression_tokenizer.rb'
443
+ - 'lib/cucumber/cucumber_expressions/parameter_type_registry.rb'
data/Gemfile CHANGED
@@ -1,3 +1,4 @@
1
1
  # frozen_string_literal: true
2
- source "https://rubygems.org"
2
+
3
+ source 'https://rubygems.org'
3
4
  gemspec
data/Rakefile CHANGED
@@ -1,25 +1,12 @@
1
- # encoding: utf-8
2
- require 'rubygems'
3
- require 'bundler'
4
- Bundler::GemHelper.install_tasks
1
+ # frozen_string_literal: true
5
2
 
6
- $:.unshift File.expand_path("../lib", __FILE__)
3
+ $:.unshift File.expand_path('../lib', __FILE__)
7
4
 
8
5
  Dir['./rake/*.rb'].each do |f|
9
6
  require f
10
7
  end
11
8
 
12
- require "rspec/core/rake_task"
9
+ require 'rspec/core/rake_task'
13
10
  RSpec::Core::RakeTask.new(:spec)
14
11
 
15
- require_relative 'spec/capture_warnings'
16
- include CaptureWarnings
17
- namespace :spec do
18
- task :warnings do
19
- report_warnings do
20
- Rake::Task['spec'].invoke
21
- end
22
- end
23
- end
24
-
25
- task default: ['spec:warnings']
12
+ task default: :spec
data/VERSION CHANGED
@@ -1 +1 @@
1
- 16.1.2
1
+ 17.0.2
@@ -1,33 +1,38 @@
1
1
  # -*- encoding: utf-8 -*-
2
+ # frozen_string_literal: true
2
3
 
3
- version = File.read(File.expand_path("VERSION", __dir__)).strip
4
+ version = File.read(File.expand_path('VERSION', __dir__)).strip
4
5
 
5
6
  Gem::Specification.new do |s|
6
7
  s.name = 'cucumber-cucumber-expressions'
7
8
  s.version = version
8
- s.authors = ["Aslak Hellesøy"]
9
+ s.authors = ['Aslak Hellesøy']
9
10
  s.description = 'Cucumber Expressions - a simpler alternative to Regular Expressions'
10
11
  s.summary = "cucumber-expressions-#{s.version}"
11
12
  s.email = 'cukes@googlegroups.com'
12
- s.homepage = "https://github.com/cucumber/cucumber-expressions-ruby#readme"
13
+ s.homepage = 'https://github.com/cucumber/cucumber-expressions'
13
14
  s.platform = Gem::Platform::RUBY
14
- s.license = "MIT"
15
- s.required_ruby_version = ">= 2.3"
15
+ s.license = 'MIT'
16
+ s.required_ruby_version = '>= 2.5'
16
17
 
17
- s.metadata = {
18
- 'bug_tracker_uri' => 'https://github.com/cucumber/cucumber/issues',
19
- 'changelog_uri' => 'https://github.com/cucumber/common/blob/main/cucumber-expressions/CHANGELOG.md',
20
- 'documentation_uri' => 'https://cucumber.io/docs/cucumber/cucumber-expressions/',
21
- 'mailing_list_uri' => 'https://groups.google.com/forum/#!forum/cukes',
22
- 'source_code_uri' => 'https://github.com/cucumber/common/blob/main/cucumber-expressions/ruby',
23
- }
18
+ s.metadata = {
19
+ 'bug_tracker_uri' => 'https://github.com/cucumber/cucumber/issues',
20
+ 'changelog_uri' => 'https://github.com/cucumber/common/blob/main/cucumber-expressions/CHANGELOG.md',
21
+ 'documentation_uri' => 'https://cucumber.io/docs/cucumber/cucumber-expressions/',
22
+ 'mailing_list_uri' => 'https://groups.google.com/forum/#!forum/cukes',
23
+ 'source_code_uri' => 'https://github.com/cucumber/common/blob/main/cucumber-expressions/ruby',
24
+ }
25
+
26
+ s.add_runtime_dependency 'bigdecimal'
24
27
 
25
28
  s.add_development_dependency 'rake', '~> 13.0', '>= 13.0.6'
26
29
  s.add_development_dependency 'rspec', '~> 3.11', '>= 3.11.0'
30
+ s.add_development_dependency 'rubocop', '~> 1.27.0'
31
+ s.add_development_dependency 'rubocop-performance', '~> 1.7.0'
32
+ s.add_development_dependency 'rubocop-rake', '~> 0.5.0'
33
+ s.add_development_dependency 'rubocop-rspec', '~> 2.0.0'
27
34
 
28
- s.rubygems_version = ">= 1.6.1"
29
- s.files = `git ls-files`.split("\n").reject {|path| path =~ /\.gitignore$/ }
30
- s.test_files = `git ls-files -- spec/*`.split("\n")
31
- s.rdoc_options = ["--charset=UTF-8"]
32
- s.require_path = "lib"
35
+ s.files = `git ls-files`.split("\n").reject { |path| path =~ /\.gitignore$/ }
36
+ s.rdoc_options = ['--charset=UTF-8']
37
+ s.require_path = 'lib'
33
38
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'cucumber/cucumber_expressions/group'
2
4
  require 'cucumber/cucumber_expressions/errors'
3
5
 
@@ -14,7 +16,8 @@ module Cucumber
14
16
 
15
17
  if arg_groups.length != parameter_types.length
16
18
  raise CucumberExpressionError.new(
17
- "Expression #{tree_regexp.regexp.inspect} has #{arg_groups.length} capture groups (#{arg_groups.map(&:value)}), but there were #{parameter_types.length} parameter types (#{parameter_types.map(&:name)})"
19
+ "Expression #{tree_regexp.regexp.inspect} has #{arg_groups.length} capture groups (#{arg_groups.map(&:value)}), " \
20
+ "but there were #{parameter_types.length} parameter types (#{parameter_types.map(&:name)})"
18
21
  )
19
22
  end
20
23
 
@@ -27,8 +30,9 @@ module Cucumber
27
30
  @group, @parameter_type = group, parameter_type
28
31
  end
29
32
 
30
- def value(self_obj=:nil)
31
- raise "No self_obj" if self_obj == :nil
33
+ def value(self_obj = :nil)
34
+ raise 'No self_obj' if self_obj == :nil
35
+
32
36
  group_values = @group ? @group.values : nil
33
37
  @parameter_type.transform(self_obj, group_values)
34
38
  end