gherkin 2.2.4-universal-dotnet → 2.2.5-universal-dotnet
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +5 -0
- data/VERSION +1 -1
- data/build_native_gems.sh +2 -2
- data/gherkin.gemspec +0 -1
- data/lib/gherkin/json_parser.rb +1 -1
- data/lib/gherkin/lexer/i18n_lexer.rb +10 -3
- data/spec/gherkin/lexer/i18n_lexer_spec.rb +10 -0
- data/tasks/compile.rake +1 -1
- data/tasks/cucumber.rake +0 -7
- metadata +4 -14
data/History.txt
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.2.
|
1
|
+
2.2.5
|
data/build_native_gems.sh
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
rm -Rf release
|
3
3
|
mkdir release
|
4
4
|
GEM_PLATFORM=java gem build gherkin.gemspec
|
5
|
-
GEM_PLATFORM=
|
6
|
-
GEM_PLATFORM=
|
5
|
+
GEM_PLATFORM=x86-mswin32 gem build gherkin.gemspec
|
6
|
+
GEM_PLATFORM=x86-mingw32 gem build gherkin.gemspec
|
7
7
|
GEM_PLATFORM=universal-dotnet gem build gherkin.gemspec
|
8
8
|
mv *.gem release
|
data/gherkin.gemspec
CHANGED
data/lib/gherkin/json_parser.rb
CHANGED
@@ -11,7 +11,7 @@ module Gherkin
|
|
11
11
|
end
|
12
12
|
|
13
13
|
# Parse a gherkin object +o+, which can either be a JSON String,
|
14
|
-
# or a Hash (from a
|
14
|
+
# or a Hash (from a parsed JSON String).
|
15
15
|
def parse(o, feature_uri='unknown.json', line_offset=0)
|
16
16
|
o = JSON.parse(o) if String === o
|
17
17
|
@formatter.uri(feature_uri)
|
@@ -10,6 +10,7 @@ module Gherkin
|
|
10
10
|
class I18nLexer
|
11
11
|
native_impl('gherkin')
|
12
12
|
|
13
|
+
COMMENT_OR_EMPTY_LINE_PATTERN = /^\s*#|^\s*$/
|
13
14
|
LANGUAGE_PATTERN = /^\s*#\s*language\s*:\s*([a-zA-Z\-]+)/ #:nodoc:
|
14
15
|
attr_reader :i18n_language
|
15
16
|
|
@@ -30,9 +31,15 @@ module Gherkin
|
|
30
31
|
end
|
31
32
|
|
32
33
|
def lang(source)
|
33
|
-
|
34
|
-
|
35
|
-
|
34
|
+
key = 'en'
|
35
|
+
source.split(/\n/).each do |line|
|
36
|
+
break unless COMMENT_OR_EMPTY_LINE_PATTERN =~ line
|
37
|
+
if LANGUAGE_PATTERN =~ line
|
38
|
+
key = $1
|
39
|
+
break
|
40
|
+
end
|
41
|
+
end
|
42
|
+
I18n.get(key)
|
36
43
|
end
|
37
44
|
|
38
45
|
end
|
@@ -20,6 +20,16 @@ module Gherkin
|
|
20
20
|
@lexer.i18n_language.iso_code.should == "da"
|
21
21
|
end
|
22
22
|
|
23
|
+
it "should detect language when the language comment is not the first line" do
|
24
|
+
@lexer.scan("# hello\n# language: no\n")
|
25
|
+
@lexer.i18n_language.iso_code.should == "no"
|
26
|
+
end
|
27
|
+
|
28
|
+
it "should detect language when the language is on the third line, and there are empty lines above" do
|
29
|
+
@lexer.scan("# hello\n\n# language: no\n")
|
30
|
+
@lexer.i18n_language.iso_code.should == "no"
|
31
|
+
end
|
32
|
+
|
23
33
|
it "should use English i18n by default" do
|
24
34
|
@lexer.scan("Feature: foo\n")
|
25
35
|
@lexer.i18n_language.iso_code.should == "en"
|
data/tasks/compile.rake
CHANGED
data/tasks/cucumber.rake
CHANGED
@@ -1,4 +1,3 @@
|
|
1
|
-
begin
|
2
1
|
require 'cucumber/rake/task'
|
3
2
|
|
4
3
|
Cucumber::Rake::Task.new(:cucumber) do |t|
|
@@ -17,9 +16,3 @@ namespace :cucumber do
|
|
17
16
|
end
|
18
17
|
task :native_lexer => [:clean, :compile]
|
19
18
|
end
|
20
|
-
|
21
|
-
rescue LoadError
|
22
|
-
task :cucumber do
|
23
|
-
raise "Cucumber not installed"
|
24
|
-
end
|
25
|
-
end
|
metadata
CHANGED
@@ -1,13 +1,12 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gherkin
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash: 15
|
5
4
|
prerelease: false
|
6
5
|
segments:
|
7
6
|
- 2
|
8
7
|
- 2
|
9
|
-
-
|
10
|
-
version: 2.2.
|
8
|
+
- 5
|
9
|
+
version: 2.2.5
|
11
10
|
platform: universal-dotnet
|
12
11
|
authors:
|
13
12
|
- Mike Sassak
|
@@ -17,7 +16,7 @@ autorequire:
|
|
17
16
|
bindir: bin
|
18
17
|
cert_chain: []
|
19
18
|
|
20
|
-
date: 2010-
|
19
|
+
date: 2010-10-01 00:00:00 +02:00
|
21
20
|
default_executable: gherkin
|
22
21
|
dependencies:
|
23
22
|
- !ruby/object:Gem::Dependency
|
@@ -28,7 +27,6 @@ dependencies:
|
|
28
27
|
requirements:
|
29
28
|
- - ~>
|
30
29
|
- !ruby/object:Gem::Version
|
31
|
-
hash: 83
|
32
30
|
segments:
|
33
31
|
- 1
|
34
32
|
- 16
|
@@ -44,7 +42,6 @@ dependencies:
|
|
44
42
|
requirements:
|
45
43
|
- - ~>
|
46
44
|
- !ruby/object:Gem::Version
|
47
|
-
hash: 11
|
48
45
|
segments:
|
49
46
|
- 1
|
50
47
|
- 4
|
@@ -60,7 +57,6 @@ dependencies:
|
|
60
57
|
requirements:
|
61
58
|
- - ~>
|
62
59
|
- !ruby/object:Gem::Version
|
63
|
-
hash: 29
|
64
60
|
segments:
|
65
61
|
- 1
|
66
62
|
- 0
|
@@ -76,7 +72,6 @@ dependencies:
|
|
76
72
|
requirements:
|
77
73
|
- - ~>
|
78
74
|
- !ruby/object:Gem::Version
|
79
|
-
hash: 49
|
80
75
|
segments:
|
81
76
|
- 0
|
82
77
|
- 8
|
@@ -92,7 +87,6 @@ dependencies:
|
|
92
87
|
requirements:
|
93
88
|
- - ~>
|
94
89
|
- !ruby/object:Gem::Version
|
95
|
-
hash: 21
|
96
90
|
segments:
|
97
91
|
- 0
|
98
92
|
- 2
|
@@ -108,7 +102,6 @@ dependencies:
|
|
108
102
|
requirements:
|
109
103
|
- - ~>
|
110
104
|
- !ruby/object:Gem::Version
|
111
|
-
hash: 62196431
|
112
105
|
segments:
|
113
106
|
- 2
|
114
107
|
- 0
|
@@ -126,7 +119,6 @@ dependencies:
|
|
126
119
|
requirements:
|
127
120
|
- - ~>
|
128
121
|
- !ruby/object:Gem::Version
|
129
|
-
hash: 59
|
130
122
|
segments:
|
131
123
|
- 0
|
132
124
|
- 9
|
@@ -295,7 +287,6 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
295
287
|
requirements:
|
296
288
|
- - ">="
|
297
289
|
- !ruby/object:Gem::Version
|
298
|
-
hash: 3
|
299
290
|
segments:
|
300
291
|
- 0
|
301
292
|
version: "0"
|
@@ -304,7 +295,6 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
304
295
|
requirements:
|
305
296
|
- - ">="
|
306
297
|
- !ruby/object:Gem::Version
|
307
|
-
hash: 3
|
308
298
|
segments:
|
309
299
|
- 0
|
310
300
|
version: "0"
|
@@ -314,7 +304,7 @@ rubyforge_project:
|
|
314
304
|
rubygems_version: 1.3.7
|
315
305
|
signing_key:
|
316
306
|
specification_version: 3
|
317
|
-
summary: gherkin-2.2.
|
307
|
+
summary: gherkin-2.2.5
|
318
308
|
test_files:
|
319
309
|
- features/escaped_pipes.feature
|
320
310
|
- features/feature_parser.feature
|