gherkin 2.4.17-x86-mingw32 → 2.4.18-x86-mingw32
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile.lock +3 -3
- data/History.md +6 -0
- data/README.md +1 -1
- data/features/json_formatter.feature +2 -1
- data/features/step_definitions/eyeball_steps.rb +1 -1
- data/gherkin.gemspec +1 -1
- data/lib/gherkin/formatter/model.rb +5 -4
- data/lib/gherkin/formatter/pretty_formatter.rb +1 -1
- data/lib/gherkin/json_parser.rb +1 -1
- data/lib/gherkin/listener/formatter_listener.rb +2 -2
- data/lib/gherkin/rubify.rb +1 -1
- data/ragel/lexer.c.rl.erb +23 -8
- data/ragel/lexer.java.rl.erb +15 -4
- data/ragel/lexer.js.rl.erb +13 -4
- data/ragel/lexer.rb.rl.erb +12 -5
- data/ragel/lexer_common.rl.erb +4 -4
- data/spec/gherkin/fixtures/complex.json +1 -0
- data/spec/gherkin/shared/doc_string_group.rb +25 -15
- data/spec/gherkin/shared/lexer_group.rb +3 -3
- data/tasks/cucumber.rake +1 -1
- data/tasks/release.rake +1 -1
- metadata +23 -24
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
gherkin (2.4.
|
4
|
+
gherkin (2.4.18)
|
5
5
|
json (>= 1.4.6)
|
6
6
|
|
7
7
|
GEM
|
@@ -11,9 +11,9 @@ GEM
|
|
11
11
|
cucumber (1.0.2)
|
12
12
|
builder (>= 2.1.2)
|
13
13
|
diff-lcs (>= 1.1.2)
|
14
|
-
gherkin (~> 2.4.
|
14
|
+
gherkin (~> 2.4.16)
|
15
15
|
json (>= 1.4.6)
|
16
|
-
term-ansicolor (>= 1.0.
|
16
|
+
term-ansicolor (>= 1.0.6)
|
17
17
|
diff-lcs (1.1.3)
|
18
18
|
json (1.5.4)
|
19
19
|
json (1.5.4-java)
|
data/History.md
CHANGED
@@ -1,3 +1,9 @@
|
|
1
|
+
## [2.4.18](https://github.com/cucumber/gherkin/compare/v2.4.17...v2.4.18)
|
2
|
+
|
3
|
+
### New Features
|
4
|
+
|
5
|
+
* Fenced Code Blocks for DocStrings ([#123](https://github.com/cucumber/gherkin/issues/123) Gregory Hnatiuk, Aslak Hellesøy)
|
6
|
+
|
1
7
|
## [2.4.17](https://github.com/cucumber/gherkin/compare/v2.4.16...v2.4.17)
|
2
8
|
|
3
9
|
### New Features
|
data/README.md
CHANGED
@@ -52,7 +52,7 @@ The jar file is in the central Maven repo.
|
|
52
52
|
<dependency>
|
53
53
|
<groupId>info.cukes</groupId>
|
54
54
|
<artifactId>gherkin</artifactId>
|
55
|
-
<version>2.4.
|
55
|
+
<version>2.4.18</version>
|
56
56
|
</dependency>
|
57
57
|
|
58
58
|
You can get it manually from [ibiblio](http://mirrors.ibiblio.org/pub/mirrors/maven2/info/cukes/gherkin) or by searching at [maven central](http://search.maven.org/)
|
@@ -53,7 +53,7 @@ Feature: JSON formatter
|
|
53
53
|
When I was
|
54
54
|
|asleep|
|
55
55
|
And so
|
56
|
-
\"\"\"
|
56
|
+
\"\"\"plaintext
|
57
57
|
innocent
|
58
58
|
\"\"\"
|
59
59
|
|
@@ -181,6 +181,7 @@ Feature: JSON formatter
|
|
181
181
|
"line": 26,
|
182
182
|
"multiline_arg": {
|
183
183
|
"type": "doc_string",
|
184
|
+
"content_type": "plaintext",
|
184
185
|
"value": "innocent",
|
185
186
|
"line": 27
|
186
187
|
}
|
data/gherkin.gemspec
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = "gherkin"
|
5
|
-
s.version = "2.4.
|
5
|
+
s.version = "2.4.18"
|
6
6
|
s.authors = ["Mike Sassak", "Gregory Hnatiuk", "Aslak Hellesøy"]
|
7
7
|
s.description = "A fast Gherkin lexer/parser based on the Ragel State Machine Compiler."
|
8
8
|
s.summary = "#{s.name}-#{s.version}"
|
@@ -146,6 +146,7 @@ module Gherkin
|
|
146
146
|
}
|
147
147
|
elsif DocString === @multiline_arg
|
148
148
|
hash['multiline_arg']['type'] = 'doc_string'
|
149
|
+
hash['multiline_arg']['content_type'] = @multiline_arg.content_type
|
149
150
|
end
|
150
151
|
hash
|
151
152
|
end
|
@@ -182,10 +183,10 @@ module Gherkin
|
|
182
183
|
class DocString < Hashable
|
183
184
|
native_impl('gherkin')
|
184
185
|
|
185
|
-
attr_reader :value, :line
|
186
|
+
attr_reader :content_type, :value, :line
|
186
187
|
|
187
|
-
def initialize(value, line)
|
188
|
-
@value, @line = value, line
|
188
|
+
def initialize(content_type, value, line)
|
189
|
+
@content_type, @value, @line = content_type, value, line
|
189
190
|
end
|
190
191
|
|
191
192
|
def line_range
|
@@ -233,4 +234,4 @@ module Gherkin
|
|
233
234
|
end
|
234
235
|
end
|
235
236
|
end
|
236
|
-
end
|
237
|
+
end
|
@@ -181,7 +181,7 @@ module Gherkin
|
|
181
181
|
private
|
182
182
|
|
183
183
|
def doc_string(doc_string)
|
184
|
-
@io.puts " \"\"\"\n" + escape_triple_quotes(indent(doc_string.value, ' ')) + "\n \"\"\""
|
184
|
+
@io.puts " \"\"\"" + doc_string.content_type + "\n" + escape_triple_quotes(indent(doc_string.value, ' ')) + "\n \"\"\""
|
185
185
|
end
|
186
186
|
|
187
187
|
def exception(exception)
|
data/lib/gherkin/json_parser.rb
CHANGED
@@ -57,7 +57,7 @@ module Gherkin
|
|
57
57
|
if(ma['type'] == 'table')
|
58
58
|
step.multiline_arg = rows(ma['value'])
|
59
59
|
else
|
60
|
-
step.multiline_arg = Formatter::Model::DocString.new(ma['value'], ma['line'])
|
60
|
+
step.multiline_arg = Formatter::Model::DocString.new(ma['content_type'].to_s, ma['value'], ma['line'])
|
61
61
|
end
|
62
62
|
end
|
63
63
|
|
@@ -57,8 +57,8 @@ module Gherkin
|
|
57
57
|
@table << Formatter::Model::Row.new(grab_comments!, cells, line)
|
58
58
|
end
|
59
59
|
|
60
|
-
def doc_string(string, line)
|
61
|
-
@doc_string = Formatter::Model::DocString.new(string, line)
|
60
|
+
def doc_string(string, content_type, line)
|
61
|
+
@doc_string = Formatter::Model::DocString.new(string, content_type, line)
|
62
62
|
end
|
63
63
|
|
64
64
|
def eof
|
data/lib/gherkin/rubify.rb
CHANGED
@@ -10,7 +10,7 @@ module Gherkin
|
|
10
10
|
o.map{|e| rubify(e)}
|
11
11
|
when Java.gherkin.formatter.model.DocString
|
12
12
|
require 'gherkin/formatter/model'
|
13
|
-
Formatter::Model::DocString.new(o.value, o.line)
|
13
|
+
Formatter::Model::DocString.new(o.content_type, o.value, o.line)
|
14
14
|
else
|
15
15
|
o
|
16
16
|
end
|
data/ragel/lexer.c.rl.erb
CHANGED
@@ -45,6 +45,8 @@ typedef struct lexer_state {
|
|
45
45
|
size_t next_keyword_start;
|
46
46
|
size_t content_start;
|
47
47
|
size_t content_end;
|
48
|
+
size_t docstring_content_type_start;
|
49
|
+
size_t docstring_content_type_end;
|
48
50
|
size_t query_start;
|
49
51
|
size_t last_newline;
|
50
52
|
size_t final_newline;
|
@@ -84,23 +86,33 @@ static VALUE rb_eGherkinLexingError;
|
|
84
86
|
lexer->start_col = lexer->content_start - lexer->last_newline - (lexer->keyword_end - lexer->keyword_start) + 2;
|
85
87
|
}
|
86
88
|
|
87
|
-
action
|
89
|
+
action begin_docstring_content {
|
88
90
|
MARK(content_start, p);
|
89
91
|
}
|
90
92
|
|
91
|
-
action
|
93
|
+
action start_docstring {
|
92
94
|
lexer->current_line = lexer->line_number;
|
93
95
|
lexer->start_col = p - data - lexer->last_newline;
|
94
96
|
}
|
95
97
|
|
96
|
-
action
|
98
|
+
action store_docstring_content {
|
97
99
|
int len = LEN(content_start, PTR_TO(final_newline));
|
100
|
+
int type_len = LEN(docstring_content_type_start, PTR_TO(docstring_content_type_end));
|
98
101
|
|
99
102
|
if (len < 0) len = 0;
|
103
|
+
if (type_len < 0) len = 0;
|
100
104
|
|
101
|
-
|
105
|
+
store_docstring_content(listener, lexer->start_col, PTR_TO(docstring_content_type_start), type_len, PTR_TO(content_start), len, lexer->current_line);
|
102
106
|
}
|
103
107
|
|
108
|
+
action start_docstring_content_type {
|
109
|
+
MARK(docstring_content_type_start, p);
|
110
|
+
}
|
111
|
+
|
112
|
+
action end_docstring_content_type {
|
113
|
+
MARK(docstring_content_type_end, p);
|
114
|
+
}
|
115
|
+
|
104
116
|
action store_feature_content {
|
105
117
|
STORE_KW_END_CON(feature);
|
106
118
|
}
|
@@ -311,26 +323,27 @@ store_attr(VALUE listener, const char * attr_type,
|
|
311
323
|
VALUE val = ENCODED_STR_NEW(at, length);
|
312
324
|
rb_funcall(listener, rb_intern(attr_type), 2, val, INT2FIX(line));
|
313
325
|
}
|
314
|
-
|
315
326
|
static void
|
316
|
-
|
327
|
+
store_docstring_content(VALUE listener,
|
317
328
|
int start_col,
|
329
|
+
const char *type_at, size_t type_length,
|
318
330
|
const char *at, size_t length,
|
319
331
|
int current_line)
|
320
332
|
{
|
321
333
|
VALUE re2;
|
322
334
|
VALUE unescape_escaped_quotes;
|
323
335
|
VALUE con = ENCODED_STR_NEW(at, length);
|
336
|
+
VALUE con_type = ENCODED_STR_NEW(type_at, type_length);
|
324
337
|
|
325
338
|
unindent(con, start_col);
|
326
339
|
|
327
340
|
re2 = rb_reg_regcomp(rb_str_new2("\r\\Z"));
|
328
341
|
unescape_escaped_quotes = rb_reg_regcomp(rb_str_new2("\\\\\"\\\\\"\\\\\""));
|
329
342
|
rb_funcall(con, rb_intern("sub!"), 2, re2, rb_str_new2(""));
|
343
|
+
rb_funcall(con_type, rb_intern("strip!"), 0);
|
330
344
|
rb_funcall(con, rb_intern("gsub!"), 2, unescape_escaped_quotes, rb_str_new2("\"\"\""));
|
331
|
-
rb_funcall(listener, rb_intern("doc_string"),
|
345
|
+
rb_funcall(listener, rb_intern("doc_string"), 3, con_type, con, INT2FIX(current_line));
|
332
346
|
}
|
333
|
-
|
334
347
|
static void
|
335
348
|
raise_lexer_error(const char * at, int line)
|
336
349
|
{
|
@@ -341,6 +354,8 @@ static void lexer_init(lexer_state *lexer) {
|
|
341
354
|
lexer->content_start = 0;
|
342
355
|
lexer->content_end = 0;
|
343
356
|
lexer->content_len = 0;
|
357
|
+
lexer->docstring_content_type_start = 0;
|
358
|
+
lexer->docstring_content_type_end = 0;
|
344
359
|
lexer->mark = 0;
|
345
360
|
lexer->keyword_start = 0;
|
346
361
|
lexer->keyword_end = 0;
|
data/ragel/lexer.java.rl.erb
CHANGED
@@ -21,18 +21,27 @@ public class <%= @i18n.underscored_iso_code.upcase %> implements Lexer {
|
|
21
21
|
}
|
22
22
|
}
|
23
23
|
|
24
|
-
action
|
24
|
+
action start_docstring {
|
25
25
|
currentLine = lineNumber;
|
26
26
|
startCol = p - lastNewline;
|
27
27
|
}
|
28
28
|
|
29
|
-
action
|
29
|
+
action begin_docstring_content {
|
30
30
|
contentStart = p;
|
31
31
|
}
|
32
32
|
|
33
|
-
action
|
33
|
+
action start_docstring_content_type {
|
34
|
+
docstringContentTypeStart = p;
|
35
|
+
}
|
36
|
+
|
37
|
+
action end_docstring_content_type {
|
38
|
+
docstringContentTypeEnd = p;
|
39
|
+
}
|
40
|
+
|
41
|
+
action store_docstring_content {
|
34
42
|
String con = unindent(startCol, substring(data, contentStart, nextKeywordStart-1).replaceFirst("(\\r?\\n)?([\\t ])*\\Z", "").replaceAll("\\\\\"\\\\\"\\\\\"", "\"\"\""));
|
35
|
-
|
43
|
+
String conType = substring(data, docstringContentTypeStart, docstringContentTypeEnd).trim();
|
44
|
+
listener.docString(conType, con, currentLine);
|
36
45
|
}
|
37
46
|
|
38
47
|
action store_feature_content {
|
@@ -164,6 +173,8 @@ public class <%= @i18n.underscored_iso_code.upcase %> implements Lexer {
|
|
164
173
|
|
165
174
|
int contentStart = -1;
|
166
175
|
int currentLine = -1;
|
176
|
+
int docstringContentTypeStart = -1;
|
177
|
+
int docstringContentTypeEnd = -1;
|
167
178
|
int startCol = -1;
|
168
179
|
int nextKeywordStart = -1;
|
169
180
|
int keywordStart = -1;
|
data/ragel/lexer.js.rl.erb
CHANGED
@@ -9,21 +9,30 @@
|
|
9
9
|
this.start_col = p - this.last_newline - (this.keyword+':').length;
|
10
10
|
}
|
11
11
|
|
12
|
-
action
|
12
|
+
action start_docstring {
|
13
13
|
this.current_line = this.line_number;
|
14
14
|
this.start_col = p - this.last_newline;
|
15
15
|
}
|
16
16
|
|
17
|
-
action
|
17
|
+
action begin_docstring_content {
|
18
18
|
this.content_start = p;
|
19
19
|
}
|
20
20
|
|
21
|
-
action
|
21
|
+
action start_docstring_content_type {
|
22
|
+
this.docstring_content_type_start = p;
|
23
|
+
}
|
24
|
+
|
25
|
+
action end_docstring_content_type {
|
26
|
+
this.docstring_content_type_end = p;
|
27
|
+
}
|
28
|
+
|
29
|
+
action store_docstring_content {
|
22
30
|
var con = this.unindent(
|
23
31
|
this.start_col,
|
24
32
|
this.bytesToString(data.slice(this.content_start, this.next_keyword_start-1)).replace(/(\r?\n)?([\t ])*$/, '').replace(/ESCAPED_TRIPLE_QUOTE/mg, '"""')
|
25
33
|
);
|
26
|
-
this.
|
34
|
+
var con_type = this.bytesToString(data.slice(this.docstring_content_type_start, this.docstring_content_type_end)).trim();
|
35
|
+
this.listener.doc_string(con_type, con, this.current_line);
|
27
36
|
}
|
28
37
|
|
29
38
|
action store_feature_content {
|
data/ragel/lexer.rb.rl.erb
CHANGED
@@ -12,20 +12,27 @@ module Gherkin
|
|
12
12
|
@start_col = p - @last_newline - "#{@keyword}:".length
|
13
13
|
}
|
14
14
|
|
15
|
-
action
|
15
|
+
action start_docstring {
|
16
16
|
@current_line = @line_number
|
17
17
|
@start_col = p - @last_newline
|
18
18
|
}
|
19
19
|
|
20
|
-
action
|
20
|
+
action begin_docstring_content {
|
21
21
|
@content_start = p
|
22
22
|
}
|
23
23
|
|
24
|
-
action
|
24
|
+
action start_docstring_content_type {
|
25
|
+
@docstring_content_type_start = p
|
26
|
+
}
|
27
|
+
action end_docstring_content_type {
|
28
|
+
@docstring_content_type_end = p
|
29
|
+
}
|
30
|
+
|
31
|
+
action store_docstring_content {
|
25
32
|
con = unindent(@start_col, utf8_pack(data[@content_start...@next_keyword_start-1]).sub(/(\r?\n)?([\t ])*\Z/, '').gsub(/\\"\\"\\"/, '"""'))
|
26
|
-
|
33
|
+
con_type = utf8_pack(data[@docstring_content_type_start...@docstring_content_type_end]).strip
|
34
|
+
@listener.doc_string(con_type, con, @current_line)
|
27
35
|
}
|
28
|
-
|
29
36
|
action store_feature_content {
|
30
37
|
p = store_keyword_content(:feature, data, p, eof)
|
31
38
|
}
|
data/ragel/lexer_common.rl.erb
CHANGED
@@ -40,11 +40,11 @@
|
|
40
40
|
RowBody = space* Cell** PIPE :>> (space* EOL+ space*) %store_row;
|
41
41
|
Row = StartRow :>> RowBody <: EndRow?;
|
42
42
|
|
43
|
-
StartDocString = '"""' >
|
44
|
-
EndDocString = (space* '"""') >next_keyword_start;
|
45
|
-
DocString = space* StartDocString %
|
43
|
+
StartDocString = '"""' >start_docstring ^EOL* >start_docstring_content_type %end_docstring_content_type :>> EOL;
|
44
|
+
EndDocString = (space* '"""') >next_keyword_start;
|
45
|
+
DocString = space* StartDocString %begin_docstring_content (^EOL | EOL)* :>> EndDocString %store_docstring_content space* EOL+;
|
46
46
|
|
47
|
-
Tokens = BOM? (space | EOL)* (Tags | Comment | FeatureHeading | BackgroundHeading | ScenarioHeading | ScenarioOutlineHeading | ExamplesHeading | Step | Row | DocString)* (space | EOL)* EOF;
|
47
|
+
Tokens = BOM? (space | EOL)* (Tags | Comment | FeatureHeading | BackgroundHeading | ScenarioHeading | ScenarioOutlineHeading | ExamplesHeading | Step | Row | DocString )* (space | EOL)* EOF;
|
48
48
|
|
49
49
|
main := Tokens %end_feature @!end_feature;
|
50
50
|
}%%
|
@@ -23,17 +23,17 @@ Feature: some feature
|
|
23
23
|
"""
|
24
24
|
Then bar
|
25
25
|
EOS
|
26
|
-
@listener.should_receive(:doc_string).with(" Hello\nGoodbye", 4)
|
26
|
+
@listener.should_receive(:doc_string).with('', " Hello\nGoodbye", 4)
|
27
27
|
scan(str)
|
28
28
|
end
|
29
29
|
|
30
30
|
it "should parse a simple doc_string" do
|
31
|
-
@listener.should_receive(:doc_string).with("I am a doc_string", 1)
|
31
|
+
@listener.should_receive(:doc_string).with('', "I am a doc_string", 1)
|
32
32
|
scan ps("I am a doc_string")
|
33
33
|
end
|
34
34
|
|
35
35
|
it "should parse an empty doc_string" do
|
36
|
-
@listener.should_receive(:doc_string).with(
|
36
|
+
@listener.should_receive(:doc_string).with('', '', 4)
|
37
37
|
scan("Feature: Hi\nScenario: Hi\nGiven a step\n\"\"\"\n\"\"\"")
|
38
38
|
end
|
39
39
|
|
@@ -45,25 +45,25 @@ doc_string = <<EOS
|
|
45
45
|
|
46
46
|
"""
|
47
47
|
EOS
|
48
|
-
@listener.should_receive(:doc_string).with("\n\n", 1)
|
48
|
+
@listener.should_receive(:doc_string).with('', "\n\n", 1)
|
49
49
|
scan(doc_string)
|
50
50
|
end
|
51
51
|
|
52
52
|
it "should parse content separated by two newlines" do
|
53
53
|
scan ps("A\n\nB")
|
54
54
|
@listener.to_sexp.should == [
|
55
|
-
[:doc_string, "A\n\nB", 1],
|
55
|
+
[:doc_string, '', "A\n\nB", 1],
|
56
56
|
[:eof]
|
57
57
|
]
|
58
58
|
end
|
59
59
|
|
60
60
|
it "should parse a multiline string" do
|
61
|
-
@listener.should_receive(:doc_string).with("A\nB\nC\nD", 1)
|
61
|
+
@listener.should_receive(:doc_string).with('', "A\nB\nC\nD", 1)
|
62
62
|
scan ps("A\nB\nC\nD")
|
63
63
|
end
|
64
64
|
|
65
65
|
it "should ignore unescaped quotes inside the string delimeters" do
|
66
|
-
@listener.should_receive(:doc_string).with("What does \"this\" mean?", 1)
|
66
|
+
@listener.should_receive(:doc_string).with('', "What does \"this\" mean?", 1)
|
67
67
|
scan ps('What does "this" mean?')
|
68
68
|
end
|
69
69
|
|
@@ -74,12 +74,12 @@ str = <<EOS
|
|
74
74
|
Line two
|
75
75
|
"""
|
76
76
|
EOS
|
77
|
-
@listener.should_receive(:doc_string).with(" Line one\nLine two", 1)
|
77
|
+
@listener.should_receive(:doc_string).with('', " Line one\nLine two", 1)
|
78
78
|
scan(str)
|
79
79
|
end
|
80
80
|
|
81
81
|
it "should preserve tabs within the content" do
|
82
|
-
@listener.should_receive(:doc_string).with("I have\tsome tabs\nInside\t\tthe content", 1)
|
82
|
+
@listener.should_receive(:doc_string).with('', "I have\tsome tabs\nInside\t\tthe content", 1)
|
83
83
|
scan ps("I have\tsome tabs\nInside\t\tthe content")
|
84
84
|
end
|
85
85
|
|
@@ -98,7 +98,7 @@ Feature: Sample
|
|
98
98
|
|
99
99
|
EOS
|
100
100
|
|
101
|
-
@listener.should_receive(:doc_string).with(doc_string, 1)
|
101
|
+
@listener.should_receive(:doc_string).with('', doc_string, 1)
|
102
102
|
scan ps(doc_string)
|
103
103
|
end
|
104
104
|
|
@@ -108,7 +108,7 @@ str = <<EOS
|
|
108
108
|
Line one
|
109
109
|
"""
|
110
110
|
EOS
|
111
|
-
@listener.should_receive(:doc_string).with(" Line one", 1)
|
111
|
+
@listener.should_receive(:doc_string).with('', " Line one", 1)
|
112
112
|
scan(str)
|
113
113
|
end
|
114
114
|
|
@@ -120,12 +120,12 @@ str = <<EOS
|
|
120
120
|
|
121
121
|
"""
|
122
122
|
EOS
|
123
|
-
@listener.should_receive(:doc_string).with("DocString text\n\n",1)
|
123
|
+
@listener.should_receive(:doc_string).with('', "DocString text\n\n", 1)
|
124
124
|
scan(str)
|
125
125
|
end
|
126
126
|
|
127
127
|
it "should preserve CRLFs within doc_strings" do
|
128
|
-
@listener.should_receive(:doc_string).with("Line one\r\nLine two\r\n", 1)
|
128
|
+
@listener.should_receive(:doc_string).with('', "Line one\r\nLine two\r\n", 1)
|
129
129
|
scan("\"\"\"\r\nLine one\r\nLine two\r\n\r\n\"\"\"")
|
130
130
|
end
|
131
131
|
|
@@ -135,7 +135,7 @@ str = <<EOS
|
|
135
135
|
\\"\\"\\"
|
136
136
|
"""
|
137
137
|
EOS
|
138
|
-
@listener.should_receive(:doc_string).with('"""', 1)
|
138
|
+
@listener.should_receive(:doc_string).with('', '"""', 1)
|
139
139
|
scan(str)
|
140
140
|
end
|
141
141
|
|
@@ -145,7 +145,17 @@ str = <<EOS
|
|
145
145
|
\\" \\"\\"
|
146
146
|
"""
|
147
147
|
EOS
|
148
|
-
@listener.should_receive(:doc_string).with('\" \"\"', 1)
|
148
|
+
@listener.should_receive(:doc_string).with('', '\" \"\"', 1)
|
149
|
+
scan(str)
|
150
|
+
end
|
151
|
+
|
152
|
+
it "should lex doc_string content_types" do
|
153
|
+
str = <<EOS
|
154
|
+
"""gherkin type
|
155
|
+
Feature: Doc String Types
|
156
|
+
"""
|
157
|
+
EOS
|
158
|
+
@listener.should_receive(:doc_string).with('gherkin type', 'Feature: Doc String Types', 1)
|
149
159
|
scan(str)
|
150
160
|
end
|
151
161
|
end
|
@@ -286,7 +286,7 @@ f'real
|
|
286
286
|
scan("Given I have a string\n\"\"\"\nhello\nworld\n\"\"\"")
|
287
287
|
@listener.to_sexp.should == [
|
288
288
|
[:step, "Given ", "I have a string", 1],
|
289
|
-
[:doc_string, "hello\nworld", 2],
|
289
|
+
[:doc_string, '', "hello\nworld", 2],
|
290
290
|
[:eof]
|
291
291
|
]
|
292
292
|
end
|
@@ -497,7 +497,7 @@ f'real
|
|
497
497
|
[:step, "Then ", "I am happy", 37],
|
498
498
|
[:scenario, "Scenario", "Hammerzeit", "", 39],
|
499
499
|
[:step, "Given ", "All work and no play", 40],
|
500
|
-
[:doc_string, "Makes Homer something something\nAnd something else", 41 ],
|
500
|
+
[:doc_string, '', "Makes Homer something something\nAnd something else", 41 ],
|
501
501
|
[:step, "Then ", "crazy", 45],
|
502
502
|
[:eof]
|
503
503
|
]
|
@@ -540,7 +540,7 @@ f'real
|
|
540
540
|
[:step, "Then ", "I am happy", 37],
|
541
541
|
[:scenario, "Scenario", "Hammerzeit", "", 39],
|
542
542
|
[:step, "Given ", "All work and no play", 40],
|
543
|
-
[:doc_string, "Makes Homer something something\r\nAnd something else", 41],
|
543
|
+
[:doc_string, '', "Makes Homer something something\r\nAnd something else", 41],
|
544
544
|
[:step, "Then ", "crazy", 45],
|
545
545
|
[:eof]
|
546
546
|
]
|
data/tasks/cucumber.rake
CHANGED
data/tasks/release.rake
CHANGED
@@ -45,6 +45,6 @@ namespace :release do
|
|
45
45
|
|
46
46
|
task :symlink_docs do
|
47
47
|
sh("ssh cukes.info 'cd /var/www/gherkin/api/ruby && mkdir #{GHERKIN_VERSION} && tar xzf api-#{GHERKIN_VERSION}.tgz -C #{GHERKIN_VERSION} && rm -f latest && ln -s #{GHERKIN_VERSION} latest'")
|
48
|
-
sh("ssh cukes.info 'cd /var/www/gherkin/api/
|
48
|
+
sh("ssh cukes.info 'cd /var/www/gherkin/api/java && rm -f latest && ln -s #{GHERKIN_VERSION} latest'")
|
49
49
|
end
|
50
50
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gherkin
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.4.
|
4
|
+
version: 2.4.18
|
5
5
|
prerelease:
|
6
6
|
platform: x86-mingw32
|
7
7
|
authors:
|
@@ -11,11 +11,11 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date: 2011-09-
|
14
|
+
date: 2011-09-05 00:00:00.000000000Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: json
|
18
|
-
requirement: &
|
18
|
+
requirement: &2152330360 !ruby/object:Gem::Requirement
|
19
19
|
none: false
|
20
20
|
requirements:
|
21
21
|
- - ! '>='
|
@@ -23,10 +23,10 @@ dependencies:
|
|
23
23
|
version: 1.4.6
|
24
24
|
type: :runtime
|
25
25
|
prerelease: false
|
26
|
-
version_requirements: *
|
26
|
+
version_requirements: *2152330360
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: cucumber
|
29
|
-
requirement: &
|
29
|
+
requirement: &2152329880 !ruby/object:Gem::Requirement
|
30
30
|
none: false
|
31
31
|
requirements:
|
32
32
|
- - ! '>='
|
@@ -34,10 +34,10 @@ dependencies:
|
|
34
34
|
version: 1.0.2
|
35
35
|
type: :development
|
36
36
|
prerelease: false
|
37
|
-
version_requirements: *
|
37
|
+
version_requirements: *2152329880
|
38
38
|
- !ruby/object:Gem::Dependency
|
39
39
|
name: rake
|
40
|
-
requirement: &
|
40
|
+
requirement: &2152329420 !ruby/object:Gem::Requirement
|
41
41
|
none: false
|
42
42
|
requirements:
|
43
43
|
- - ! '>='
|
@@ -45,10 +45,10 @@ dependencies:
|
|
45
45
|
version: 0.9.2
|
46
46
|
type: :development
|
47
47
|
prerelease: false
|
48
|
-
version_requirements: *
|
48
|
+
version_requirements: *2152329420
|
49
49
|
- !ruby/object:Gem::Dependency
|
50
50
|
name: bundler
|
51
|
-
requirement: &
|
51
|
+
requirement: &2165576940 !ruby/object:Gem::Requirement
|
52
52
|
none: false
|
53
53
|
requirements:
|
54
54
|
- - ! '>='
|
@@ -56,10 +56,10 @@ dependencies:
|
|
56
56
|
version: 1.0.18
|
57
57
|
type: :development
|
58
58
|
prerelease: false
|
59
|
-
version_requirements: *
|
59
|
+
version_requirements: *2165576940
|
60
60
|
- !ruby/object:Gem::Dependency
|
61
61
|
name: rspec
|
62
|
-
requirement: &
|
62
|
+
requirement: &2165576480 !ruby/object:Gem::Requirement
|
63
63
|
none: false
|
64
64
|
requirements:
|
65
65
|
- - ! '>='
|
@@ -67,10 +67,10 @@ dependencies:
|
|
67
67
|
version: 2.6.0
|
68
68
|
type: :development
|
69
69
|
prerelease: false
|
70
|
-
version_requirements: *
|
70
|
+
version_requirements: *2165576480
|
71
71
|
- !ruby/object:Gem::Dependency
|
72
72
|
name: therubyracer
|
73
|
-
requirement: &
|
73
|
+
requirement: &2165575940 !ruby/object:Gem::Requirement
|
74
74
|
none: false
|
75
75
|
requirements:
|
76
76
|
- - ! '>='
|
@@ -78,10 +78,10 @@ dependencies:
|
|
78
78
|
version: 0.9.4
|
79
79
|
type: :development
|
80
80
|
prerelease: false
|
81
|
-
version_requirements: *
|
81
|
+
version_requirements: *2165575940
|
82
82
|
- !ruby/object:Gem::Dependency
|
83
83
|
name: yard
|
84
|
-
requirement: &
|
84
|
+
requirement: &2165575480 !ruby/object:Gem::Requirement
|
85
85
|
none: false
|
86
86
|
requirements:
|
87
87
|
- - ! '>='
|
@@ -89,10 +89,10 @@ dependencies:
|
|
89
89
|
version: 0.7.2
|
90
90
|
type: :development
|
91
91
|
prerelease: false
|
92
|
-
version_requirements: *
|
92
|
+
version_requirements: *2165575480
|
93
93
|
- !ruby/object:Gem::Dependency
|
94
94
|
name: rdiscount
|
95
|
-
requirement: &
|
95
|
+
requirement: &2165575020 !ruby/object:Gem::Requirement
|
96
96
|
none: false
|
97
97
|
requirements:
|
98
98
|
- - ! '>='
|
@@ -100,10 +100,10 @@ dependencies:
|
|
100
100
|
version: 1.6.8
|
101
101
|
type: :development
|
102
102
|
prerelease: false
|
103
|
-
version_requirements: *
|
103
|
+
version_requirements: *2165575020
|
104
104
|
- !ruby/object:Gem::Dependency
|
105
105
|
name: term-ansicolor
|
106
|
-
requirement: &
|
106
|
+
requirement: &2165574560 !ruby/object:Gem::Requirement
|
107
107
|
none: false
|
108
108
|
requirements:
|
109
109
|
- - ! '>='
|
@@ -111,10 +111,10 @@ dependencies:
|
|
111
111
|
version: 1.0.6
|
112
112
|
type: :development
|
113
113
|
prerelease: false
|
114
|
-
version_requirements: *
|
114
|
+
version_requirements: *2165574560
|
115
115
|
- !ruby/object:Gem::Dependency
|
116
116
|
name: builder
|
117
|
-
requirement: &
|
117
|
+
requirement: &2165574100 !ruby/object:Gem::Requirement
|
118
118
|
none: false
|
119
119
|
requirements:
|
120
120
|
- - ! '>='
|
@@ -122,7 +122,7 @@ dependencies:
|
|
122
122
|
version: 2.1.2
|
123
123
|
type: :development
|
124
124
|
prerelease: false
|
125
|
-
version_requirements: *
|
125
|
+
version_requirements: *2165574100
|
126
126
|
description: A fast Gherkin lexer/parser based on the Ragel State Machine Compiler.
|
127
127
|
email: cukes@googlegroups.com
|
128
128
|
executables: []
|
@@ -162,7 +162,6 @@ files:
|
|
162
162
|
- gherkin.gemspec
|
163
163
|
- ikvm/.gitignore
|
164
164
|
- java/.gitignore
|
165
|
-
- java/Gherkin.iml
|
166
165
|
- java/src/main/java/gherkin/lexer/i18n/.gitignore
|
167
166
|
- java/src/main/resources/gherkin/.gitignore
|
168
167
|
- js/.gitignore
|
@@ -386,7 +385,7 @@ rubyforge_project:
|
|
386
385
|
rubygems_version: 1.8.6
|
387
386
|
signing_key:
|
388
387
|
specification_version: 3
|
389
|
-
summary: gherkin-2.4.
|
388
|
+
summary: gherkin-2.4.18
|
390
389
|
test_files:
|
391
390
|
- features/escaped_pipes.feature
|
392
391
|
- features/feature_parser.feature
|