gherkin 2.12.1-x86-mingw32 → 2.12.2-x86-mingw32

Sign up to get free protection for your applications and to get access to all the features.
Files changed (140) hide show
  1. checksums.yaml +4 -4
  2. data/.ruby-version +1 -1
  3. data/History.md +11 -0
  4. data/README.md +1 -1
  5. data/gherkin.gemspec +5 -5
  6. data/lib/1.9/gherkin_lexer_ar.so +0 -0
  7. data/lib/1.9/gherkin_lexer_bg.so +0 -0
  8. data/lib/1.9/gherkin_lexer_bm.so +0 -0
  9. data/lib/1.9/gherkin_lexer_ca.so +0 -0
  10. data/lib/1.9/gherkin_lexer_cs.so +0 -0
  11. data/lib/1.9/gherkin_lexer_cy_gb.so +0 -0
  12. data/lib/1.9/gherkin_lexer_da.so +0 -0
  13. data/lib/1.9/gherkin_lexer_de.so +0 -0
  14. data/lib/1.9/gherkin_lexer_el.so +0 -0
  15. data/lib/1.9/gherkin_lexer_en.so +0 -0
  16. data/lib/1.9/gherkin_lexer_en_au.so +0 -0
  17. data/lib/1.9/gherkin_lexer_en_lol.so +0 -0
  18. data/lib/1.9/gherkin_lexer_en_old.so +0 -0
  19. data/lib/1.9/gherkin_lexer_en_pirate.so +0 -0
  20. data/lib/1.9/gherkin_lexer_en_scouse.so +0 -0
  21. data/lib/1.9/gherkin_lexer_en_tx.so +0 -0
  22. data/lib/1.9/gherkin_lexer_eo.so +0 -0
  23. data/lib/1.9/gherkin_lexer_es.so +0 -0
  24. data/lib/1.9/gherkin_lexer_et.so +0 -0
  25. data/lib/1.9/gherkin_lexer_fa.so +0 -0
  26. data/lib/1.9/gherkin_lexer_fi.so +0 -0
  27. data/lib/1.9/gherkin_lexer_fr.so +0 -0
  28. data/lib/1.9/gherkin_lexer_gl.so +0 -0
  29. data/lib/1.9/gherkin_lexer_he.so +0 -0
  30. data/lib/1.9/gherkin_lexer_hi.so +0 -0
  31. data/lib/1.9/gherkin_lexer_hr.so +0 -0
  32. data/lib/1.9/gherkin_lexer_hu.so +0 -0
  33. data/lib/1.9/gherkin_lexer_id.so +0 -0
  34. data/lib/1.9/gherkin_lexer_is.so +0 -0
  35. data/lib/1.9/gherkin_lexer_it.so +0 -0
  36. data/lib/1.9/gherkin_lexer_ja.so +0 -0
  37. data/lib/1.9/gherkin_lexer_kn.so +0 -0
  38. data/lib/1.9/gherkin_lexer_ko.so +0 -0
  39. data/lib/1.9/gherkin_lexer_lt.so +0 -0
  40. data/lib/1.9/gherkin_lexer_lu.so +0 -0
  41. data/lib/1.9/gherkin_lexer_lv.so +0 -0
  42. data/lib/1.9/gherkin_lexer_nl.so +0 -0
  43. data/lib/1.9/gherkin_lexer_no.so +0 -0
  44. data/lib/1.9/gherkin_lexer_pa.so +0 -0
  45. data/lib/1.9/gherkin_lexer_pl.so +0 -0
  46. data/lib/1.9/gherkin_lexer_pt.so +0 -0
  47. data/lib/1.9/gherkin_lexer_ro.so +0 -0
  48. data/lib/1.9/gherkin_lexer_ru.so +0 -0
  49. data/lib/1.9/gherkin_lexer_sk.so +0 -0
  50. data/lib/1.9/gherkin_lexer_sr_cyrl.so +0 -0
  51. data/lib/1.9/gherkin_lexer_sr_latn.so +0 -0
  52. data/lib/1.9/gherkin_lexer_sv.so +0 -0
  53. data/lib/1.9/gherkin_lexer_th.so +0 -0
  54. data/lib/1.9/gherkin_lexer_tl.so +0 -0
  55. data/lib/1.9/gherkin_lexer_tr.so +0 -0
  56. data/lib/1.9/gherkin_lexer_tt.so +0 -0
  57. data/lib/1.9/gherkin_lexer_uk.so +0 -0
  58. data/lib/1.9/gherkin_lexer_uz.so +0 -0
  59. data/lib/1.9/gherkin_lexer_vi.so +0 -0
  60. data/lib/1.9/gherkin_lexer_zh_cn.so +0 -0
  61. data/lib/1.9/gherkin_lexer_zh_tw.so +0 -0
  62. data/lib/2.0/gherkin_lexer_ar.so +0 -0
  63. data/lib/2.0/gherkin_lexer_bg.so +0 -0
  64. data/lib/2.0/gherkin_lexer_bm.so +0 -0
  65. data/lib/2.0/gherkin_lexer_ca.so +0 -0
  66. data/lib/2.0/gherkin_lexer_cs.so +0 -0
  67. data/lib/2.0/gherkin_lexer_cy_gb.so +0 -0
  68. data/lib/2.0/gherkin_lexer_da.so +0 -0
  69. data/lib/2.0/gherkin_lexer_de.so +0 -0
  70. data/lib/2.0/gherkin_lexer_el.so +0 -0
  71. data/lib/2.0/gherkin_lexer_en.so +0 -0
  72. data/lib/2.0/gherkin_lexer_en_au.so +0 -0
  73. data/lib/2.0/gherkin_lexer_en_lol.so +0 -0
  74. data/lib/2.0/gherkin_lexer_en_old.so +0 -0
  75. data/lib/2.0/gherkin_lexer_en_pirate.so +0 -0
  76. data/lib/2.0/gherkin_lexer_en_scouse.so +0 -0
  77. data/lib/2.0/gherkin_lexer_en_tx.so +0 -0
  78. data/lib/2.0/gherkin_lexer_eo.so +0 -0
  79. data/lib/2.0/gherkin_lexer_es.so +0 -0
  80. data/lib/2.0/gherkin_lexer_et.so +0 -0
  81. data/lib/2.0/gherkin_lexer_fa.so +0 -0
  82. data/lib/2.0/gherkin_lexer_fi.so +0 -0
  83. data/lib/2.0/gherkin_lexer_fr.so +0 -0
  84. data/lib/2.0/gherkin_lexer_gl.so +0 -0
  85. data/lib/2.0/gherkin_lexer_he.so +0 -0
  86. data/lib/2.0/gherkin_lexer_hi.so +0 -0
  87. data/lib/2.0/gherkin_lexer_hr.so +0 -0
  88. data/lib/2.0/gherkin_lexer_hu.so +0 -0
  89. data/lib/2.0/gherkin_lexer_id.so +0 -0
  90. data/lib/2.0/gherkin_lexer_is.so +0 -0
  91. data/lib/2.0/gherkin_lexer_it.so +0 -0
  92. data/lib/2.0/gherkin_lexer_ja.so +0 -0
  93. data/lib/2.0/gherkin_lexer_kn.so +0 -0
  94. data/lib/2.0/gherkin_lexer_ko.so +0 -0
  95. data/lib/2.0/gherkin_lexer_lt.so +0 -0
  96. data/lib/2.0/gherkin_lexer_lu.so +0 -0
  97. data/lib/2.0/gherkin_lexer_lv.so +0 -0
  98. data/lib/2.0/gherkin_lexer_nl.so +0 -0
  99. data/lib/2.0/gherkin_lexer_no.so +0 -0
  100. data/lib/2.0/gherkin_lexer_pa.so +0 -0
  101. data/lib/2.0/gherkin_lexer_pl.so +0 -0
  102. data/lib/2.0/gherkin_lexer_pt.so +0 -0
  103. data/lib/2.0/gherkin_lexer_ro.so +0 -0
  104. data/lib/2.0/gherkin_lexer_ru.so +0 -0
  105. data/lib/2.0/gherkin_lexer_sk.so +0 -0
  106. data/lib/2.0/gherkin_lexer_sr_cyrl.so +0 -0
  107. data/lib/2.0/gherkin_lexer_sr_latn.so +0 -0
  108. data/lib/2.0/gherkin_lexer_sv.so +0 -0
  109. data/lib/2.0/gherkin_lexer_th.so +0 -0
  110. data/lib/2.0/gherkin_lexer_tl.so +0 -0
  111. data/lib/2.0/gherkin_lexer_tr.so +0 -0
  112. data/lib/2.0/gherkin_lexer_tt.so +0 -0
  113. data/lib/2.0/gherkin_lexer_uk.so +0 -0
  114. data/lib/2.0/gherkin_lexer_uz.so +0 -0
  115. data/lib/2.0/gherkin_lexer_vi.so +0 -0
  116. data/lib/2.0/gherkin_lexer_zh_cn.so +0 -0
  117. data/lib/2.0/gherkin_lexer_zh_tw.so +0 -0
  118. data/lib/gherkin/formatter/filter_formatter.rb +5 -1
  119. data/lib/gherkin/formatter/pretty_formatter.rb +3 -2
  120. data/lib/gherkin/i18n.json +15 -1
  121. data/lib/gherkin/listener/formatter_listener.rb +13 -6
  122. data/lib/gherkin/platform.rb +2 -2
  123. data/lib/gherkin/tag_expression.rb +1 -0
  124. data/ragel/lexer.js.rl.erb +109 -14
  125. data/ragel/lexer.rb.rl.erb +3 -0
  126. data/spec/gherkin/i18n_spec.rb +1 -0
  127. data/spec/gherkin/json_parser_spec.rb +10 -22
  128. data/spec/gherkin/lexer/i18n_lexer_spec.rb +7 -3
  129. data/spec/gherkin/parser/parser_spec.rb +1 -1
  130. data/spec/gherkin/rubify_spec.rb +1 -1
  131. data/spec/gherkin/shared/doc_string_group.rb +0 -2
  132. data/spec/gherkin/shared/encoding_group.rb +0 -2
  133. data/spec/gherkin/shared/lexer_group.rb +0 -2
  134. data/spec/gherkin/shared/row_group.rb +0 -2
  135. data/spec/gherkin/shared/tags_group.rb +0 -2
  136. data/spec/spec_helper.rb +21 -7
  137. data/tasks/ikvm.rake +2 -3
  138. data/tasks/ragel_task.rb +8 -0
  139. data/tasks/rspec.rake +1 -1
  140. metadata +23 -21
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 728c308074349665b8c258ff94cc7321d021e58a
4
- data.tar.gz: e8e82f2995a8e83c825bc1083e93f27fae97dd68
3
+ metadata.gz: 3b8617b4e41600a3d3bfa233108e8475f6d11b55
4
+ data.tar.gz: 59288c8d5bbbf077def193adc9d3199726c7ea9c
5
5
  SHA512:
6
- metadata.gz: 2829b83225d827aab7cc510112048c345268501636255a576d579f0678cdc68bcb1fbf6299a21b02832493f1bea8317eec00167a97b56c84aef04e05e88e753c
7
- data.tar.gz: 7fcb32901dd9e7157449fd6497950659bdb8ebd0a0641d88d3dbdd292dcff0829bbc0a9fa250860bb4b3e4d7ad4e542c5d3f79976887eb994609f506d112ad0d
6
+ metadata.gz: 11dadb58787d589d30b9850306bb3a9ef59e7397d30f574438e9b0047e00574c874a0098d51761614f22ad6e0b182e3ef5979d9a0555b1133e8f151932b61f44
7
+ data.tar.gz: fdba49f7598db076f36c773f20abfcfc19a67147435649bcb66953282689ecd0353edd75e8222ef1af9aa06463f3e162f42bc7ce5e559234f4648a89c5ca9c48
@@ -1 +1 @@
1
- 2.0.0-p0
1
+ 2.0.0-p247
data/History.md CHANGED
@@ -1,3 +1,14 @@
1
+ ## [2.12.2](https://github.com/cucumber/gherkin/compare/v2.12.1...v2.12.2)
2
+
3
+ * [Core] Fix Ruby 2.0 warnings ([#265](https://github.com/cucumber/gherkin/issues/265) Aslak Hellesøy)
4
+ * [Java] Expose ID so that tools can differentiate between runs of scenario examples ([#279](https://github.com/cucumber/gherkin/pull/278) jtnord)
5
+ * [Java] Ensure PrettyFormatter outputs whole lines and flushed in between ([#277](https://github.com/cucumber/gherkin/pull/277) Ramon Nogueira)
6
+ * [Java] Durations are Longs not longs as they are optional ([#276](https://github.com/cucumber/gherkin/pull/276) jtnord)
7
+ * [Core] Added ಕನ್ನಡ kannaḍa language ([#282](https://github.com/cucumber/gherkin/pull/282) Nikhil Lingutla)
8
+ * [Java] extension of the Formatter interface for more precise lifecycle handling ([#275](https://github.com/cucumber/gherkin/pull/275) Sebastian Gröbler)
9
+ * Java JSONFormatter should record before hooks in next scenario ([#270](https://github.com/cucumber/gherkin/pull/270) Björn Rasmusson)
10
+ * [JavaScript] Fix encoding issues ([#272](https://github.com/cucumber/gherkin/pull/272) Lukas Degener, Thorsten Glaser)
11
+
1
12
  ## [2.12.1](https://github.com/cucumber/gherkin/compare/v2.12.0...v2.12.1)
2
13
 
3
14
  * Dropped support for ruby 1.8.7 (Aslak Hellesøy)
data/README.md CHANGED
@@ -54,7 +54,7 @@ The jar file is in the central Maven repo.
54
54
  <dependency>
55
55
  <groupId>info.cukes</groupId>
56
56
  <artifactId>gherkin</artifactId>
57
- <version>2.12.1</version>
57
+ <version>2.12.2</version>
58
58
  </dependency>
59
59
 
60
60
  You can get it manually from [Maven Central](http://search.maven.org/#browse%7C-2073395818)
@@ -61,20 +61,20 @@ Gem::Specification.new do |s|
61
61
 
62
62
  s.add_runtime_dependency('multi_json', '~> 1.3')
63
63
 
64
- s.add_development_dependency('cucumber', '>= 1.3.4')
64
+ s.add_development_dependency('cucumber', '>= 1.3.8')
65
65
  s.add_development_dependency('rake', '>= 10.1.0')
66
66
  s.add_development_dependency('bundler', '>= 1.3.5') # Make sure it's in sync with /.travis.yml
67
67
  s.add_development_dependency('rspec', '~> 2.14.1')
68
- s.add_development_dependency('rubyzip', '>= 0.9.9')
68
+ s.add_development_dependency('rubyzip', '>= 1.0.0')
69
+ s.add_development_dependency('ruby-beautify', '= 0.92.2')
69
70
 
70
71
  unless ENV['RUBY_CC_VERSION'] || Gherkin::JRUBY
71
- s.add_development_dependency('therubyracer', '>= 0.11.4') if ENV['GHERKIN_JS']
72
+ s.add_development_dependency('therubyracer', '>= 0.12.0') if ENV['GHERKIN_JS']
72
73
  # For Documentation:
73
- s.add_development_dependency('yard', '>= 0.8.6.2')
74
+ s.add_development_dependency('yard', '>= 0.8.7.2')
74
75
  s.add_development_dependency('rdiscount', '>= 2.1.6')
75
76
  end
76
77
 
77
78
  # Only needed by Cucumber. Remove when Cucumber no longer needs those.
78
- s.add_development_dependency('term-ansicolor', '>= 1.2.2')
79
79
  s.add_development_dependency('builder', '>= 3.2.2')
80
80
  end
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
@@ -17,11 +17,15 @@ module Gherkin
17
17
  @feature_tags = []
18
18
  @feature_element_tags = []
19
19
  @examples_tags = []
20
-
20
+ @examples_range = []
21
21
  @feature_events = []
22
22
  @background_events = []
23
23
  @feature_element_events = []
24
24
  @examples_events = []
25
+
26
+ @examples_name = nil
27
+ @feature_element_name = nil
28
+ @feature_element_range = nil
25
29
  end
26
30
 
27
31
  def uri(uri)
@@ -19,9 +19,10 @@ module Gherkin
19
19
  @step_printer = StepPrinter.new
20
20
  @monochrome = monochrome
21
21
  @executing = executing
22
- @background = nil
23
- @tag_statement = nil
24
22
  @steps = []
23
+
24
+ # Prevent warnings, initialize fields
25
+ @background = @tag_statement = @formats = @statement = nil
25
26
  end
26
27
 
27
28
  def uri(uri)
@@ -133,7 +133,7 @@
133
133
  "scenario": "Σενάριο",
134
134
  "scenario_outline": "Περιγραφή Σεναρίου",
135
135
  "examples": "Παραδείγματα|Σενάρια",
136
- "given": "*|Δεδομένου|Δεδομένου ότι",
136
+ "given": "*|Δεδομένου",
137
137
  "when": "*|Όταν",
138
138
  "then": "*|Τότε",
139
139
  "and": "*|Και",
@@ -433,6 +433,20 @@
433
433
  "and": "*|かつ<",
434
434
  "but": "*|しかし<|但し<|ただし<"
435
435
  },
436
+ "kn": {
437
+ "name": "Kannada",
438
+ "native": "ಕನ್ನಡ",
439
+ "background": "ಹಿನ್ನೆಲೆ",
440
+ "feature": "ಹೆಚ್ಚಳ",
441
+ "scenario": "ಕಥಾಸಾರಾಂಶ",
442
+ "scenario_outline": "ವಿವರಣೆ",
443
+ "examples": "ಉದಾಹರಣೆಗಳು",
444
+ "given": "*|ನೀಡಿದ",
445
+ "when": "*|ಸ್ಥಿತಿಯನ್ನು",
446
+ "then": "*|ನಂತರ",
447
+ "and": "*|ಮತ್ತು",
448
+ "but": "*|ಆದರೆ"
449
+ },
436
450
  "ko": {
437
451
  "name": "Korean",
438
452
  "native": "한국어",
@@ -12,6 +12,7 @@ module Gherkin
12
12
  def initialize(formatter)
13
13
  @formatter = formatter
14
14
  @stash = Stash.new
15
+ @current_builder = nil
15
16
  end
16
17
 
17
18
  def comment(value, line)
@@ -57,13 +58,13 @@ module Gherkin
57
58
 
58
59
  def step(keyword, name, line)
59
60
  replay_step_or_examples
60
- @stash.basic_statement do |comments, id|
61
+ @stash.step do |comments|
61
62
  @current_builder = Formatter::Model::Step::Builder.new(comments, keyword, name, line)
62
63
  end
63
64
  end
64
65
 
65
66
  def row(cells, line)
66
- @stash.basic_statement do |comments, id|
67
+ @stash.row do |comments, id|
67
68
  @current_builder.row(comments, cells, line, id)
68
69
  end
69
70
  end
@@ -117,13 +118,19 @@ module Gherkin
117
118
  yield @comments, @tags, @examples_id
118
119
  @comments, @tags = [], []
119
120
  end
120
-
121
- def basic_statement
121
+
122
+ def step
122
123
  @row_index += 1
123
- yield @comments, "#{@examples_id};#{@row_index}"
124
+ yield @comments
124
125
  @comments = []
125
126
  end
126
-
127
+
128
+ def row
129
+ @row_index += 1
130
+ yield @comments, defined?(@examples_id) ? "#{@examples_id};#{@row_index}" : :undefined_examples_id
131
+ @comments = []
132
+ end
133
+
127
134
  def tag(tag)
128
135
  @tags << tag
129
136
  end
@@ -3,8 +3,8 @@
3
3
  module Gherkin
4
4
  unless defined?(Gherkin::VERSION)
5
5
  # See the comment in gherkin.gemspec if you bump the MINOR version (MAJOR.MINOR.PATCH).
6
- VERSION = '2.12.1'
7
- JRUBY = defined?(JRUBY_VERSION)
6
+ VERSION = '2.12.2'
7
+ JRUBY = defined?(JRUBY_VERSION)
8
8
 
9
9
  if !JRUBY && !(RUBY_VERSION =~ /^(1\.9\.3|2\.0)/)
10
10
  warn("WARNING: Unsupported Ruby version - #{RUBY_VERSION}")
@@ -21,6 +21,7 @@ module Gherkin
21
21
  def evaluate(tags)
22
22
  return true if @ands.flatten.empty?
23
23
  vars = Hash[*tags.map{|tag| [tag.name, true]}.flatten]
24
+ raise "No vars" if vars.nil? # Useless statement to prevent ruby warnings about unused var
24
25
  !!Kernel.eval(ruby_expression)
25
26
  end
26
27
 
@@ -115,7 +115,7 @@
115
115
  action end_feature {
116
116
  if(this.cs < lexer_first_final) {
117
117
  var content = this.current_line_content(data, p);
118
- throw "Lexing error on line " + this.line_number + ": '" + content + "'. See http://wiki.github.com/cucumber/gherkin/lexingerror for more information.";
118
+ throw new Error("Lexing error on line " + this.line_number + ": '" + content + "'. See http://wiki.github.com/cucumber/gherkin/lexingerror for more information.");
119
119
  } else {
120
120
  this.listener.eof();
121
121
  }
@@ -128,6 +128,7 @@
128
128
  %% write data;
129
129
  %% access this.;
130
130
  %% variable data data;
131
+ %% getkey signedCharValue(data[p]);
131
132
 
132
133
  var Lexer = function(listener) {
133
134
  // Check that listener has the required functions
@@ -135,7 +136,7 @@ var Lexer = function(listener) {
135
136
  for(var i=0, len=events.length; i<len; i++) {
136
137
  var event = events[i];
137
138
  if(typeof listener[event] != 'function') {
138
- throw "Error. No " + event + " function exists on " + JSON.stringify(listener);
139
+ throw new Error("Error. No " + event + " function exists on " + JSON.stringify(listener));
139
140
  }
140
141
  }
141
142
  this.listener = listener;
@@ -157,30 +158,124 @@ Lexer.prototype.scan = function(data) {
157
158
 
158
159
  this.line_number = 1;
159
160
  this.last_newline = 0;
161
+ var signedCharValue=function(v){return v > 127 ? v-256 : v; };
160
162
 
161
163
  %% write init;
162
164
  %% write exec;
163
165
  };
164
166
 
167
+
168
+ /*
169
+ * Decode utf-8 byte sequence to string.
170
+ */
171
+ var decodeUtf8 = function(bytes) {
172
+ var result = "";
173
+ var i = 0;
174
+ var wc;
175
+ var c;
176
+
177
+ while (i < bytes.length) {
178
+ /* parse as UTF-8 lead byte */
179
+ wc = bytes[i++];
180
+ if (wc < 0x80) {
181
+ count = 0;
182
+ } else if (wc < 0xC2 || wc >= 0xF8) {
183
+ throw new Error("input is not a valid UTF-8 lead octet");
184
+ } else if (wc < 0xE0) {
185
+ count = 1;
186
+ wc = (wc & 0x1F) << 6;
187
+ } else if (wc < 0xF0) {
188
+ count = 2;
189
+ wc = (wc & 0x0F) << 12;
190
+ } else /* wc < 0xF8 */ {
191
+ count = 3;
192
+ wc = (wc & 0x07) << 18;
193
+ }
194
+
195
+ /* parse trail bytes, if any */
196
+ while (count) {
197
+ if (!(i < bytes.length)) {
198
+ throw new Error("short read");
199
+ }
200
+ if ((c = bytes[i++] ^ 0x80) > 0x3F) {
201
+ throw new Error("input is not a valid UTF-8 trail octet");
202
+ }
203
+ wc |= c << (6 * --count);
204
+ if (wc < (1 << (5 * count + 6))) {
205
+ throw new Error("invalid non-minimal encoded input");
206
+ }
207
+ }
208
+
209
+ /* handle conversion to UTF-16 if needed */
210
+ if (wc > 0xFFFF) {
211
+ wc -= 0x10000;
212
+ result += String.fromCharCode(0xD800 + (wc >> 10));
213
+ wc = 0xDC00 + (wc & 0x3FF);
214
+ }
215
+ result += String.fromCharCode(wc);
216
+ }
217
+
218
+ return result;
219
+ };
220
+
221
+ /*
222
+ * Encode string to an array of bytes using utf8 encoding.
223
+ *
224
+ * Javascript internally stores character data as utf16 (like java).
225
+ * String.charCodeAt() does *not* produce unicode points, but simply
226
+ * reflects this internal representation. Thus, it is necessary
227
+ * to first decode the utf-16 representation before encoding to
228
+ * utf-8.
229
+ */
230
+ var encodeUtf8 = function(string) {
231
+ var bytes = [];
232
+ var i = 0;
233
+ var j = 0;
234
+ var wc;
235
+
236
+ while (i < string.length) {
237
+ wc = string.charCodeAt(i++);
238
+ if (wc >= 0xD800 && wc <= 0xDBFF && i < string.length && string.charCodeAt(i) >= 0xDC00 && string.charCodeAt(i) <= 0xDFFF) {
239
+ /* decode UTF-16 */
240
+ wc = 0x10000 + ((wc & 0x3FF) << 10) + (string.charCodeAt(i++) & 0x3FF);
241
+ }
242
+
243
+ /* emit lead byte */
244
+ if (wc < 0x80) {
245
+ bytes[j++] = wc;
246
+ count = 0;
247
+ } else if (wc < 0x800) {
248
+ bytes[j++] = 0xC0 | (wc >> 6);
249
+ count = 1;
250
+ } else if (wc < 0x10000) {
251
+ bytes[j++] = 0xE0 | (wc >> 12);
252
+ count = 2;
253
+ } else {
254
+ /* SMP: 21-bit Unicode */
255
+ bytes[j++] = 0xF0 | (wc >> 18);
256
+ count = 3;
257
+ }
258
+
259
+ /* emit trail bytes, if any */
260
+ while (count) {
261
+ bytes[j++] = 0x80 | ((wc >> (6 * --count)) & 0x3F);
262
+ }
263
+ }
264
+
265
+ return bytes;
266
+
267
+ };
268
+
165
269
  Lexer.prototype.bytesToString = function(bytes) {
166
270
  if(typeof bytes.write == 'function') {
167
271
  // Node.js
168
272
  return bytes.toString('utf-8');
169
- } else {
170
- var result = "";
171
- for(var b in bytes) {
172
- result += String.fromCharCode(bytes[b]);
173
- }
174
- return result;
175
273
  }
274
+ return decodeUtf8(bytes);
176
275
  };
177
276
 
178
277
  Lexer.prototype.stringToBytes = function(string) {
179
- var bytes = [];
180
- for(var i = 0; i < string.length; i++) {
181
- bytes[i] = string.charCodeAt(i);
182
- }
183
- return bytes;
278
+ return encodeUtf8(string);
184
279
  };
185
280
 
186
281
  Lexer.prototype.unindent = function(startcol, text) {
@@ -202,7 +297,7 @@ Lexer.prototype.store_keyword_content = function(event, data, p, eof) {
202
297
  };
203
298
 
204
299
  Lexer.prototype.current_line_content = function(data, p) {
205
- var rest = data.slice(this.last_newline, -1);
300
+ var rest = Array.prototype.slice.call(data,this.last_newline, -1);
206
301
  var end = rest.indexOf(10) || -1;
207
302
  return this.bytesToString(rest.slice(0, end)).trim();
208
303
  };
@@ -126,6 +126,9 @@ module Gherkin
126
126
 
127
127
  def initialize(listener)
128
128
  @listener = listener
129
+
130
+ # Initialize ivars to avoid warnings
131
+ @keyword = nil
129
132
  %% write data;
130
133
  end
131
134
 
@@ -198,6 +198,7 @@ module Gherkin
198
198
  | is | Icelandic | Íslenska |
199
199
  | it | Italian | italiano |
200
200
  | ja | Japanese | 日本語 |
201
+ | kn | Kannada | ಕನ್ನಡ |
201
202
  | ko | Korean | 한국어 |
202
203
  | lt | Lithuanian | lietuvių kalba |
203
204
  | lu | Luxemburgish | Lëtzebuergesch |
@@ -98,28 +98,6 @@ module Gherkin
98
98
  {
99
99
  "id":"one/a-scenario",
100
100
  "type":"scenario",
101
- "before": [
102
- {
103
- "match":{
104
- "location":"features/step_definitions/hooks.rb:1"
105
- },
106
- "result":{
107
- "status":"passed",
108
- "error_message":"Passed hook",
109
- "duration": 3
110
- }
111
- },
112
- {
113
- "match":{
114
- "location":"features/step_definitions/hooks.rb:2"
115
- },
116
- "result":{
117
- "status":"failed",
118
- "error_message":"Failed hook",
119
- "duration": 22
120
- }
121
- }
122
- ],
123
101
  "steps":[
124
102
  {
125
103
  "keyword":"Given ",
@@ -152,6 +130,16 @@ module Gherkin
152
130
  }
153
131
  ],
154
132
  "after": [
133
+ {
134
+ "match":{
135
+ "location":"features/step_definitions/hooks.rb:1"
136
+ },
137
+ "result":{
138
+ "status":"passed",
139
+ "error_message":"Passed after",
140
+ "duration": 3
141
+ }
142
+ },
155
143
  {
156
144
  "match":{
157
145
  "location":"features/step_definitions/hooks.rb:3"
@@ -11,9 +11,13 @@ module Gherkin
11
11
 
12
12
  it "should store the i18n language of the last scanned feature" do
13
13
  @lexer.scan("# language: fr\n")
14
- @lexer.i18n_language.iso_code.should == "fr"
15
- @lexer.scan("# language: no\n")
16
- @lexer.i18n_language.iso_code.should == "no"
14
+ # This if is kind of dumb - it's just to avoid warnings from ruby
15
+ if(@lexer.i18n_language.iso_code.should == "fr")
16
+ @lexer.scan("# language: no\n")
17
+ @lexer.i18n_language.iso_code.should == "no"
18
+ else
19
+ fail
20
+ end
17
21
  end
18
22
 
19
23
  it "should detect language when there are spaces and CRLF" do
@@ -5,7 +5,7 @@ module Gherkin
5
5
  describe Parser do
6
6
  unless defined?(JRUBY_VERSION)
7
7
  it "should raise when feature doesn't parse" do
8
- p = Parser.new(mock('formatter').as_null_object)
8
+ p = Parser.new(double('formatter').as_null_object)
9
9
  lambda do
10
10
  p.parse("Feature: f\nFeature: f", __FILE__, __LINE__-1)
11
11
  end.should raise_error(Regexp.new("Parse error at #{__FILE__}:\\d+"))
@@ -7,7 +7,7 @@ if defined?(JRUBY_VERSION)
7
7
  module Rubify
8
8
  describe "rubify" do
9
9
  before do
10
- @java_collection = [mock("Java.java.util.ArrayList")]
10
+ @java_collection = [double("Java.java.util.ArrayList")]
11
11
  @java_collection.stub(:===).and_return(Java.java.util.Collection)
12
12
  @java_collection.stub(:line).and_return(15)
13
13
  @rubified_array = rubify(@java_collection)
@@ -1,6 +1,4 @@
1
1
  # encoding: utf-8
2
- require 'spec_helper'
3
-
4
2
  module Gherkin
5
3
  module Lexer
6
4
  shared_examples_for "a Gherkin lexer lexing doc_strings" do
@@ -1,6 +1,4 @@
1
1
  #encoding: utf-8
2
- require 'spec_helper'
3
-
4
2
  module Gherkin
5
3
  module Lexer
6
4
  shared_examples_for "encoding" do
@@ -1,6 +1,4 @@
1
1
  #encoding: utf-8
2
- require 'spec_helper'
3
-
4
2
  module Gherkin
5
3
  module Lexer
6
4
  shared_examples_for "a Gherkin lexer" do
@@ -1,6 +1,4 @@
1
1
  # encoding: utf-8
2
- require 'spec_helper'
3
-
4
2
  module Gherkin
5
3
  module Lexer
6
4
  shared_examples_for "a Gherkin lexer lexing rows" do
@@ -1,6 +1,4 @@
1
1
  # encoding: utf-8
2
- require 'spec_helper'
3
-
4
2
  module Gherkin
5
3
  module Lexer
6
4
  shared_examples_for "a Gherkin lexer lexing tags" do
@@ -1,6 +1,16 @@
1
+ def silence_warnings(&block)
2
+ warn_level = $VERBOSE
3
+ $VERBOSE = nil
4
+ result = block.call
5
+ $VERBOSE = warn_level
6
+ result
7
+ end
8
+
1
9
  if RUBY_VERSION =~ /1\.9|2\.0/
2
- Encoding.default_external = Encoding::UTF_8
3
- Encoding.default_internal = Encoding::UTF_8
10
+ silence_warnings do
11
+ Encoding.default_external = Encoding::UTF_8
12
+ Encoding.default_internal = Encoding::UTF_8
13
+ end
4
14
  end
5
15
  if defined?(JRUBY_VERSION)
6
16
  java_import java.util.ArrayList
@@ -30,7 +40,7 @@ module GherkinSpecHelper
30
40
 
31
41
  def fixture(file)
32
42
  encoding = Gherkin::Lexer::Encoding.new
33
- source = encoding.read_file(File.dirname(__FILE__) + "/gherkin/fixtures/" + file)
43
+ encoding.read_file(File.dirname(__FILE__) + "/gherkin/fixtures/" + file)
34
44
  end
35
45
 
36
46
  def rubify_hash(hash)
@@ -51,8 +61,10 @@ end
51
61
  # Allows comparison of Java List with Ruby Array (rows)
52
62
  RSpec::Matchers.define :r do |expected|
53
63
  match do |row|
54
- def row.inspect
55
- "r " + self.map{|cell| cell}.inspect
64
+ silence_warnings do
65
+ def row.inspect
66
+ "r " + self.map{|cell| cell}.inspect
67
+ end
56
68
  end
57
69
  row.map{|cell| cell}.should == expected
58
70
  end
@@ -60,8 +72,10 @@ end
60
72
 
61
73
  RSpec::Matchers.define :a do |expected|
62
74
  match do |array|
63
- def array.inspect
64
- "a " + self.map{|e| e.to_sym}.inspect
75
+ silence_warnings do
76
+ def array.inspect
77
+ "a " + self.map{|e| e.to_sym}.inspect
78
+ end
65
79
  end
66
80
  array.map{|e| e.to_sym}.should == expected
67
81
  end
@@ -55,8 +55,8 @@ namespace :ikvm do
55
55
  mkdir_p File.dirname(pkg_dir) unless File.directory?(pkg_dir)
56
56
  nuget("Pack #{GHERKIN_NUSPEC} -Version #{GHERKIN_VERSION} -OutputDirectory #{pkg_dir}")
57
57
  # Now, verify that we have a proper dll inside the package
58
- require 'zip/zipfilesystem'
59
- Zip::ZipFile.open(GHERKIN_NUPKG) do |zipfile|
58
+ require 'zip'
59
+ Zip::File.open(GHERKIN_NUPKG) do |zipfile|
60
60
  dll = zipfile.get_entry('lib/gherkin.dll')
61
61
  if(dll.size < 3_000_000)
62
62
  raise "Looks like the dll is too small."
@@ -112,7 +112,6 @@ EOF
112
112
 
113
113
  task :push => GHERKIN_NUPKG do
114
114
  nuget("Push #{GHERKIN_NUPKG}")
115
- nuget("Publish gherkin #{GHERKIN_VERSION}")
116
115
  end
117
116
 
118
117
  file IKVMC_EXE do
@@ -39,6 +39,14 @@ class RagelTask
39
39
  # Minify
40
40
  sh %{node #{UGLIFYJS} #{target} > #{min_target}}
41
41
  end
42
+
43
+ if(@lang == 'rb')
44
+ # Prettify the code so we don't get indentation warnings
45
+ sh %{rbeautify #{target} > tmp.rb}
46
+ sh %{mv tmp.rb #{target}}
47
+ # rbeautify has a bug with class << self ... end alignment. Fix it.
48
+ sh %{perl -i -0pe 's/ end\n self._/ end\n self._/g' #{target}}
49
+ end
42
50
  end
43
51
 
44
52
  if(@lang != 'java')
@@ -2,5 +2,5 @@ require 'rspec/core/rake_task'
2
2
 
3
3
  desc "Run RSpec"
4
4
  task :spec do
5
- sh "rspec spec"
5
+ sh "rspec spec --color --warnings"
6
6
  end
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.12.1
4
+ version: 2.12.2
5
5
  platform: x86-mingw32
6
6
  authors:
7
7
  - Mike Sassak
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2013-08-10 00:00:00.000000000 Z
13
+ date: 2013-10-12 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: multi_json
@@ -32,14 +32,14 @@ dependencies:
32
32
  requirements:
33
33
  - - '>='
34
34
  - !ruby/object:Gem::Version
35
- version: 1.3.4
35
+ version: 1.3.8
36
36
  type: :development
37
37
  prerelease: false
38
38
  version_requirements: !ruby/object:Gem::Requirement
39
39
  requirements:
40
40
  - - '>='
41
41
  - !ruby/object:Gem::Version
42
- version: 1.3.4
42
+ version: 1.3.8
43
43
  - !ruby/object:Gem::Dependency
44
44
  name: rake
45
45
  requirement: !ruby/object:Gem::Requirement
@@ -88,70 +88,70 @@ dependencies:
88
88
  requirements:
89
89
  - - '>='
90
90
  - !ruby/object:Gem::Version
91
- version: 0.9.9
91
+ version: 1.0.0
92
92
  type: :development
93
93
  prerelease: false
94
94
  version_requirements: !ruby/object:Gem::Requirement
95
95
  requirements:
96
96
  - - '>='
97
97
  - !ruby/object:Gem::Version
98
- version: 0.9.9
98
+ version: 1.0.0
99
99
  - !ruby/object:Gem::Dependency
100
- name: therubyracer
100
+ name: ruby-beautify
101
101
  requirement: !ruby/object:Gem::Requirement
102
102
  requirements:
103
- - - '>='
103
+ - - '='
104
104
  - !ruby/object:Gem::Version
105
- version: 0.11.4
105
+ version: 0.92.2
106
106
  type: :development
107
107
  prerelease: false
108
108
  version_requirements: !ruby/object:Gem::Requirement
109
109
  requirements:
110
- - - '>='
110
+ - - '='
111
111
  - !ruby/object:Gem::Version
112
- version: 0.11.4
112
+ version: 0.92.2
113
113
  - !ruby/object:Gem::Dependency
114
- name: yard
114
+ name: therubyracer
115
115
  requirement: !ruby/object:Gem::Requirement
116
116
  requirements:
117
117
  - - '>='
118
118
  - !ruby/object:Gem::Version
119
- version: 0.8.6.2
119
+ version: 0.12.0
120
120
  type: :development
121
121
  prerelease: false
122
122
  version_requirements: !ruby/object:Gem::Requirement
123
123
  requirements:
124
124
  - - '>='
125
125
  - !ruby/object:Gem::Version
126
- version: 0.8.6.2
126
+ version: 0.12.0
127
127
  - !ruby/object:Gem::Dependency
128
- name: rdiscount
128
+ name: yard
129
129
  requirement: !ruby/object:Gem::Requirement
130
130
  requirements:
131
131
  - - '>='
132
132
  - !ruby/object:Gem::Version
133
- version: 2.1.6
133
+ version: 0.8.7.2
134
134
  type: :development
135
135
  prerelease: false
136
136
  version_requirements: !ruby/object:Gem::Requirement
137
137
  requirements:
138
138
  - - '>='
139
139
  - !ruby/object:Gem::Version
140
- version: 2.1.6
140
+ version: 0.8.7.2
141
141
  - !ruby/object:Gem::Dependency
142
- name: term-ansicolor
142
+ name: rdiscount
143
143
  requirement: !ruby/object:Gem::Requirement
144
144
  requirements:
145
145
  - - '>='
146
146
  - !ruby/object:Gem::Version
147
- version: 1.2.2
147
+ version: 2.1.6
148
148
  type: :development
149
149
  prerelease: false
150
150
  version_requirements: !ruby/object:Gem::Requirement
151
151
  requirements:
152
152
  - - '>='
153
153
  - !ruby/object:Gem::Version
154
- version: 1.2.2
154
+ version: 2.1.6
155
155
  - !ruby/object:Gem::Dependency
156
156
  name: builder
157
157
  requirement: !ruby/object:Gem::Requirement
@@ -345,6 +345,7 @@ files:
345
345
  - lib/1.9/gherkin_lexer_is.so
346
346
  - lib/1.9/gherkin_lexer_it.so
347
347
  - lib/1.9/gherkin_lexer_ja.so
348
+ - lib/1.9/gherkin_lexer_kn.so
348
349
  - lib/1.9/gherkin_lexer_ko.so
349
350
  - lib/1.9/gherkin_lexer_lt.so
350
351
  - lib/1.9/gherkin_lexer_lu.so
@@ -400,6 +401,7 @@ files:
400
401
  - lib/2.0/gherkin_lexer_is.so
401
402
  - lib/2.0/gherkin_lexer_it.so
402
403
  - lib/2.0/gherkin_lexer_ja.so
404
+ - lib/2.0/gherkin_lexer_kn.so
403
405
  - lib/2.0/gherkin_lexer_ko.so
404
406
  - lib/2.0/gherkin_lexer_lt.so
405
407
  - lib/2.0/gherkin_lexer_lu.so
@@ -448,7 +450,7 @@ rubyforge_project:
448
450
  rubygems_version: 2.0.3
449
451
  signing_key:
450
452
  specification_version: 4
451
- summary: gherkin-2.12.1
453
+ summary: gherkin-2.12.2
452
454
  test_files:
453
455
  - features/escaped_pipes.feature
454
456
  - features/feature_parser.feature