gherkin 2.11.5 → 2.11.6

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.
@@ -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: ruby
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: rake-compiler
@@ -20,7 +20,7 @@ dependencies:
20
20
  requirements:
21
21
  - - ! '>='
22
22
  - !ruby/object:Gem::Version
23
- version: 0.8.1
23
+ version: 0.8.2
24
24
  type: :development
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: 0.8.1
31
+ version: 0.8.2
32
32
  - !ruby/object:Gem::Dependency
33
33
  name: json
34
34
  requirement: !ruby/object:Gem::Requirement
@@ -36,7 +36,7 @@ dependencies:
36
36
  requirements:
37
37
  - - ! '>='
38
38
  - !ruby/object:Gem::Version
39
- version: 1.4.6
39
+ version: 1.7.6
40
40
  type: :runtime
41
41
  prerelease: false
42
42
  version_requirements: !ruby/object:Gem::Requirement
@@ -44,7 +44,7 @@ dependencies:
44
44
  requirements:
45
45
  - - ! '>='
46
46
  - !ruby/object:Gem::Version
47
- version: 1.4.6
47
+ version: 1.7.6
48
48
  - !ruby/object:Gem::Dependency
49
49
  name: cucumber
50
50
  requirement: !ruby/object:Gem::Requirement
@@ -68,7 +68,7 @@ dependencies:
68
68
  requirements:
69
69
  - - ! '>='
70
70
  - !ruby/object:Gem::Version
71
- version: 0.9.2
71
+ version: 10.0.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: 0.9.2
79
+ version: 10.0.3
80
80
  - !ruby/object:Gem::Dependency
81
81
  name: bundler
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: 1.2.1
87
+ version: 1.2.3
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: 1.2.1
95
+ version: 1.2.3
96
96
  - !ruby/object:Gem::Dependency
97
97
  name: rspec
98
98
  requirement: !ruby/object:Gem::Requirement
@@ -100,7 +100,7 @@ dependencies:
100
100
  requirements:
101
101
  - - ~>
102
102
  - !ruby/object:Gem::Version
103
- version: 2.11.0
103
+ version: 2.12.0
104
104
  type: :development
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
@@ -108,7 +108,7 @@ dependencies:
108
108
  requirements:
109
109
  - - ~>
110
110
  - !ruby/object:Gem::Version
111
- version: 2.11.0
111
+ version: 2.12.0
112
112
  - !ruby/object:Gem::Dependency
113
113
  name: rubyzip
114
114
  requirement: !ruby/object:Gem::Requirement
@@ -132,7 +132,7 @@ dependencies:
132
132
  requirements:
133
133
  - - ! '>='
134
134
  - !ruby/object:Gem::Version
135
- version: 0.10.2
135
+ version: 0.11.2
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.10.2
143
+ version: 0.11.2
144
144
  - !ruby/object:Gem::Dependency
145
145
  name: yard
146
146
  requirement: !ruby/object:Gem::Requirement
@@ -148,7 +148,7 @@ dependencies:
148
148
  requirements:
149
149
  - - ! '>='
150
150
  - !ruby/object:Gem::Version
151
- version: 0.8.2.1
151
+ version: 0.8.3
152
152
  type: :development
153
153
  prerelease: false
154
154
  version_requirements: !ruby/object:Gem::Requirement
@@ -156,7 +156,7 @@ dependencies:
156
156
  requirements:
157
157
  - - ! '>='
158
158
  - !ruby/object:Gem::Version
159
- version: 0.8.2.1
159
+ version: 0.8.3
160
160
  - !ruby/object:Gem::Dependency
161
161
  name: rdiscount
162
162
  requirement: !ruby/object:Gem::Requirement
@@ -196,7 +196,7 @@ dependencies:
196
196
  requirements:
197
197
  - - ! '>='
198
198
  - !ruby/object:Gem::Version
199
- version: 3.1.3
199
+ version: 3.1.4
200
200
  type: :development
201
201
  prerelease: false
202
202
  version_requirements: !ruby/object:Gem::Requirement
@@ -204,7 +204,7 @@ dependencies:
204
204
  requirements:
205
205
  - - ! '>='
206
206
  - !ruby/object:Gem::Version
207
- version: 3.1.3
207
+ version: 3.1.4
208
208
  description: A fast Gherkin lexer/parser based on the Ragel State Machine Compiler.
209
209
  email: cukes@googlegroups.com
210
210
  executables: []
@@ -230,6 +230,7 @@ extensions:
230
230
  - ext/gherkin_lexer_fi/extconf.rb
231
231
  - ext/gherkin_lexer_fr/extconf.rb
232
232
  - ext/gherkin_lexer_he/extconf.rb
233
+ - ext/gherkin_lexer_hi/extconf.rb
233
234
  - ext/gherkin_lexer_hr/extconf.rb
234
235
  - ext/gherkin_lexer_hu/extconf.rb
235
236
  - ext/gherkin_lexer_id/extconf.rb
@@ -250,7 +251,9 @@ extensions:
250
251
  - ext/gherkin_lexer_sr_cyrl/extconf.rb
251
252
  - ext/gherkin_lexer_sr_latn/extconf.rb
252
253
  - ext/gherkin_lexer_sv/extconf.rb
254
+ - ext/gherkin_lexer_tl/extconf.rb
253
255
  - ext/gherkin_lexer_tr/extconf.rb
256
+ - ext/gherkin_lexer_tt/extconf.rb
254
257
  - ext/gherkin_lexer_uk/extconf.rb
255
258
  - ext/gherkin_lexer_uz/extconf.rb
256
259
  - ext/gherkin_lexer_vi/extconf.rb
@@ -313,6 +316,8 @@ files:
313
316
  - lib/gherkin/json_parser.rb
314
317
  - lib/gherkin/lexer/encoding.rb
315
318
  - lib/gherkin/lexer/i18n_lexer.rb
319
+ - lib/gherkin/lexer/tl.rb
320
+ - lib/gherkin/lexer/tt.rb
316
321
  - lib/gherkin/listener/event.rb
317
322
  - lib/gherkin/listener/formatter_listener.rb
318
323
  - lib/gherkin/native.rb
@@ -355,6 +360,7 @@ files:
355
360
  - spec/gherkin/fixtures/simple_with_comments.feature
356
361
  - spec/gherkin/fixtures/simple_with_tags.feature
357
362
  - spec/gherkin/fixtures/with_bom.feature
363
+ - spec/gherkin/fixtures/with_bom_and_language_spec.feature
358
364
  - spec/gherkin/formatter/ansi_escapes_spec.rb
359
365
  - spec/gherkin/formatter/filter_formatter_spec.rb
360
366
  - spec/gherkin/formatter/json_formatter_spec.rb
@@ -371,6 +377,7 @@ files:
371
377
  - spec/gherkin/native_lexer_spec.rb
372
378
  - spec/gherkin/output_stream_string_io.rb
373
379
  - spec/gherkin/parser/parser_spec.rb
380
+ - spec/gherkin/rubify_spec.rb
374
381
  - spec/gherkin/sexp_recorder.rb
375
382
  - spec/gherkin/shared/doc_string_group.rb
376
383
  - spec/gherkin/shared/encoding_group.rb
@@ -418,6 +425,7 @@ files:
418
425
  - ext/gherkin_lexer_fi/gherkin_lexer_fi.c
419
426
  - ext/gherkin_lexer_fr/gherkin_lexer_fr.c
420
427
  - ext/gherkin_lexer_he/gherkin_lexer_he.c
428
+ - ext/gherkin_lexer_hi/gherkin_lexer_hi.c
421
429
  - ext/gherkin_lexer_hr/gherkin_lexer_hr.c
422
430
  - ext/gherkin_lexer_hu/gherkin_lexer_hu.c
423
431
  - ext/gherkin_lexer_id/gherkin_lexer_id.c
@@ -438,7 +446,9 @@ files:
438
446
  - ext/gherkin_lexer_sr_cyrl/gherkin_lexer_sr_cyrl.c
439
447
  - ext/gherkin_lexer_sr_latn/gherkin_lexer_sr_latn.c
440
448
  - ext/gherkin_lexer_sv/gherkin_lexer_sv.c
449
+ - ext/gherkin_lexer_tl/gherkin_lexer_tl.c
441
450
  - ext/gherkin_lexer_tr/gherkin_lexer_tr.c
451
+ - ext/gherkin_lexer_tt/gherkin_lexer_tt.c
442
452
  - ext/gherkin_lexer_uk/gherkin_lexer_uk.c
443
453
  - ext/gherkin_lexer_uz/gherkin_lexer_uz.c
444
454
  - ext/gherkin_lexer_vi/gherkin_lexer_vi.c
@@ -465,6 +475,7 @@ files:
465
475
  - ext/gherkin_lexer_fi/extconf.rb
466
476
  - ext/gherkin_lexer_fr/extconf.rb
467
477
  - ext/gherkin_lexer_he/extconf.rb
478
+ - ext/gherkin_lexer_hi/extconf.rb
468
479
  - ext/gherkin_lexer_hr/extconf.rb
469
480
  - ext/gherkin_lexer_hu/extconf.rb
470
481
  - ext/gherkin_lexer_id/extconf.rb
@@ -485,7 +496,9 @@ files:
485
496
  - ext/gherkin_lexer_sr_cyrl/extconf.rb
486
497
  - ext/gherkin_lexer_sr_latn/extconf.rb
487
498
  - ext/gherkin_lexer_sv/extconf.rb
499
+ - ext/gherkin_lexer_tl/extconf.rb
488
500
  - ext/gherkin_lexer_tr/extconf.rb
501
+ - ext/gherkin_lexer_tt/extconf.rb
489
502
  - ext/gherkin_lexer_uk/extconf.rb
490
503
  - ext/gherkin_lexer_uz/extconf.rb
491
504
  - ext/gherkin_lexer_vi/extconf.rb
@@ -515,7 +528,7 @@ rubyforge_project:
515
528
  rubygems_version: 1.8.24
516
529
  signing_key:
517
530
  specification_version: 3
518
- summary: gherkin-2.11.5
531
+ summary: gherkin-2.11.6
519
532
  test_files:
520
533
  - features/escaped_pipes.feature
521
534
  - features/feature_parser.feature
@@ -556,6 +569,7 @@ test_files:
556
569
  - spec/gherkin/fixtures/simple_with_comments.feature
557
570
  - spec/gherkin/fixtures/simple_with_tags.feature
558
571
  - spec/gherkin/fixtures/with_bom.feature
572
+ - spec/gherkin/fixtures/with_bom_and_language_spec.feature
559
573
  - spec/gherkin/formatter/ansi_escapes_spec.rb
560
574
  - spec/gherkin/formatter/filter_formatter_spec.rb
561
575
  - spec/gherkin/formatter/json_formatter_spec.rb
@@ -572,6 +586,7 @@ test_files:
572
586
  - spec/gherkin/native_lexer_spec.rb
573
587
  - spec/gherkin/output_stream_string_io.rb
574
588
  - spec/gherkin/parser/parser_spec.rb
589
+ - spec/gherkin/rubify_spec.rb
575
590
  - spec/gherkin/sexp_recorder.rb
576
591
  - spec/gherkin/shared/doc_string_group.rb
577
592
  - spec/gherkin/shared/encoding_group.rb