gherkin 2.11.5-java → 2.11.6-java

Sign up to get free protection for your applications and to get access to all the features.
@@ -5,14 +5,21 @@ module Gherkin
5
5
  # This is especially important to convert java.util.List coming
6
6
  # from Java and back to a Ruby Array.
7
7
  def rubify(o)
8
- case(o)
9
- when Java.java.util.Collection, Array
10
- o.map{|e| rubify(e)}
11
- when Java.gherkin.formatter.model.DocString
12
- require 'gherkin/formatter/model'
13
- Formatter::Model::DocString.new(o.content_type, o.value, o.line)
14
- else
15
- o
8
+ case (o)
9
+ when Java.java.util.Collection, Array
10
+ rubified_array = o.map{ |e| rubify(e) }
11
+ if o.respond_to?(:line)
12
+ class << rubified_array
13
+ attr_accessor :line
14
+ end
15
+ rubified_array.line = o.line
16
+ end
17
+ rubified_array
18
+ when Java.gherkin.formatter.model.DocString
19
+ require 'gherkin/formatter/model'
20
+ Formatter::Model::DocString.new(o.content_type, o.value, o.line)
21
+ else
22
+ o
16
23
  end
17
24
  end
18
25
  else
@@ -132,8 +132,8 @@
132
132
  var Lexer = function(listener) {
133
133
  // Check that listener has the required functions
134
134
  var events = ['comment', 'tag', 'feature', 'background', 'scenario', 'scenario_outline', 'examples', 'step', 'doc_string', 'row', 'eof'];
135
- for(e in events) {
136
- var event = events[e];
135
+ for(var i=0, len=events.length; i<len; i++) {
136
+ var event = events[i];
137
137
  if(typeof listener[event] != 'function') {
138
138
  throw "Error. No " + event + " function exists on " + JSON.stringify(listener);
139
139
  }
@@ -0,0 +1,4 @@
1
+ # language: nl
2
+ Functionaliteit: Feature Text
3
+ Scenario: Reading a Scenario
4
+ Gegeven there is a step
@@ -53,7 +53,7 @@ module Gherkin
53
53
  [:step, "当", "我按相加按钮", 7],
54
54
  [:step, "那么", "我应该在屏幕上看到的结果是13", 8],
55
55
  [:eof]
56
- ]
56
+ ]
57
57
  end
58
58
 
59
59
  it "should parse languages with spaces after some keywords but not others" do
@@ -162,7 +162,7 @@ module Gherkin
162
162
  end
163
163
 
164
164
  it "should report keyword regexp" do
165
- Gherkin::I18n.keyword_regexp(:step).should =~ /\|Quando \|Quand \|Quan \|Pryd \|Pokud \|/
165
+ Gherkin::I18n.keyword_regexp(:step).should =~ /\|Quando \|Quand \|Quan \|Pryd \|/
166
166
  end
167
167
 
168
168
  it "should print available languages" do
@@ -188,6 +188,7 @@ module Gherkin
188
188
  | fi | Finnish | suomi |
189
189
  | fr | French | français |
190
190
  | he | Hebrew | עברית |
191
+ | hi | Hindi | हिंदी |
191
192
  | hr | Croatian | hrvatski |
192
193
  | hu | Hungarian | magyar |
193
194
  | id | Indonesian | Bahasa Indonesia |
@@ -208,7 +209,9 @@ module Gherkin
208
209
  | sr-Cyrl | Serbian | Српски |
209
210
  | sr-Latn | Serbian (Latin) | Srpski (Latinica) |
210
211
  | sv | Swedish | Svenska |
212
+ | tl | Telugu | తెలుగు |
211
213
  | tr | Turkish | Türkçe |
214
+ | tt | Tatar | Татарча |
212
215
  | uk | Ukrainian | Українська |
213
216
  | uz | Uzbek | Узбекча |
214
217
  | vi | Vietnamese | Tiếng Việt |
@@ -0,0 +1,23 @@
1
+ #encoding: utf-8
2
+ if defined?(JRUBY_VERSION)
3
+ require 'spec_helper'
4
+ include Gherkin::Rubify
5
+
6
+ module Gherkin
7
+ module Rubify
8
+ describe "rubify" do
9
+ before do
10
+ @java_collection = [mock("Java.java.util.ArrayList")]
11
+ @java_collection.stub(:===).and_return(Java.java.util.Collection)
12
+ @java_collection.stub(:line).and_return(15)
13
+ @rubified_array = rubify(@java_collection)
14
+ end
15
+
16
+ it "should keep the line number attribute from Java object" do
17
+ @rubified_array.should respond_to(:line)
18
+ @rubified_array.line.should == 15
19
+ end
20
+ end
21
+ end
22
+ end
23
+ end
@@ -15,6 +15,20 @@ module Gherkin
15
15
  ]
16
16
  end
17
17
 
18
+ describe "and language specification" do
19
+ it "should work just fine" do
20
+ @lexer = Gherkin::Lexer::I18nLexer.new(@listener)
21
+ scan_file("with_bom_and_language_spec.feature")
22
+ @listener.to_sexp.should == [
23
+ [:comment, "# language: nl", 1],
24
+ [:feature, "Functionaliteit", "Feature Text", "", 2],
25
+ [:scenario, "Scenario", "Reading a Scenario", "", 3],
26
+ [:step, "Gegeven ", "there is a step", 4],
27
+ [:eof]
28
+ ]
29
+ end
30
+ end
31
+
18
32
  describe "with ISO-8859-1 encoding" do
19
33
  it "should work just fine" do
20
34
  @lexer = Gherkin::Lexer::I18nLexer.new(@listener)
@@ -4,6 +4,7 @@ require 'cucumber/rake/task'
4
4
 
5
5
  Cucumber::Rake::Task.new(:cucumber) do |t|
6
6
  profile = ENV['TRAVIS'] ? 'travis' : 'default'
7
+ profile = 'javascript' if ENV['GHERKIN_JS_NATIVE']
7
8
  t.cucumber_opts = "--profile #{profile}"
8
9
  end
9
10
 
@@ -1,11 +1,11 @@
1
1
  namespace :gems do
2
2
  task :win do
3
3
  unless File.directory?(File.expand_path('~/.rake-compiler'))
4
- STDERR.puts "[ERROR] You must install MinGW rubies to build gherkin gems for Windows. See README.rdoc"
4
+ STDERR.puts "[ERROR] You must install MinGW rubies to build gherkin gems for Windows. See README.md"
5
5
  exit(1)
6
6
  end
7
7
  # rvm and mingw ruby versions have to match to avoid errors
8
- sh "rvm 1.8.7-p352@cucumber do rake cross compile RUBY_CC_VERSION=1.8.7"
8
+ sh "rvm 1.8.7-p371@cucumber do rake cross compile RUBY_CC_VERSION=1.8.7"
9
9
  sh "bundle exec rake cross compile RUBY_CC_VERSION=1.9.3"
10
10
  # This will copy the .so files to the proper place
11
11
  sh "bundle exec rake -t cross compile RUBY_CC_VERSION=1.8.7:1.9.3"
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.11.5
4
+ version: 2.11.6
5
5
  prerelease:
6
6
  platform: java
7
7
  authors:
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2012-10-14 00:00:00.000000000 Z
14
+ date: 2013-01-29 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: json
@@ -20,7 +20,7 @@ dependencies:
20
20
  requirements:
21
21
  - - ! '>='
22
22
  - !ruby/object:Gem::Version
23
- version: 1.4.6
23
+ version: 1.7.6
24
24
  type: :runtime
25
25
  prerelease: false
26
26
  version_requirements: !ruby/object:Gem::Requirement
@@ -28,7 +28,7 @@ dependencies:
28
28
  requirements:
29
29
  - - ! '>='
30
30
  - !ruby/object:Gem::Version
31
- version: 1.4.6
31
+ version: 1.7.6
32
32
  - !ruby/object:Gem::Dependency
33
33
  name: cucumber
34
34
  requirement: !ruby/object:Gem::Requirement
@@ -52,7 +52,7 @@ dependencies:
52
52
  requirements:
53
53
  - - ! '>='
54
54
  - !ruby/object:Gem::Version
55
- version: 0.9.2
55
+ version: 10.0.3
56
56
  type: :development
57
57
  prerelease: false
58
58
  version_requirements: !ruby/object:Gem::Requirement
@@ -60,7 +60,7 @@ dependencies:
60
60
  requirements:
61
61
  - - ! '>='
62
62
  - !ruby/object:Gem::Version
63
- version: 0.9.2
63
+ version: 10.0.3
64
64
  - !ruby/object:Gem::Dependency
65
65
  name: bundler
66
66
  requirement: !ruby/object:Gem::Requirement
@@ -68,7 +68,7 @@ dependencies:
68
68
  requirements:
69
69
  - - ! '>='
70
70
  - !ruby/object:Gem::Version
71
- version: 1.2.1
71
+ version: 1.2.3
72
72
  type: :development
73
73
  prerelease: false
74
74
  version_requirements: !ruby/object:Gem::Requirement
@@ -76,7 +76,7 @@ dependencies:
76
76
  requirements:
77
77
  - - ! '>='
78
78
  - !ruby/object:Gem::Version
79
- version: 1.2.1
79
+ version: 1.2.3
80
80
  - !ruby/object:Gem::Dependency
81
81
  name: rspec
82
82
  requirement: !ruby/object:Gem::Requirement
@@ -84,7 +84,7 @@ dependencies:
84
84
  requirements:
85
85
  - - ~>
86
86
  - !ruby/object:Gem::Version
87
- version: 2.11.0
87
+ version: 2.12.0
88
88
  type: :development
89
89
  prerelease: false
90
90
  version_requirements: !ruby/object:Gem::Requirement
@@ -92,7 +92,7 @@ dependencies:
92
92
  requirements:
93
93
  - - ~>
94
94
  - !ruby/object:Gem::Version
95
- version: 2.11.0
95
+ version: 2.12.0
96
96
  - !ruby/object:Gem::Dependency
97
97
  name: rubyzip
98
98
  requirement: !ruby/object:Gem::Requirement
@@ -116,7 +116,7 @@ dependencies:
116
116
  requirements:
117
117
  - - ! '>='
118
118
  - !ruby/object:Gem::Version
119
- version: 0.10.2
119
+ version: 0.11.2
120
120
  type: :development
121
121
  prerelease: false
122
122
  version_requirements: !ruby/object:Gem::Requirement
@@ -124,7 +124,7 @@ dependencies:
124
124
  requirements:
125
125
  - - ! '>='
126
126
  - !ruby/object:Gem::Version
127
- version: 0.10.2
127
+ version: 0.11.2
128
128
  - !ruby/object:Gem::Dependency
129
129
  name: yard
130
130
  requirement: !ruby/object:Gem::Requirement
@@ -132,7 +132,7 @@ dependencies:
132
132
  requirements:
133
133
  - - ! '>='
134
134
  - !ruby/object:Gem::Version
135
- version: 0.8.2.1
135
+ version: 0.8.3
136
136
  type: :development
137
137
  prerelease: false
138
138
  version_requirements: !ruby/object:Gem::Requirement
@@ -140,7 +140,7 @@ dependencies:
140
140
  requirements:
141
141
  - - ! '>='
142
142
  - !ruby/object:Gem::Version
143
- version: 0.8.2.1
143
+ version: 0.8.3
144
144
  - !ruby/object:Gem::Dependency
145
145
  name: rdiscount
146
146
  requirement: !ruby/object:Gem::Requirement
@@ -180,7 +180,7 @@ dependencies:
180
180
  requirements:
181
181
  - - ! '>='
182
182
  - !ruby/object:Gem::Version
183
- version: 3.1.3
183
+ version: 3.1.4
184
184
  type: :development
185
185
  prerelease: false
186
186
  version_requirements: !ruby/object:Gem::Requirement
@@ -188,7 +188,7 @@ dependencies:
188
188
  requirements:
189
189
  - - ! '>='
190
190
  - !ruby/object:Gem::Version
191
- version: 3.1.3
191
+ version: 3.1.4
192
192
  description: A fast Gherkin lexer/parser based on the Ragel State Machine Compiler.
193
193
  email: cukes@googlegroups.com
194
194
  executables: []
@@ -250,6 +250,8 @@ files:
250
250
  - lib/gherkin/json_parser.rb
251
251
  - lib/gherkin/lexer/encoding.rb
252
252
  - lib/gherkin/lexer/i18n_lexer.rb
253
+ - lib/gherkin/lexer/tl.rb
254
+ - lib/gherkin/lexer/tt.rb
253
255
  - lib/gherkin/listener/event.rb
254
256
  - lib/gherkin/listener/formatter_listener.rb
255
257
  - lib/gherkin/native.rb
@@ -292,6 +294,7 @@ files:
292
294
  - spec/gherkin/fixtures/simple_with_comments.feature
293
295
  - spec/gherkin/fixtures/simple_with_tags.feature
294
296
  - spec/gherkin/fixtures/with_bom.feature
297
+ - spec/gherkin/fixtures/with_bom_and_language_spec.feature
295
298
  - spec/gherkin/formatter/ansi_escapes_spec.rb
296
299
  - spec/gherkin/formatter/filter_formatter_spec.rb
297
300
  - spec/gherkin/formatter/json_formatter_spec.rb
@@ -308,6 +311,7 @@ files:
308
311
  - spec/gherkin/native_lexer_spec.rb
309
312
  - spec/gherkin/output_stream_string_io.rb
310
313
  - spec/gherkin/parser/parser_spec.rb
314
+ - spec/gherkin/rubify_spec.rb
311
315
  - spec/gherkin/sexp_recorder.rb
312
316
  - spec/gherkin/shared/doc_string_group.rb
313
317
  - spec/gherkin/shared/encoding_group.rb
@@ -359,7 +363,7 @@ rubyforge_project:
359
363
  rubygems_version: 1.8.24
360
364
  signing_key:
361
365
  specification_version: 3
362
- summary: gherkin-2.11.5
366
+ summary: gherkin-2.11.6
363
367
  test_files:
364
368
  - features/escaped_pipes.feature
365
369
  - features/feature_parser.feature
@@ -400,6 +404,7 @@ test_files:
400
404
  - spec/gherkin/fixtures/simple_with_comments.feature
401
405
  - spec/gherkin/fixtures/simple_with_tags.feature
402
406
  - spec/gherkin/fixtures/with_bom.feature
407
+ - spec/gherkin/fixtures/with_bom_and_language_spec.feature
403
408
  - spec/gherkin/formatter/ansi_escapes_spec.rb
404
409
  - spec/gherkin/formatter/filter_formatter_spec.rb
405
410
  - spec/gherkin/formatter/json_formatter_spec.rb
@@ -416,6 +421,7 @@ test_files:
416
421
  - spec/gherkin/native_lexer_spec.rb
417
422
  - spec/gherkin/output_stream_string_io.rb
418
423
  - spec/gherkin/parser/parser_spec.rb
424
+ - spec/gherkin/rubify_spec.rb
419
425
  - spec/gherkin/sexp_recorder.rb
420
426
  - spec/gherkin/shared/doc_string_group.rb
421
427
  - spec/gherkin/shared/encoding_group.rb