cuke_modeler 3.5.0 → 3.6.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: ba3e400ea68f67944c0c5bf170179fb50a60237e507d3113a921c844010f7d91
4
- data.tar.gz: 6224ca8ff2505acfb0415c82e9b1963ba5cf21573e2a9cac8857cb63171b288f
3
+ metadata.gz: 599071d6967852941776e6bcfe690c2fcdb9f294c99d497dd5f18b69305ca0ab
4
+ data.tar.gz: 7d51fc3ad42c67520a5c374d84ee178a1d6f1aae40d1208888d9c58bfdcef8d6
5
5
  SHA512:
6
- metadata.gz: a447530c96482e6464ad31151262e5a0fbfd11527445ae8965c834e6ece15ee33f89381eb2276d7ee043823ab491eaed932bb35f492bfdb2fe8a43defd605e37
7
- data.tar.gz: e8b05b052cad1f7395dec1e8da58bd84145c1699dce19b9bb261eb76bf29ceb1ebf3e7fa2cfe13773ff9f29f8c86d93543f9a5a34f79b1fc2fe402257618bbe7
6
+ metadata.gz: 1c9c233ece2d62ca17ae1a370918651c4b97ff96cff408059de93cd9bffd7ce9eed78b728fd56ea5c84d4e7234dc3977af9904e932924f2ec23ff9c94a3a09f9
7
+ data.tar.gz: fa19be7a982e76b4ce9fae430f633b5933a90ec44e6414da94c7d2ea2d668a526f26c4d7b8393354496ec241a73d3bf947bc5380da22266ca2a55073bfcb5430
@@ -8,6 +8,21 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
8
8
 
9
9
  Nothing yet...
10
10
 
11
+ ## [3.6.0] - 2021-01-05
12
+
13
+ ### Added
14
+ - Ruby 3.x is now supported
15
+ - All models are now `Enumerable`. However, some methods such as `Enumerable#max` and `Enumerable#sort` do not work
16
+ because models do not meaningfully compare to each other.
17
+
18
+ ### Deprecated
19
+ - `Model#each_descendant` and `Model#each_model` will be removed on the next major release. `Model#each` and methods in
20
+ the `Enumerable` module now provide this kind of functionality.
21
+
22
+ ### Fixed
23
+ - `Row#children` now returns the row's `Cell` models instead of returning an empty array
24
+
25
+
11
26
  ## [3.5.0] - 2020-12-19
12
27
 
13
28
  ### Added
@@ -329,7 +344,7 @@ Nothing yet...
329
344
 
330
345
  ### Fixed
331
346
 
332
- - Fixed a bug that was causing object comparison using #== to not
347
+ - Fixed a bug that was causing object comparison using `#==` to not
333
348
  work when comparing some models to other types of objects.
334
349
 
335
350
 
@@ -340,7 +355,8 @@ Nothing yet...
340
355
  - Initial release
341
356
 
342
357
 
343
- [Unreleased]: https://github.com/enkessler/cuke_modeler/compare/v3.5.0...HEAD
358
+ [Unreleased]: https://github.com/enkessler/cuke_modeler/compare/v3.6.0...HEAD
359
+ [3.6.0]: https://github.com/enkessler/cuke_modeler/compare/v3.5.0...v3.6.0
344
360
  [3.5.0]: https://github.com/enkessler/cuke_modeler/compare/v3.4.0...v3.5.0
345
361
  [3.4.0]: https://github.com/enkessler/cuke_modeler/compare/v3.3.0...v3.4.0
346
362
  [3.3.0]: https://github.com/enkessler/cuke_modeler/compare/v3.2.0...v3.3.0
@@ -26,7 +26,7 @@ Gem::Specification.new do |spec|
26
26
  end
27
27
  spec.require_paths = ['lib']
28
28
 
29
- spec.required_ruby_version = '>= 2.3', '< 3.0'
29
+ spec.required_ruby_version = '>= 2.3', '< 4.0'
30
30
 
31
31
  spec.add_runtime_dependency 'cucumber-gherkin', '< 17.0'
32
32
 
@@ -8,7 +8,22 @@ module CukeModeler
8
8
 
9
9
  module Containing
10
10
 
11
+ include Enumerable
12
+
13
+ # Executes the given code block with this model and every model that is a child of this model. Exact
14
+ # order of model tree traversal is not guaranteed beyond the first model traversed, which will be the
15
+ # model that called this method.
16
+ def each(&block)
17
+ if block
18
+ block.call(self)
19
+ children.each { |child| child.each(&block) }
20
+ else
21
+ to_enum(:each)
22
+ end
23
+ end
24
+
11
25
  # Executes the given code block with every model that is a child of this model.
26
+ # DEPRECATED: use `Enumerable` module methods instead
12
27
  def each_descendant(&block)
13
28
  children.each do |child_model|
14
29
  block.call(child_model)
@@ -17,6 +32,7 @@ module CukeModeler
17
32
  end
18
33
 
19
34
  # Executes the given code block with this model and every model that is a child of this model.
35
+ # DEPRECATED: use `Enumerable` module methods instead
20
36
  def each_model(&block)
21
37
  block.call(self)
22
38
 
@@ -25,7 +25,6 @@ module CukeModeler
25
25
 
26
26
  # Returns the model objects that belong to this model.
27
27
  def children
28
- # This should be overridden by a child class
29
28
  []
30
29
  end
31
30
 
@@ -25,6 +25,11 @@ module CukeModeler
25
25
  populate_row(self, parsed_row_data)
26
26
  end
27
27
 
28
+ # Returns the model objects that belong to this model.
29
+ def children
30
+ @cells
31
+ end
32
+
28
33
  # Returns a string representation of this model. For a row model,
29
34
  # this will be Gherkin text that is equivalent to the row being modeled.
30
35
  def to_s
@@ -1,4 +1,4 @@
1
1
  module CukeModeler
2
2
  # The gem version
3
- VERSION = '3.5.0'.freeze
3
+ VERSION = '3.6.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.5.0
4
+ version: 3.6.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: 2020-12-19 00:00:00.000000000 Z
11
+ date: 2021-01-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cucumber-gherkin
@@ -271,7 +271,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
271
271
  version: '2.3'
272
272
  - - "<"
273
273
  - !ruby/object:Gem::Version
274
- version: '3.0'
274
+ version: '4.0'
275
275
  required_rubygems_version: !ruby/object:Gem::Requirement
276
276
  requirements:
277
277
  - - ">="