cucumber-gherkin 9.2.0 → 10.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/gherkin/gherkin_line.rb +23 -11
- data/lib/gherkin/token_matcher.rb +13 -7
- metadata +7 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 01aa9e9322f0347200ffdc2e899c9ea4d70cde244d0781fb3d1d3db5dbbb1939
|
4
|
+
data.tar.gz: f7f687d566ad7a939243db783418a614629d39c0919bf95e6ba8b3c3846f9b2b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0d87ec9065139133f6462d8858725e68e918856a81d8c9c4d8b33877edb1a5c455bc35f52bde741b36794523da05899cee5bf0276ab476076b5175c51e068adf
|
7
|
+
data.tar.gz: 9cb328c9b31a3a964d3b2c62116f1c922329a894ab27bb2069179259130b4aa18a3308193dbafd298b1e46277e1a8afa67e36204d022e726023220eb52398fd1
|
data/lib/gherkin/gherkin_line.rb
CHANGED
@@ -37,8 +37,9 @@ module Gherkin
|
|
37
37
|
cells = []
|
38
38
|
|
39
39
|
self.split_table_cells(@trimmed_line_text) do |item, column|
|
40
|
-
|
41
|
-
|
40
|
+
# Keeps new lines
|
41
|
+
txt_trimmed_left = item.sub(/\A[ \t\v\f\r\u0085\u00A0]*/, '')
|
42
|
+
txt_trimmed = txt_trimmed_left.sub(/[ \t\v\f\r\u0085\u00A0]*\z/, '')
|
42
43
|
cell_indent = item.length - txt_trimmed_left.length
|
43
44
|
span = Span.new(@indent + column + cell_indent, txt_trimmed)
|
44
45
|
cells.push(span)
|
@@ -81,15 +82,26 @@ module Gherkin
|
|
81
82
|
end
|
82
83
|
|
83
84
|
def tags
|
84
|
-
|
85
|
-
|
86
|
-
items =
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
85
|
+
uncommented_line = @trimmed_line_text.split(/\s#/,2)[0]
|
86
|
+
column = @indent + 1
|
87
|
+
items = uncommented_line.split('@')
|
88
|
+
|
89
|
+
tags = []
|
90
|
+
items.each { |untrimmed|
|
91
|
+
item = untrimmed.strip
|
92
|
+
if item.length == 0
|
93
|
+
next
|
94
|
+
end
|
95
|
+
|
96
|
+
unless item =~ /^\S+$/
|
97
|
+
location = {line: @line_number, column: column}
|
98
|
+
raise ParserException.new('A tag may not contain whitespace', location)
|
99
|
+
end
|
100
|
+
|
101
|
+
tags << Span.new(column, '@' + item)
|
102
|
+
column += untrimmed.length + 1
|
103
|
+
}
|
104
|
+
tags
|
93
105
|
end
|
94
106
|
|
95
107
|
class Span < Struct.new(:column, :text); end
|
@@ -80,7 +80,7 @@ module Gherkin
|
|
80
80
|
if @active_doc_string_separator.nil?
|
81
81
|
# open
|
82
82
|
_match_DocStringSeparator(token, '"""', true) ||
|
83
|
-
|
83
|
+
_match_DocStringSeparator(token, '```', true)
|
84
84
|
else
|
85
85
|
# close
|
86
86
|
_match_DocStringSeparator(token, @active_doc_string_separator, false)
|
@@ -118,10 +118,10 @@ module Gherkin
|
|
118
118
|
|
119
119
|
def match_StepLine(token)
|
120
120
|
keywords = @dialect.given_keywords +
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
121
|
+
@dialect.when_keywords +
|
122
|
+
@dialect.then_keywords +
|
123
|
+
@dialect.and_keywords +
|
124
|
+
@dialect.but_keywords
|
125
125
|
|
126
126
|
keyword = keywords.detect { |k| token.line.start_with?(k) }
|
127
127
|
|
@@ -152,7 +152,7 @@ module Gherkin
|
|
152
152
|
true
|
153
153
|
end
|
154
154
|
|
155
|
-
def set_token_matched(token, matched_type, text=nil, keyword=nil, indent=nil, items=[])
|
155
|
+
def set_token_matched(token, matched_type, text = nil, keyword = nil, indent = nil, items = [])
|
156
156
|
token.matched_type = matched_type
|
157
157
|
token.matched_text = text && text.chomp
|
158
158
|
token.matched_keyword = keyword
|
@@ -163,7 +163,13 @@ module Gherkin
|
|
163
163
|
end
|
164
164
|
|
165
165
|
def unescape_docstring(text)
|
166
|
-
@active_doc_string_separator
|
166
|
+
if @active_doc_string_separator == "\"\"\""
|
167
|
+
text.gsub("\\\"\\\"\\\"", "\"\"\"")
|
168
|
+
elsif @active_doc_string_separator == "```"
|
169
|
+
text.gsub("\\`\\`\\`", "```")
|
170
|
+
else
|
171
|
+
text
|
172
|
+
end
|
167
173
|
end
|
168
174
|
end
|
169
175
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cucumber-gherkin
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 10.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gáspár Nagy
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2020-
|
13
|
+
date: 2020-02-13 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: cucumber-messages
|
@@ -18,20 +18,20 @@ dependencies:
|
|
18
18
|
requirements:
|
19
19
|
- - "~>"
|
20
20
|
- !ruby/object:Gem::Version
|
21
|
-
version: '
|
21
|
+
version: '10.0'
|
22
22
|
- - ">="
|
23
23
|
- !ruby/object:Gem::Version
|
24
|
-
version:
|
24
|
+
version: 10.0.1
|
25
25
|
type: :runtime
|
26
26
|
prerelease: false
|
27
27
|
version_requirements: !ruby/object:Gem::Requirement
|
28
28
|
requirements:
|
29
29
|
- - "~>"
|
30
30
|
- !ruby/object:Gem::Version
|
31
|
-
version: '
|
31
|
+
version: '10.0'
|
32
32
|
- - ">="
|
33
33
|
- !ruby/object:Gem::Version
|
34
|
-
version:
|
34
|
+
version: 10.0.1
|
35
35
|
- !ruby/object:Gem::Dependency
|
36
36
|
name: rake
|
37
37
|
requirement: !ruby/object:Gem::Requirement
|
@@ -156,7 +156,7 @@ rubyforge_project:
|
|
156
156
|
rubygems_version: 2.7.6.2
|
157
157
|
signing_key:
|
158
158
|
specification_version: 4
|
159
|
-
summary: cucumber-gherkin-
|
159
|
+
summary: cucumber-gherkin-10.0.0
|
160
160
|
test_files:
|
161
161
|
- spec/gherkin/dialect_spec.rb
|
162
162
|
- spec/gherkin/stream/parser_message_stream_spec.rb
|