cucumber-gherkin 30.0.0 → 30.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2d2a74d7544ccbaad3636051f909746a07a82b2a408a1497c5d5e22aef7cc5e3
4
- data.tar.gz: c3df41f699ce69242dbc4f031bf21d9f806c097d73abf9977d43c8896ce6803e
3
+ metadata.gz: 1308541679426354d1774c47cfb156d478c1c2a9f2cbe955f80923edde84ed50
4
+ data.tar.gz: a8d129ee4f5e4cb39b61137499050ea473fb96f5544a3a83c644e4aba709c74b
5
5
  SHA512:
6
- metadata.gz: 1792227ceb4578bd08cdd47d59baf77d1eb6419c08e233ced30415ed53725e648f1ea6723a2529edf7808094ced7702befca1d8c1a823ccf8b5922682503e4b1
7
- data.tar.gz: c4645bec78256b431bffbf2092bb9fd926de65fc66456efd01978778042d30ec72fc7155fa230d71cc47ded7651bb60534510fe30d62e6a52031b85828d71334
6
+ metadata.gz: 9a28a2b1875e3b1efa780c83f1e4ff5146a7b2241751baa0b1a78469e0b594145bc0b57dee802b3feddfa79020397d3ad3ac65692fd79ec43880da8a40fc2f05
7
+ data.tar.gz: f032122f07f9b07fc596a2c45333490d4f5fabaea3220678871a146802063719c82f8698808c41e699b9a60c211e0209fb97b6431ea3416be63e3ba2703ea374
data/bin/gherkin CHANGED
@@ -1,4 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
2
3
 
3
4
  $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '../lib'))
4
5
 
data/bin/gherkin-ruby CHANGED
@@ -1,2 +1,4 @@
1
1
  #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
2
4
  load(File.dirname(__FILE__) + '/gherkin')
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'cucumber/messages'
2
4
  require_relative 'ast_node'
3
5
 
@@ -17,7 +19,7 @@ module Gherkin
17
19
  @stack.push AstNode.new(rule_type)
18
20
  end
19
21
 
20
- def end_rule(rule_type)
22
+ def end_rule(_rule_type)
21
23
  node = @stack.pop
22
24
  current_node.add(node.rule_type, transform_node(node))
23
25
  end
@@ -79,8 +81,7 @@ module Gherkin
79
81
  cells: get_cells(token)
80
82
  )
81
83
  end
82
- ensure_cell_count(rows)
83
- rows
84
+ rows.tap { ensure_cell_count(rows) }
84
85
  end
85
86
 
86
87
  def ensure_cell_count(rows)
@@ -116,7 +117,7 @@ module Gherkin
116
117
  data_table = node.get_single(:DataTable)
117
118
  doc_string = node.get_single(:DocString)
118
119
 
119
- step = Cucumber::Messages::Step.new(
120
+ Cucumber::Messages::Step.new(
120
121
  location: get_location(step_line, 0),
121
122
  keyword: step_line.matched_keyword,
122
123
  keyword_type: step_line.matched_keyword_type,
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Gherkin
2
4
  class AstNode
3
5
  attr_reader :rule_type
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'cucumber/messages'
2
4
  require 'json'
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Gherkin
2
4
  class ParserError < StandardError; end
3
5
  class AstNodeNotLocatedException < StandardError; end
@@ -30,7 +32,7 @@ module Gherkin
30
32
  end
31
33
 
32
34
  class UnexpectedTokenException < ParserException
33
- def initialize(received_token, expected_token_types, state_comment)
35
+ def initialize(received_token, expected_token_types, _state_comment)
34
36
  message = "expected: #{expected_token_types.join(", ")}, got '#{received_token.token_value.strip}'"
35
37
  column = received_token.location[:column]
36
38
  location = (column.nil? || column.zero?) ? { line: received_token.location[:line], column: received_token.line.indent + 1 } : received_token.location
@@ -39,7 +41,7 @@ module Gherkin
39
41
  end
40
42
 
41
43
  class UnexpectedEOFException < ParserException
42
- def initialize(received_token, expected_token_types, state_comment)
44
+ def initialize(received_token, expected_token_types, _state_comment)
43
45
  message = "unexpected end of file, expected: #{expected_token_types.join(", ")}"
44
46
  super(message, received_token.location)
45
47
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Gherkin
2
4
  class GherkinLine
3
5
  attr_reader :indent, :trimmed_line_text
@@ -88,7 +90,7 @@ module Gherkin
88
90
  items = uncommented_line.split('@')
89
91
 
90
92
  tags = []
91
- items.each { |untrimmed|
93
+ items.each do |untrimmed|
92
94
  item = untrimmed.strip
93
95
  next if item.length == 0
94
96
 
@@ -99,7 +101,7 @@ module Gherkin
99
101
 
100
102
  tags << Span.new(column, '@' + item)
101
103
  column += untrimmed.length + 1
102
- }
104
+ end
103
105
  tags
104
106
  end
105
107