gherkin 2.2.4-java → 2.2.5-java

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,8 @@
1
+ == 2.2.5 (2010-10-1)
2
+
3
+ === New Features
4
+ * Gherkin will scan all top comments for the language comment. (Aslak Hellesøy)
5
+
1
6
  == 2.2.4 (2010-09-22)
2
7
 
3
8
  === Bugfixes
data/VERSION CHANGED
@@ -1 +1 @@
1
- 2.2.4
1
+ 2.2.5
@@ -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=i386-mswin32 gem build gherkin.gemspec
6
- GEM_PLATFORM=i386-mingw32 gem build gherkin.gemspec
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
@@ -32,7 +32,6 @@ Gem::Specification.new do |s|
32
32
 
33
33
  if ENV['GEM_PLATFORM']
34
34
  puts "GEM_PLATFORM:#{ENV['GEM_PLATFORM']}"
35
- puts "PLATFORM:#{PLATFORM}"
36
35
  end
37
36
  s.platform = ENV['GEM_PLATFORM'] if ENV['GEM_PLATFORM']
38
37
  case s.platform.to_s
@@ -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 parser JSON String).
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
- line_one = source.split(/\n/)[0]
34
- match = LANGUAGE_PATTERN.match(line_one)
35
- I18n.get(match ? match[1] : 'en')
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"
@@ -78,7 +78,7 @@ EOF
78
78
  Rake::ExtensionTask.new("gherkin_lexer_#{i18n.underscored_iso_code}") do |ext|
79
79
  if ENV['RUBY_CC_VERSION']
80
80
  ext.cross_compile = true
81
- ext.cross_platform = 'i386-mingw32'
81
+ ext.cross_platform = 'x86-mingw32'
82
82
  end
83
83
  end
84
84
 
@@ -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
- - 4
10
- version: 2.2.4
8
+ - 5
9
+ version: 2.2.5
11
10
  platform: java
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-09-22 00:00:00 +02:00
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
@@ -291,7 +283,6 @@ required_ruby_version: !ruby/object:Gem::Requirement
291
283
  requirements:
292
284
  - - ">="
293
285
  - !ruby/object:Gem::Version
294
- hash: 3
295
286
  segments:
296
287
  - 0
297
288
  version: "0"
@@ -300,7 +291,6 @@ required_rubygems_version: !ruby/object:Gem::Requirement
300
291
  requirements:
301
292
  - - ">="
302
293
  - !ruby/object:Gem::Version
303
- hash: 3
304
294
  segments:
305
295
  - 0
306
296
  version: "0"
@@ -310,7 +300,7 @@ rubyforge_project:
310
300
  rubygems_version: 1.3.7
311
301
  signing_key:
312
302
  specification_version: 3
313
- summary: gherkin-2.2.4
303
+ summary: gherkin-2.2.5
314
304
  test_files:
315
305
  - features/escaped_pipes.feature
316
306
  - features/feature_parser.feature