gherkin 2.3.7 → 2.4.0
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.
- data/.gitignore +3 -0
- data/.yardopts +5 -0
- data/{History.txt → History.md} +153 -127
- data/{README.rdoc → README.md} +66 -64
- data/Rakefile +9 -2
- data/features/json_formatter.feature +1 -1
- data/features/json_parser.feature +1 -1
- data/gherkin.gemspec +16 -14
- data/js/lib/gherkin/lexer/.npmignore +0 -0
- data/lib/gherkin/formatter/ansi_escapes.rb +1 -1
- data/lib/gherkin/formatter/model.rb +4 -4
- data/lib/gherkin/formatter/pretty_formatter.rb +4 -4
- data/lib/gherkin/json_parser.rb +1 -1
- data/lib/gherkin/listener/formatter_listener.rb +7 -7
- data/lib/gherkin/parser/meta.txt +1 -1
- data/lib/gherkin/parser/root.txt +1 -1
- data/lib/gherkin/parser/steps.txt +1 -1
- data/lib/gherkin/rubify.rb +2 -2
- data/ragel/lexer.c.rl.erb +2 -2
- data/ragel/lexer.java.rl.erb +2 -2
- data/ragel/lexer.js.rl.erb +8 -6
- data/ragel/lexer.rb.rl.erb +2 -2
- data/ragel/lexer_common.rl.erb +4 -4
- data/spec/gherkin/c_lexer_spec.rb +1 -1
- data/spec/gherkin/fixtures/complex.json +1 -1
- data/spec/gherkin/java_lexer_spec.rb +1 -1
- data/spec/gherkin/js_lexer_spec.rb +2 -2
- data/spec/gherkin/rb_lexer_spec.rb +1 -1
- data/spec/gherkin/sexp_recorder.rb +2 -2
- data/spec/gherkin/shared/{py_string_group.rb → doc_string_group.rb} +28 -28
- data/spec/gherkin/shared/lexer_group.rb +4 -4
- data/spec/spec_helper.rb +1 -1
- data/tasks/compile.rake +3 -2
- data/tasks/cucumber.rake +1 -1
- data/tasks/gems.rake +2 -2
- data/tasks/ikvm.rake +4 -4
- data/tasks/ragel_task.rb +7 -0
- data/tasks/release.rake +10 -9
- data/tasks/yard.rake +7 -0
- data/tasks/yard/default/layout/html/bubble_32x32.png +0 -0
- data/tasks/yard/default/layout/html/bubble_48x48.png +0 -0
- data/tasks/yard/default/layout/html/footer.erb +5 -0
- data/tasks/yard/default/layout/html/index.erb +1 -0
- data/tasks/yard/default/layout/html/layout.erb +25 -0
- data/tasks/yard/default/layout/html/logo.erb +1 -0
- data/tasks/yard/default/layout/html/setup.rb +4 -0
- metadata +53 -26
- data/VERSION +0 -1
- data/lib/gherkin/version.rb +0 -3
- data/tasks/rdoc.rake +0 -9
data/lib/gherkin/rubify.rb
CHANGED
@@ -8,9 +8,9 @@ module Gherkin
|
|
8
8
|
case(o)
|
9
9
|
when Java.java.util.Collection, Array
|
10
10
|
o.map{|e| rubify(e)}
|
11
|
-
when Java.gherkin.formatter.model.
|
11
|
+
when Java.gherkin.formatter.model.DocString
|
12
12
|
require 'gherkin/formatter/model'
|
13
|
-
Formatter::Model::
|
13
|
+
Formatter::Model::DocString.new(o.value, o.line)
|
14
14
|
else
|
15
15
|
o
|
16
16
|
end
|
data/ragel/lexer.c.rl.erb
CHANGED
@@ -328,13 +328,13 @@ store_pystring_content(VALUE listener,
|
|
328
328
|
unescape_escaped_quotes = rb_reg_regcomp(rb_str_new2("\\\\\"\\\\\"\\\\\""));
|
329
329
|
rb_funcall(con, rb_intern("sub!"), 2, re2, rb_str_new2(""));
|
330
330
|
rb_funcall(con, rb_intern("gsub!"), 2, unescape_escaped_quotes, rb_str_new2("\"\"\""));
|
331
|
-
rb_funcall(listener, rb_intern("
|
331
|
+
rb_funcall(listener, rb_intern("doc_string"), 2, con, INT2FIX(current_line));
|
332
332
|
}
|
333
333
|
|
334
334
|
static void
|
335
335
|
raise_lexer_error(const char * at, int line)
|
336
336
|
{
|
337
|
-
rb_raise(rb_eGherkinLexingError, "Lexing error on line %d: '%s'. See http://wiki.github.com/
|
337
|
+
rb_raise(rb_eGherkinLexingError, "Lexing error on line %d: '%s'. See http://wiki.github.com/cucumber/gherkin/lexingerror for more information.", line, at);
|
338
338
|
}
|
339
339
|
|
340
340
|
static void lexer_init(lexer_state *lexer) {
|
data/ragel/lexer.java.rl.erb
CHANGED
@@ -32,7 +32,7 @@ public class <%= @i18n.underscored_iso_code.upcase %> implements Lexer {
|
|
32
32
|
|
33
33
|
action store_pystring_content {
|
34
34
|
String con = unindent(startCol, substring(data, contentStart, nextKeywordStart-1).replaceFirst("(\\r?\\n)?([\\t ])*\\Z", "").replaceAll("\\\\\"\\\\\"\\\\\"", "\"\"\""));
|
35
|
-
listener.
|
35
|
+
listener.docString(con, currentLine);
|
36
36
|
}
|
37
37
|
|
38
38
|
action store_feature_content {
|
@@ -131,7 +131,7 @@ public class <%= @i18n.underscored_iso_code.upcase %> implements Lexer {
|
|
131
131
|
action end_feature {
|
132
132
|
if(cs < lexer_first_final) {
|
133
133
|
String content = currentLineContent(data, lastNewline);
|
134
|
-
throw new LexingError("Lexing error on line " + lineNumber + ": '" + content + "'. See http://wiki.github.com/
|
134
|
+
throw new LexingError("Lexing error on line " + lineNumber + ": '" + content + "'. See http://wiki.github.com/cucumber/gherkin/lexingerror for more information.");
|
135
135
|
} else {
|
136
136
|
listener.eof();
|
137
137
|
}
|
data/ragel/lexer.js.rl.erb
CHANGED
@@ -23,7 +23,7 @@
|
|
23
23
|
this.start_col,
|
24
24
|
this.bytesToString(data.slice(this.content_start, this.next_keyword_start-1)).replace(/(\r?\n)?([\t ])*$/, '').replace(/ESCAPED_TRIPLE_QUOTE/mg, '"""')
|
25
25
|
);
|
26
|
-
this.listener.
|
26
|
+
this.listener.doc_string(con, this.current_line);
|
27
27
|
}
|
28
28
|
|
29
29
|
action store_feature_content {
|
@@ -106,7 +106,7 @@
|
|
106
106
|
action end_feature {
|
107
107
|
if(this.cs < lexer_first_final) {
|
108
108
|
var content = this.current_line_content(data, p);
|
109
|
-
throw "Lexing error on line " + this.line_number + ": '" + content + "'. See http://wiki.github.com/
|
109
|
+
throw "Lexing error on line " + this.line_number + ": '" + content + "'. See http://wiki.github.com/cucumber/gherkin/lexingerror for more information.";
|
110
110
|
} else {
|
111
111
|
this.listener.eof();
|
112
112
|
}
|
@@ -122,7 +122,7 @@
|
|
122
122
|
|
123
123
|
var Lexer = function(listener) {
|
124
124
|
// Check that listener has the required functions
|
125
|
-
var events = ['comment', 'tag', 'feature', 'background', 'scenario', 'scenario_outline', 'examples', 'step', '
|
125
|
+
var events = ['comment', 'tag', 'feature', 'background', 'scenario', 'scenario_outline', 'examples', 'step', 'doc_string', 'row', 'eof'];
|
126
126
|
for(e in events) {
|
127
127
|
var event = events[e];
|
128
128
|
if(typeof listener[event] != 'function') {
|
@@ -198,11 +198,13 @@ Lexer.prototype.current_line_content = function(data, p) {
|
|
198
198
|
return this.bytesToString(rest.slice(0, end)).trim();
|
199
199
|
};
|
200
200
|
|
201
|
-
|
201
|
+
// Node.js export
|
202
|
+
if(typeof exports !== 'undefined') {
|
202
203
|
exports.Lexer = Lexer;
|
203
204
|
}
|
204
|
-
|
205
|
-
|
205
|
+
// Require.js export
|
206
|
+
if (typeof define !== 'undefined' && define.amd) {
|
207
|
+
define('gherkin/lexer/<%= @i18n.underscored_iso_code %>', [], function() {return Lexer});
|
206
208
|
}
|
207
209
|
|
208
210
|
})();
|
data/ragel/lexer.rb.rl.erb
CHANGED
@@ -23,7 +23,7 @@ module Gherkin
|
|
23
23
|
|
24
24
|
action store_pystring_content {
|
25
25
|
con = unindent(@start_col, utf8_pack(data[@content_start...@next_keyword_start-1]).sub(/(\r?\n)?([\t ])*\Z/, '').gsub(/\\"\\"\\"/, '"""'))
|
26
|
-
@listener.
|
26
|
+
@listener.doc_string(con, @current_line)
|
27
27
|
}
|
28
28
|
|
29
29
|
action store_feature_content {
|
@@ -106,7 +106,7 @@ module Gherkin
|
|
106
106
|
action end_feature {
|
107
107
|
if cs < lexer_first_final
|
108
108
|
content = current_line_content(data, p)
|
109
|
-
raise Gherkin::Lexer::LexingError.new("Lexing error on line %d: '%s'. See http://wiki.github.com/
|
109
|
+
raise Gherkin::Lexer::LexingError.new("Lexing error on line %d: '%s'. See http://wiki.github.com/cucumber/gherkin/lexingerror for more information." % [@line_number, content])
|
110
110
|
else
|
111
111
|
@listener.eof
|
112
112
|
end
|
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
|
-
|
44
|
-
|
45
|
-
|
43
|
+
StartDocString = '"""' >start_pystring space* :>> EOL;
|
44
|
+
EndDocString = (space* '"""') >next_keyword_start;
|
45
|
+
DocString = space* StartDocString %begin_pystring_content (^EOL | EOL)* :>> EndDocString %store_pystring_content space* EOL+;
|
46
46
|
|
47
|
-
Tokens = BOM? (space | EOL)* (Tags | Comment | FeatureHeading | BackgroundHeading | ScenarioHeading | ScenarioOutlineHeading | ExamplesHeading | Step | Row |
|
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
|
}%%
|
@@ -13,7 +13,7 @@ module Gherkin
|
|
13
13
|
|
14
14
|
it_should_behave_like "a Gherkin lexer"
|
15
15
|
it_should_behave_like "a Gherkin lexer lexing tags"
|
16
|
-
it_should_behave_like "a Gherkin lexer lexing
|
16
|
+
it_should_behave_like "a Gherkin lexer lexing doc_strings"
|
17
17
|
it_should_behave_like "a Gherkin lexer lexing rows"
|
18
18
|
it_should_behave_like "parsing windows files"
|
19
19
|
end
|
@@ -12,7 +12,7 @@ module Gherkin
|
|
12
12
|
|
13
13
|
it_should_behave_like "a Gherkin lexer"
|
14
14
|
it_should_behave_like "a Gherkin lexer lexing tags"
|
15
|
-
it_should_behave_like "a Gherkin lexer lexing
|
15
|
+
it_should_behave_like "a Gherkin lexer lexing doc_strings"
|
16
16
|
it_should_behave_like "a Gherkin lexer lexing rows"
|
17
17
|
end
|
18
18
|
end
|
@@ -1,5 +1,5 @@
|
|
1
1
|
#encoding: utf-8
|
2
|
-
if !defined?(JRUBY_VERSION) && !(defined?(RUBY_ENGINE) && RUBY_ENGINE == "ironruby") && ENV['GHERKIN_JS']
|
2
|
+
if !defined?(JRUBY_VERSION) && !(defined?(RUBY_ENGINE) && RUBY_ENGINE == "ironruby") && ENV['GHERKIN_JS'] && !ENV['SKIP_JS_SPECS']
|
3
3
|
require 'spec_helper'
|
4
4
|
require 'gherkin/js_lexer'
|
5
5
|
|
@@ -13,7 +13,7 @@ module Gherkin
|
|
13
13
|
|
14
14
|
it_should_behave_like "a Gherkin lexer"
|
15
15
|
it_should_behave_like "a Gherkin lexer lexing tags"
|
16
|
-
it_should_behave_like "a Gherkin lexer lexing
|
16
|
+
it_should_behave_like "a Gherkin lexer lexing doc_strings"
|
17
17
|
it_should_behave_like "a Gherkin lexer lexing rows"
|
18
18
|
# TODO - make this pass!
|
19
19
|
# it_should_behave_like "parsing windows files"
|
@@ -12,7 +12,7 @@ module Gherkin
|
|
12
12
|
|
13
13
|
it_should_behave_like "a Gherkin lexer"
|
14
14
|
it_should_behave_like "a Gherkin lexer lexing tags"
|
15
|
-
it_should_behave_like "a Gherkin lexer lexing
|
15
|
+
it_should_behave_like "a Gherkin lexer lexing doc_strings"
|
16
16
|
it_should_behave_like "a Gherkin lexer lexing rows"
|
17
17
|
it_should_behave_like "parsing windows files"
|
18
18
|
end
|
@@ -10,10 +10,10 @@ module Gherkin
|
|
10
10
|
end
|
11
11
|
|
12
12
|
# We can't use method_missing - therubyracer isn't able to invoke methods like that.
|
13
|
-
[:comment, :tag, :feature, :background, :scenario, :scenario_outline, :examples, :step, :
|
13
|
+
[:comment, :tag, :feature, :background, :scenario, :scenario_outline, :examples, :step, :doc_string, :row, :eof, :uri, :syntax_error].each do |event|
|
14
14
|
define_method(event) do |*args|
|
15
15
|
event = :scenario_outline if event == :scenarioOutline # Special Java Lexer handling
|
16
|
-
event = :
|
16
|
+
event = :doc_string if event == :docString # Special Java Lexer handling
|
17
17
|
event = :syntax_error if event == :syntaxError # Special Java Lexer handling
|
18
18
|
args = rubify(args)
|
19
19
|
args = sexpify(args)
|
@@ -3,7 +3,7 @@ require 'spec_helper'
|
|
3
3
|
|
4
4
|
module Gherkin
|
5
5
|
module Lexer
|
6
|
-
shared_examples_for "a Gherkin lexer lexing
|
6
|
+
shared_examples_for "a Gherkin lexer lexing doc_strings" do
|
7
7
|
def scan(gherkin)
|
8
8
|
@lexer.scan(gherkin)
|
9
9
|
end
|
@@ -23,47 +23,47 @@ Feature: some feature
|
|
23
23
|
"""
|
24
24
|
Then bar
|
25
25
|
EOS
|
26
|
-
@listener.should_receive(:
|
26
|
+
@listener.should_receive(:doc_string).with(" Hello\nGoodbye", 4)
|
27
27
|
scan(str)
|
28
28
|
end
|
29
29
|
|
30
|
-
it "should parse a simple
|
31
|
-
@listener.should_receive(:
|
32
|
-
scan ps("I am a
|
30
|
+
it "should parse a simple doc_string" do
|
31
|
+
@listener.should_receive(:doc_string).with("I am a doc_string", 1)
|
32
|
+
scan ps("I am a doc_string")
|
33
33
|
end
|
34
34
|
|
35
|
-
it "should parse an empty
|
36
|
-
@listener.should_receive(:
|
35
|
+
it "should parse an empty doc_string" do
|
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
|
|
40
40
|
it "should treat a string containing only newlines as only newlines" do
|
41
|
-
|
41
|
+
doc_string = <<EOS
|
42
42
|
"""
|
43
43
|
|
44
44
|
|
45
45
|
|
46
46
|
"""
|
47
47
|
EOS
|
48
|
-
@listener.should_receive(:
|
49
|
-
scan(
|
48
|
+
@listener.should_receive(:doc_string).with("\n\n", 1)
|
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
|
-
[:
|
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(:
|
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(:
|
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,17 +74,17 @@ str = <<EOS
|
|
74
74
|
Line two
|
75
75
|
"""
|
76
76
|
EOS
|
77
|
-
@listener.should_receive(:
|
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(:
|
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
|
|
86
|
-
it "should handle complex
|
87
|
-
|
86
|
+
it "should handle complex doc_strings" do
|
87
|
+
doc_string = <<EOS
|
88
88
|
# Feature comment
|
89
89
|
@one
|
90
90
|
Feature: Sample
|
@@ -98,34 +98,34 @@ Feature: Sample
|
|
98
98
|
|
99
99
|
EOS
|
100
100
|
|
101
|
-
@listener.should_receive(:
|
102
|
-
scan ps(
|
101
|
+
@listener.should_receive(:doc_string).with(doc_string, 1)
|
102
|
+
scan ps(doc_string)
|
103
103
|
end
|
104
104
|
|
105
|
-
it "should allow whitespace after the closing
|
105
|
+
it "should allow whitespace after the closing doc_string delimiter" do
|
106
106
|
str = <<EOS
|
107
107
|
"""
|
108
108
|
Line one
|
109
109
|
"""
|
110
110
|
EOS
|
111
|
-
@listener.should_receive(:
|
111
|
+
@listener.should_receive(:doc_string).with(" Line one", 1)
|
112
112
|
scan(str)
|
113
113
|
end
|
114
114
|
|
115
|
-
it "should preserve the last newline(s) at the end of a
|
115
|
+
it "should preserve the last newline(s) at the end of a doc_string" do
|
116
116
|
str = <<EOS
|
117
117
|
"""
|
118
|
-
|
118
|
+
DocString text
|
119
119
|
|
120
120
|
|
121
121
|
"""
|
122
122
|
EOS
|
123
|
-
@listener.should_receive(:
|
123
|
+
@listener.should_receive(:doc_string).with("DocString text\n\n",1)
|
124
124
|
scan(str)
|
125
125
|
end
|
126
126
|
|
127
|
-
it "should preserve CRLFs within
|
128
|
-
@listener.should_receive(:
|
127
|
+
it "should preserve CRLFs within doc_strings" do
|
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(:
|
138
|
+
@listener.should_receive(:doc_string).with('"""', 1)
|
139
139
|
scan(str)
|
140
140
|
end
|
141
141
|
|
@@ -145,7 +145,7 @@ str = <<EOS
|
|
145
145
|
\\" \\"\\"
|
146
146
|
"""
|
147
147
|
EOS
|
148
|
-
@listener.should_receive(:
|
148
|
+
@listener.should_receive(:doc_string).with('\" \"\"', 1)
|
149
149
|
scan(str)
|
150
150
|
end
|
151
151
|
end
|
@@ -282,11 +282,11 @@ f'real
|
|
282
282
|
]
|
283
283
|
end
|
284
284
|
|
285
|
-
it "should parse steps with inline
|
285
|
+
it "should parse steps with inline doc_string" do
|
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
|
-
[:
|
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
|
-
[:
|
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
|
-
[:
|
543
|
+
[:doc_string, "Makes Homer something something\r\nAnd something else", 41],
|
544
544
|
[:step, "Then ", "crazy", 45],
|
545
545
|
[:eof]
|
546
546
|
]
|
data/spec/spec_helper.rb
CHANGED
@@ -11,7 +11,7 @@ require 'gherkin/java_libs'
|
|
11
11
|
require 'gherkin/shared/bom_group'
|
12
12
|
require 'gherkin/shared/lexer_group'
|
13
13
|
require 'gherkin/shared/tags_group'
|
14
|
-
require 'gherkin/shared/
|
14
|
+
require 'gherkin/shared/doc_string_group'
|
15
15
|
require 'gherkin/shared/row_group'
|
16
16
|
$:.unshift(File.dirname(__FILE__))
|
17
17
|
|
data/tasks/compile.rake
CHANGED
@@ -12,7 +12,8 @@ CLEAN.include [
|
|
12
12
|
'ext/**/*.c',
|
13
13
|
'java/src/main/java/gherkin/lexer/i18n/*.java',
|
14
14
|
'java/src/main/resources/gherkin/*.properties',
|
15
|
-
'js/lib/gherkin/lexer/*.js'
|
15
|
+
'js/lib/gherkin/lexer/*.js',
|
16
|
+
'doc'
|
16
17
|
]
|
17
18
|
|
18
19
|
desc "Compile the Java extensions"
|
@@ -72,7 +73,7 @@ langs.each do |i18n|
|
|
72
73
|
io.write(<<-EOF)
|
73
74
|
require 'mkmf'
|
74
75
|
CONFIG['warnflags'].gsub!(/-Wshorten-64-to-32/, '') if CONFIG['warnflags']
|
75
|
-
$CFLAGS << ' -O0 -Wall
|
76
|
+
$CFLAGS << ' -O0 -Wall' if CONFIG['CC'] =~ /gcc/
|
76
77
|
dir_config("gherkin_lexer_#{i18n.underscored_iso_code}")
|
77
78
|
have_library("c", "main")
|
78
79
|
create_makefile("gherkin_lexer_#{i18n.underscored_iso_code}")
|
data/tasks/cucumber.rake
CHANGED
data/tasks/gems.rake
CHANGED
@@ -8,7 +8,7 @@ namespace :gems do
|
|
8
8
|
sh "rvm 1.8.6-p399@cucumber rake cross compile RUBY_CC_VERSION=1.8.6"
|
9
9
|
sh "rvm 1.9.1-p243@cucumber rake cross compile RUBY_CC_VERSION=1.9.1"
|
10
10
|
# This will copy the .so files to the proper place
|
11
|
-
sh "rake cross compile RUBY_CC_VERSION=1.8.6:1.9.1"
|
11
|
+
sh "rake -t cross compile RUBY_CC_VERSION=1.8.6:1.9.1"
|
12
12
|
end
|
13
13
|
|
14
14
|
desc 'Prepare JRuby binares'
|
@@ -20,7 +20,7 @@ namespace :gems do
|
|
20
20
|
task :ironruby => [:jruby, 'ikvm:dll', 'ikvm:copy_ikvm_dlls']
|
21
21
|
|
22
22
|
task :sanity do
|
23
|
-
raise "The jruby gem looks too small" if File.stat("release/gherkin-#{
|
23
|
+
raise "The jruby gem looks too small" if File.stat("release/gherkin-#{GHERKIN_VERSION}-java.gem").size < 1000000
|
24
24
|
end
|
25
25
|
|
26
26
|
desc "Prepare binaries for all gems"
|
data/tasks/ikvm.rake
CHANGED
@@ -52,14 +52,14 @@ namespace :ikvm do
|
|
52
52
|
|
53
53
|
desc 'Make a .NET .exe'
|
54
54
|
task :exe => ['lib/gherkin.jar', :dependent_dlls] do
|
55
|
-
ikvmc("-target:exe lib/gherkin.jar -out:release/gherkin-#{
|
55
|
+
ikvmc("-target:exe lib/gherkin.jar -out:release/gherkin-#{GHERKIN_VERSION}.exe #{references}")
|
56
56
|
end
|
57
57
|
|
58
58
|
desc 'Make a .NET .dll'
|
59
59
|
task :dll => ['lib/gherkin.jar', :dependent_dlls] do
|
60
60
|
mkdir_p 'release' unless File.directory?('release')
|
61
|
-
ikvmc("-target:library lib/gherkin.jar -out:release/gherkin-#{
|
62
|
-
cp "release/gherkin-#{
|
61
|
+
ikvmc("-target:library lib/gherkin.jar -out:release/gherkin-#{GHERKIN_VERSION}.dll #{references}")
|
62
|
+
cp "release/gherkin-#{GHERKIN_VERSION}.dll", 'lib/gherkin.dll'
|
63
63
|
end
|
64
64
|
|
65
65
|
desc 'Copy the IKVM .dll files over to the pkg dir'
|
@@ -74,7 +74,7 @@ end
|
|
74
74
|
|
75
75
|
task :ikvm => ['ikvm:copy_ikvm_dlls', 'ikvm:exe', 'ikvm:dll'] do
|
76
76
|
puts "************** Pretty printing some features with .NET. **************"
|
77
|
-
mono "release/gherkin-#{
|
77
|
+
mono "release/gherkin-#{GHERKIN_VERSION}.exe features"
|
78
78
|
puts "************** DONE Pretty printing some features with .NET. All OK. **************"
|
79
79
|
end
|
80
80
|
|