cucumber-gherkin 30.0.0 → 30.0.1

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: 2d2a74d7544ccbaad3636051f909746a07a82b2a408a1497c5d5e22aef7cc5e3
4
- data.tar.gz: c3df41f699ce69242dbc4f031bf21d9f806c097d73abf9977d43c8896ce6803e
3
+ metadata.gz: c8e28c956d49e3459e25aa1dc8aedf72dfbfa31d904426676f1c38126f5954a1
4
+ data.tar.gz: 4f9821c2a63ed6d29c19270081b04389c3c53e6440af042e7e748c7066fad584
5
5
  SHA512:
6
- metadata.gz: 1792227ceb4578bd08cdd47d59baf77d1eb6419c08e233ced30415ed53725e648f1ea6723a2529edf7808094ced7702befca1d8c1a823ccf8b5922682503e4b1
7
- data.tar.gz: c4645bec78256b431bffbf2092bb9fd926de65fc66456efd01978778042d30ec72fc7155fa230d71cc47ded7651bb60534510fe30d62e6a52031b85828d71334
6
+ metadata.gz: 3f517b44e24aa884a2c213a782b931a09f45e1642da6a74b36536f83e5b2863f3b2a45256174fc1886ecd3fbe491ead2f308782ec4b2f431fe86b4a29ba827c8
7
+ data.tar.gz: 378cd806e477186a82ab8a884e927eb4318bf0d03afa50df71f73f02f8f4b2dac0477141ed665002914e26d182ff5aae0c608c404f32b2ab833978eb0142908a
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