cuke_modeler 3.21.0 → 3.23.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a3c4bf65cd4d0e8f4e2a4c783a4f1147a65f009661058c93c396f7cd6e4f4a11
4
- data.tar.gz: 2856196601bbc71ca23a3a8d355c0b3f2f143ebfe6c0a914362edbe1217c939a
3
+ metadata.gz: 4e951f57a8dc94e2ff37d7eadb8866e39fdc84629589b24b10e7c8a78a9a3348
4
+ data.tar.gz: 6d971bb502add53d04e38dd835ad9d021b68fa54f9e9e3179d4d1aaa36f81444
5
5
  SHA512:
6
- metadata.gz: 3593c025a6b88c7c7c2b629741cc5f612075f64bcd587c3378a4ba1e48655fb341830f1e2dca46ca3c265a3e16b9d4c73d0f637c29d0f776fbaf9e0c46cfc5ac
7
- data.tar.gz: 6b370fe5e4598a0ec9836a43ea664d3bd20560402e6a937f251e03d6c61548f542db202798e8db77c009b3fa1c8ab734c8a6ed839eb652a60a988f334c0ac92f
6
+ metadata.gz: c33597cb563ed2617a8b381ef64cb0bc4b2d5498effe0d613aa9d903f0e9359d222c9147b834db38f851a71cdcfe23f3525c8e1b00b66d3381a516cc7d019603
7
+ data.tar.gz: 563575b9ba2412d869f224623f9047e86a513ada5d3e30a8e60f4621016bf70678c02cf09bec21e775a4a7e50b062c6f4ecfe20d0849cd741a4168c270f1bf42
data/CHANGELOG.md CHANGED
@@ -9,6 +9,20 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
9
9
  Nothing yet...
10
10
 
11
11
 
12
+ ## [3.23.0] - 2024-10-31
13
+
14
+ ### Added
15
+ - Support added for more versions of the `cucumber-gherkin` gem
16
+ - 30.x
17
+
18
+
19
+ ## [3.22.0] - 2024-10-01
20
+
21
+ ### Added
22
+ - Support added for more versions of the `cucumber-gherkin` gem
23
+ - 29.x
24
+
25
+
12
26
  ## [3.21.0] - 2024-03-11
13
27
 
14
28
  ### Added
@@ -472,7 +486,9 @@ Nothing yet...
472
486
  - Initial release
473
487
 
474
488
 
475
- [Unreleased]: https://github.com/enkessler/cuke_modeler/compare/v3.21.0...HEAD
489
+ [Unreleased]: https://github.com/enkessler/cuke_modeler/compare/v3.23.0...HEAD
490
+ [3.23.0]: https://github.com/enkessler/cuke_modeler/compare/v3.22.0...v3.23.0
491
+ [3.22.0]: https://github.com/enkessler/cuke_modeler/compare/v3.21.1...v3.22.0
476
492
  [3.21.0]: https://github.com/enkessler/cuke_modeler/compare/v3.20.1...v3.21.0
477
493
  [3.20.1]: https://github.com/enkessler/cuke_modeler/compare/v3.20.0...v3.20.1
478
494
  [3.20.0]: https://github.com/enkessler/cuke_modeler/compare/v3.19.0...v3.20.0
data/cuke_modeler.gemspec CHANGED
@@ -37,7 +37,7 @@ Gem::Specification.new do |spec|
37
37
 
38
38
  spec.required_ruby_version = '>= 2.3', '< 4.0'
39
39
 
40
- spec.add_runtime_dependency 'cucumber-gherkin', '< 29.0'
40
+ spec.add_runtime_dependency 'cucumber-gherkin', '< 31.0'
41
41
 
42
42
  spec.add_development_dependency 'bundler', '< 3.0'
43
43
  spec.add_development_dependency 'childprocess', '< 5.0'
@@ -11,7 +11,7 @@ module CukeModeler
11
11
 
12
12
  # Adapts the AST sub-tree that is rooted at the given rule node.
13
13
  def adapt_rule(rule_ast)
14
- adapted_rule = super(rule_ast)
14
+ adapted_rule = super
15
15
 
16
16
  clear_child_elements(adapted_rule, [[:rule, :tags]])
17
17
 
@@ -11,7 +11,7 @@ module CukeModeler
11
11
 
12
12
  # Adapts the AST sub-tree that is rooted at the given step node.
13
13
  def adapt_step(step_ast)
14
- adapted_step = super(step_ast)
14
+ adapted_step = super
15
15
 
16
16
  clear_child_elements(adapted_step, [[:dataTable],
17
17
  [:docString]])
@@ -27,7 +27,7 @@ module CukeModeler
27
27
 
28
28
  # Adapts the AST sub-tree that is rooted at the given doc string node.
29
29
  def adapt_doc_string(doc_string_ast)
30
- adapted_doc_string = super(doc_string_ast)
30
+ adapted_doc_string = super
31
31
 
32
32
  adapted_doc_string['content_type'] = doc_string_ast[:mediaType]
33
33
 
@@ -36,7 +36,7 @@ module CukeModeler
36
36
 
37
37
  # Adapts the AST sub-tree that is rooted at the given example node.
38
38
  def adapt_example(example_ast)
39
- adapted_example = super(example_ast)
39
+ adapted_example = super
40
40
 
41
41
  clear_child_elements(adapted_example, [[:tableHeader],
42
42
  [:tableBody]])
@@ -303,19 +303,15 @@ module CukeModeler
303
303
  end
304
304
 
305
305
  def adapt_child_elements(element_ast)
306
- adapted_children = []
307
-
308
- element_ast.children.each do |child_element|
309
- adapted_children << if child_element.background
310
- adapt_background(child_element)
311
- elsif child_element.respond_to?(:rule) && child_element.rule
312
- adapt_rule(child_element)
313
- else
314
- adapt_test(child_element)
315
- end
306
+ element_ast.children.map do |child_element|
307
+ if child_element.background
308
+ adapt_background(child_element)
309
+ elsif child_element.respond_to?(:rule) && child_element.rule
310
+ adapt_rule(child_element)
311
+ else
312
+ adapt_test(child_element)
313
+ end
316
314
  end
317
-
318
- adapted_children
319
315
  end
320
316
 
321
317
  def adapt_test(test_ast)
@@ -0,0 +1,13 @@
1
+ require_relative 'gherkin_20_adapter'
2
+
3
+
4
+ module CukeModeler
5
+
6
+ # @api private
7
+ #
8
+ # An adapter that can convert the output of version 29.x of the *cucumber-gherkin* gem into input that is consumable
9
+ # by this gem. Internal helper class.
10
+ class Gherkin29Adapter < Gherkin20Adapter; end
11
+
12
+ private_constant :Gherkin29Adapter
13
+ end
@@ -0,0 +1,13 @@
1
+ require_relative 'gherkin_20_adapter'
2
+
3
+
4
+ module CukeModeler
5
+
6
+ # @api private
7
+ #
8
+ # An adapter that can convert the output of version 30.x of the *cucumber-gherkin* gem into input that is consumable
9
+ # by this gem. Internal helper class.
10
+ class Gherkin30Adapter < Gherkin20Adapter; end
11
+
12
+ private_constant :Gherkin30Adapter
13
+ end
@@ -312,19 +312,15 @@ module CukeModeler
312
312
  def adapt_child_elements(element_ast)
313
313
  return [] unless element_ast[:children]
314
314
 
315
- adapted_children = []
316
-
317
- element_ast[:children].each do |child_element|
318
- adapted_children << if child_element[:background]
319
- adapt_background(child_element)
320
- elsif child_element[:rule]
321
- adapt_rule(child_element)
322
- else
323
- adapt_test(child_element)
324
- end
315
+ element_ast[:children].map do |child_element|
316
+ if child_element[:background]
317
+ adapt_background(child_element)
318
+ elsif child_element[:rule]
319
+ adapt_rule(child_element)
320
+ else
321
+ adapt_test(child_element)
322
+ end
325
323
  end
326
-
327
- adapted_children
328
324
  end
329
325
 
330
326
  def adapt_test(test_ast)
@@ -28,7 +28,7 @@ module CukeModeler
28
28
  def initialize(source_text = nil)
29
29
  @steps = []
30
30
 
31
- super(source_text)
31
+ super
32
32
  end
33
33
 
34
34
  # TODO: Have (all) models be equivalent if they have the same #to_s output. Would
@@ -91,7 +91,7 @@ module CukeModeler
91
91
  # the object. Defaults to false.
92
92
  # @return [String] A string representation of this model
93
93
  def inspect(verbose: false)
94
- return super(verbose: verbose) if verbose
94
+ return super if verbose
95
95
 
96
96
  "#{super.chop} @name: #{name.inspect}>"
97
97
  end
@@ -23,7 +23,7 @@ module CukeModeler
23
23
  # @raise [ArgumentError] If *source_text* is not a String
24
24
  # @return [Cell] A new Cell instance
25
25
  def initialize(source_text = nil)
26
- super(source_text)
26
+ super
27
27
  end
28
28
 
29
29
  # Returns a string representation of this model. For a Cell model,
@@ -52,7 +52,7 @@ module CukeModeler
52
52
  # the object. Defaults to false.
53
53
  # @return [String] A string representation of this model
54
54
  def inspect(verbose: false)
55
- return super(verbose: verbose) if verbose
55
+ return super if verbose
56
56
 
57
57
  "#{super.chop} @value: #{value.inspect}>"
58
58
  end
@@ -23,7 +23,7 @@ module CukeModeler
23
23
  # @raise [ArgumentError] If *source_text* is not a String
24
24
  # @return [Comment] A new Comment instance
25
25
  def initialize(source_text = nil)
26
- super(source_text)
26
+ super
27
27
  end
28
28
 
29
29
  # Returns a string representation of this model. For a Comment model,
@@ -50,7 +50,7 @@ module CukeModeler
50
50
  # the object. Defaults to false.
51
51
  # @return [String] A string representation of this model
52
52
  def inspect(verbose: false)
53
- return super(verbose: verbose) if verbose
53
+ return super if verbose
54
54
 
55
55
  "#{super.chop} @text: #{text.inspect}>"
56
56
  end
@@ -30,7 +30,7 @@ module CukeModeler
30
30
  @feature_files = []
31
31
  @directories = []
32
32
 
33
- super(directory_path)
33
+ super
34
34
  end
35
35
 
36
36
  # Returns the name of the modeled directory.
@@ -81,7 +81,7 @@ module CukeModeler
81
81
  # the object. Defaults to false.
82
82
  # @return [String] A string representation of this model
83
83
  def inspect(verbose: false)
84
- return super(verbose: verbose) if verbose
84
+ return super if verbose
85
85
 
86
86
  "#{super.chop} @path: #{@path.inspect}>"
87
87
  end
@@ -26,7 +26,7 @@ module CukeModeler
26
26
  # @raise [ArgumentError] If *source_text* is not a String
27
27
  # @return [DocString] A new DocString instance
28
28
  def initialize(source_text = nil)
29
- super(source_text)
29
+ super
30
30
  end
31
31
 
32
32
  # Returns a string representation of this model. For a DocString model,
@@ -56,7 +56,7 @@ module CukeModeler
56
56
  # the object. Defaults to false.
57
57
  # @return [String] A string representation of this model
58
58
  def inspect(verbose: false)
59
- return super(verbose: verbose) if verbose
59
+ return super if verbose
60
60
 
61
61
  "#{super.chop} @content: #{content.inspect}>"
62
62
  end
@@ -35,7 +35,7 @@ module CukeModeler
35
35
  @tags = []
36
36
  @rows = []
37
37
 
38
- super(source_text)
38
+ super
39
39
  end
40
40
 
41
41
  # TODO: Deprecate using symbol keys in a Hash
@@ -183,7 +183,7 @@ module CukeModeler
183
183
  # the object. Defaults to false.
184
184
  # @return [String] A string representation of this model
185
185
  def inspect(verbose: false)
186
- return super(verbose: verbose) if verbose
186
+ return super if verbose
187
187
 
188
188
  "#{super.chop} @name: #{name.inspect}>"
189
189
  end
@@ -41,7 +41,7 @@ module CukeModeler
41
41
  @rules = []
42
42
  @tests = []
43
43
 
44
- super(source_text)
44
+ super
45
45
  end
46
46
 
47
47
  # Returns *true* if the feature contains a background, *false* otherwise.
@@ -150,7 +150,7 @@ module CukeModeler
150
150
  # the object. Defaults to false.
151
151
  # @return [String] A string representation of this model
152
152
  def inspect(verbose: false)
153
- return super(verbose: verbose) if verbose
153
+ return super if verbose
154
154
 
155
155
  "#{super.chop} @name: #{name.inspect}>"
156
156
  end
@@ -31,7 +31,7 @@ module CukeModeler
31
31
  @path = file_path
32
32
  @comments = []
33
33
 
34
- super(file_path)
34
+ super
35
35
  end
36
36
 
37
37
  # Returns the name of the modeled feature file.
@@ -81,7 +81,7 @@ module CukeModeler
81
81
  # the object. Defaults to false.
82
82
  # @return [String] A string representation of this model
83
83
  def inspect(verbose: false)
84
- return super(verbose: verbose) if verbose
84
+ return super if verbose
85
85
 
86
86
  "#{super.chop} @path: #{@path.inspect}>"
87
87
  end
@@ -34,7 +34,7 @@ module CukeModeler
34
34
  @tags = []
35
35
  @examples = []
36
36
 
37
- super(source_text)
37
+ super
38
38
  end
39
39
 
40
40
  # Compares this model with another object. Returns *true* if the two objects
@@ -102,7 +102,7 @@ module CukeModeler
102
102
  # the object. Defaults to false.
103
103
  # @return [String] A string representation of this model
104
104
  def inspect(verbose: false)
105
- return super(verbose: verbose) if verbose
105
+ return super if verbose
106
106
 
107
107
  "#{super.chop} @name: #{name.inspect}>"
108
108
  end
@@ -24,7 +24,7 @@ module CukeModeler
24
24
  def initialize(source_text = nil)
25
25
  @cells = []
26
26
 
27
- super(source_text)
27
+ super
28
28
  end
29
29
 
30
30
  # Returns the model objects that are children of this model. For a
@@ -65,7 +65,7 @@ module CukeModeler
65
65
  # the object. Defaults to false.
66
66
  # @return [String] A string representation of this model
67
67
  def inspect(verbose: false)
68
- return super(verbose: verbose) if verbose
68
+ return super if verbose
69
69
 
70
70
  cell_output = @cells&.collect(&:value)
71
71
 
@@ -35,7 +35,7 @@ module CukeModeler
35
35
  @tags = []
36
36
  @tests = []
37
37
 
38
- super(source_text)
38
+ super
39
39
  end
40
40
 
41
41
  # Returns *true* if the rule contains a background, *false* otherwise.
@@ -118,7 +118,7 @@ module CukeModeler
118
118
  # the object. Defaults to false.
119
119
  # @return [String] A string representation of this model
120
120
  def inspect(verbose: false)
121
- return super(verbose: verbose) if verbose
121
+ return super if verbose
122
122
 
123
123
  "#{super.chop} @name: #{@name.inspect}>"
124
124
  end
@@ -30,7 +30,7 @@ module CukeModeler
30
30
  @steps = []
31
31
  @tags = []
32
32
 
33
- super(source_text)
33
+ super
34
34
  end
35
35
 
36
36
  # Compares this model with another object. Returns *true* if the two objects
@@ -96,7 +96,7 @@ module CukeModeler
96
96
  # the object. Defaults to false.
97
97
  # @return [String] A string representation of this model
98
98
  def inspect(verbose: false)
99
- return super(verbose: verbose) if verbose
99
+ return super if verbose
100
100
 
101
101
  "#{super.chop} @name: #{name.inspect}>"
102
102
  end
@@ -29,7 +29,7 @@ module CukeModeler
29
29
  # @raise [ArgumentError] If *source_text* is not a String
30
30
  # @return [Step] A new Step instance
31
31
  def initialize(source_text = nil)
32
- super(source_text)
32
+ super
33
33
  end
34
34
 
35
35
  # Compares this model with another object. Returns *true* if the two objects
@@ -87,7 +87,7 @@ module CukeModeler
87
87
  # the object. Defaults to false.
88
88
  # @return [String] A string representation of this model
89
89
  def inspect(verbose: false)
90
- return super(verbose: verbose) if verbose
90
+ return super if verbose
91
91
 
92
92
  "#{super.chop} @text: #{@text.inspect}>"
93
93
  end
@@ -25,7 +25,7 @@ module CukeModeler
25
25
  def initialize(source_text = nil)
26
26
  @rows = []
27
27
 
28
- super(source_text)
28
+ super
29
29
  end
30
30
 
31
31
  # Returns the model objects that are children of this model. For a
@@ -64,7 +64,7 @@ module CukeModeler
64
64
  # the object. Defaults to false.
65
65
  # @return [String] A string representation of this model
66
66
  def inspect(verbose: false)
67
- return super(verbose: verbose) if verbose
67
+ return super if verbose
68
68
 
69
69
  row_output = @rows&.collect { |row| row.cells.collect(&:value) }
70
70
 
@@ -20,7 +20,7 @@ module CukeModeler
20
20
  # @raise [ArgumentError] If *source_text* is not a String
21
21
  # @return [Tag] A new Tag instance
22
22
  def initialize(source_text = nil)
23
- super(source_text)
23
+ super
24
24
  end
25
25
 
26
26
  # Returns a string representation of this model. For a Tag model,
@@ -47,7 +47,7 @@ module CukeModeler
47
47
  # the object. Defaults to false.
48
48
  # @return [String] A string representation of this model
49
49
  def inspect(verbose: false)
50
- return super(verbose: verbose) if verbose
50
+ return super if verbose
51
51
 
52
52
  "#{super.chop} @name: #{@name.inspect}>"
53
53
  end
@@ -9,7 +9,7 @@ require 'gherkin'
9
9
  # an 'adapter' appropriate to the version of the *cucumber-gherkin* gem that has been activated.
10
10
  gherkin_version = Gem.loaded_specs['cucumber-gherkin'].version.version
11
11
  gherkin_major_version = gherkin_version.match(/^(\d+)\./)[1].to_i
12
- supported_gherkin_versions = (9..28)
12
+ supported_gherkin_versions = (9..30)
13
13
 
14
14
  raise("Unknown Gherkin version: '#{gherkin_version}'") unless supported_gherkin_versions.include?(gherkin_major_version)
15
15
 
@@ -86,7 +86,7 @@ module CukeModeler
86
86
  # inside of it, so I'm leaving this here in case it changes again
87
87
  # rubocop:disable Lint/DuplicateMethods
88
88
  case gherkin_major_version
89
- when 20, 21, 22, 23, 24, 25, 26, 27, 28
89
+ when 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30
90
90
  # The method to use for parsing Gherkin text
91
91
  def parsing_method(source_text, filename)
92
92
  messages = Gherkin.from_source(filename,
@@ -1,4 +1,4 @@
1
1
  module CukeModeler
2
2
  # The gem version
3
- VERSION = '3.21.0'.freeze
3
+ VERSION = '3.23.0'.freeze
4
4
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cuke_modeler
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.21.0
4
+ version: 3.23.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eric Kessler
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-03-11 00:00:00.000000000 Z
11
+ date: 2024-10-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cucumber-gherkin
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "<"
18
18
  - !ruby/object:Gem::Version
19
- version: '29.0'
19
+ version: '31.0'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "<"
25
25
  - !ruby/object:Gem::Version
26
- version: '29.0'
26
+ version: '31.0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: bundler
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -235,6 +235,8 @@ files:
235
235
  - lib/cuke_modeler/adapters/gherkin_26_adapter.rb
236
236
  - lib/cuke_modeler/adapters/gherkin_27_adapter.rb
237
237
  - lib/cuke_modeler/adapters/gherkin_28_adapter.rb
238
+ - lib/cuke_modeler/adapters/gherkin_29_adapter.rb
239
+ - lib/cuke_modeler/adapters/gherkin_30_adapter.rb
238
240
  - lib/cuke_modeler/adapters/gherkin_9_adapter.rb
239
241
  - lib/cuke_modeler/adapters/gherkin_base_adapter.rb
240
242
  - lib/cuke_modeler/containing.rb