gherkin 2.11.0-x86-mswin32 → 2.11.1-x86-mswin32

Sign up to get free protection for your applications and to get access to all the features.
Files changed (108) hide show
  1. data/History.md +5 -0
  2. data/README.md +14 -1
  3. data/gherkin.gemspec +1 -1
  4. data/lib/1.8/gherkin_lexer_ar.so +0 -0
  5. data/lib/1.8/gherkin_lexer_bg.so +0 -0
  6. data/lib/1.8/gherkin_lexer_bm.so +0 -0
  7. data/lib/1.8/gherkin_lexer_ca.so +0 -0
  8. data/lib/1.8/gherkin_lexer_cs.so +0 -0
  9. data/lib/1.8/gherkin_lexer_cy_gb.so +0 -0
  10. data/lib/1.8/gherkin_lexer_da.so +0 -0
  11. data/lib/1.8/gherkin_lexer_de.so +0 -0
  12. data/lib/1.8/gherkin_lexer_en.so +0 -0
  13. data/lib/1.8/gherkin_lexer_en_au.so +0 -0
  14. data/lib/1.8/gherkin_lexer_en_lol.so +0 -0
  15. data/lib/1.8/gherkin_lexer_en_pirate.so +0 -0
  16. data/lib/1.8/gherkin_lexer_en_scouse.so +0 -0
  17. data/lib/1.8/gherkin_lexer_en_tx.so +0 -0
  18. data/lib/1.8/gherkin_lexer_eo.so +0 -0
  19. data/lib/1.8/gherkin_lexer_es.so +0 -0
  20. data/lib/1.8/gherkin_lexer_et.so +0 -0
  21. data/lib/1.8/gherkin_lexer_fi.so +0 -0
  22. data/lib/1.8/gherkin_lexer_fr.so +0 -0
  23. data/lib/1.8/gherkin_lexer_he.so +0 -0
  24. data/lib/1.8/gherkin_lexer_hr.so +0 -0
  25. data/lib/1.8/gherkin_lexer_hu.so +0 -0
  26. data/lib/1.8/gherkin_lexer_id.so +0 -0
  27. data/lib/1.8/gherkin_lexer_is.so +0 -0
  28. data/lib/1.8/gherkin_lexer_it.so +0 -0
  29. data/lib/1.8/gherkin_lexer_ja.so +0 -0
  30. data/lib/1.8/gherkin_lexer_ko.so +0 -0
  31. data/lib/1.8/gherkin_lexer_lt.so +0 -0
  32. data/lib/1.8/gherkin_lexer_lu.so +0 -0
  33. data/lib/1.8/gherkin_lexer_lv.so +0 -0
  34. data/lib/1.8/gherkin_lexer_nl.so +0 -0
  35. data/lib/1.8/gherkin_lexer_no.so +0 -0
  36. data/lib/1.8/gherkin_lexer_pl.so +0 -0
  37. data/lib/1.8/gherkin_lexer_pt.so +0 -0
  38. data/lib/1.8/gherkin_lexer_ro.so +0 -0
  39. data/lib/1.8/gherkin_lexer_ru.so +0 -0
  40. data/lib/1.8/gherkin_lexer_sk.so +0 -0
  41. data/lib/1.8/gherkin_lexer_sr_cyrl.so +0 -0
  42. data/lib/1.8/gherkin_lexer_sr_latn.so +0 -0
  43. data/lib/1.8/gherkin_lexer_sv.so +0 -0
  44. data/lib/1.8/gherkin_lexer_tr.so +0 -0
  45. data/lib/1.8/gherkin_lexer_uk.so +0 -0
  46. data/lib/1.8/gherkin_lexer_uz.so +0 -0
  47. data/lib/1.8/gherkin_lexer_vi.so +0 -0
  48. data/lib/1.8/gherkin_lexer_zh_cn.so +0 -0
  49. data/lib/1.8/gherkin_lexer_zh_tw.so +0 -0
  50. data/lib/1.9/gherkin_lexer_ar.so +0 -0
  51. data/lib/1.9/gherkin_lexer_bg.so +0 -0
  52. data/lib/1.9/gherkin_lexer_bm.so +0 -0
  53. data/lib/1.9/gherkin_lexer_ca.so +0 -0
  54. data/lib/1.9/gherkin_lexer_cs.so +0 -0
  55. data/lib/1.9/gherkin_lexer_cy_gb.so +0 -0
  56. data/lib/1.9/gherkin_lexer_da.so +0 -0
  57. data/lib/1.9/gherkin_lexer_de.so +0 -0
  58. data/lib/1.9/gherkin_lexer_en.so +0 -0
  59. data/lib/1.9/gherkin_lexer_en_au.so +0 -0
  60. data/lib/1.9/gherkin_lexer_en_lol.so +0 -0
  61. data/lib/1.9/gherkin_lexer_en_pirate.so +0 -0
  62. data/lib/1.9/gherkin_lexer_en_scouse.so +0 -0
  63. data/lib/1.9/gherkin_lexer_en_tx.so +0 -0
  64. data/lib/1.9/gherkin_lexer_eo.so +0 -0
  65. data/lib/1.9/gherkin_lexer_es.so +0 -0
  66. data/lib/1.9/gherkin_lexer_et.so +0 -0
  67. data/lib/1.9/gherkin_lexer_fi.so +0 -0
  68. data/lib/1.9/gherkin_lexer_fr.so +0 -0
  69. data/lib/1.9/gherkin_lexer_he.so +0 -0
  70. data/lib/1.9/gherkin_lexer_hr.so +0 -0
  71. data/lib/1.9/gherkin_lexer_hu.so +0 -0
  72. data/lib/1.9/gherkin_lexer_id.so +0 -0
  73. data/lib/1.9/gherkin_lexer_is.so +0 -0
  74. data/lib/1.9/gherkin_lexer_it.so +0 -0
  75. data/lib/1.9/gherkin_lexer_ja.so +0 -0
  76. data/lib/1.9/gherkin_lexer_ko.so +0 -0
  77. data/lib/1.9/gherkin_lexer_lt.so +0 -0
  78. data/lib/1.9/gherkin_lexer_lu.so +0 -0
  79. data/lib/1.9/gherkin_lexer_lv.so +0 -0
  80. data/lib/1.9/gherkin_lexer_nl.so +0 -0
  81. data/lib/1.9/gherkin_lexer_no.so +0 -0
  82. data/lib/1.9/gherkin_lexer_pl.so +0 -0
  83. data/lib/1.9/gherkin_lexer_pt.so +0 -0
  84. data/lib/1.9/gherkin_lexer_ro.so +0 -0
  85. data/lib/1.9/gherkin_lexer_ru.so +0 -0
  86. data/lib/1.9/gherkin_lexer_sk.so +0 -0
  87. data/lib/1.9/gherkin_lexer_sr_cyrl.so +0 -0
  88. data/lib/1.9/gherkin_lexer_sr_latn.so +0 -0
  89. data/lib/1.9/gherkin_lexer_sv.so +0 -0
  90. data/lib/1.9/gherkin_lexer_tr.so +0 -0
  91. data/lib/1.9/gherkin_lexer_uk.so +0 -0
  92. data/lib/1.9/gherkin_lexer_uz.so +0 -0
  93. data/lib/1.9/gherkin_lexer_vi.so +0 -0
  94. data/lib/1.9/gherkin_lexer_zh_cn.so +0 -0
  95. data/lib/1.9/gherkin_lexer_zh_tw.so +0 -0
  96. data/lib/gherkin/formatter/json_formatter.rb +1 -1
  97. data/lib/gherkin/i18n.yml +2 -2
  98. data/lib/gherkin/js_lexer.rb +2 -2
  99. data/lib/gherkin/native.rb +4 -4
  100. data/lib/gherkin/native/java.rb +12 -16
  101. data/lib/gherkin/native/null.rb +1 -5
  102. data/lib/gherkin/native/therubyracer.rb +39 -0
  103. data/spec/gherkin/c_lexer_spec.rb +1 -1
  104. data/spec/gherkin/formatter/json_formatter_spec.rb +0 -1
  105. data/spec/gherkin/js_lexer_spec.rb +2 -2
  106. data/tasks/ragel_task.rb +3 -1
  107. metadata +4 -4
  108. data/lib/gherkin/native/ikvm.rb +0 -55
data/History.md CHANGED
@@ -1,3 +1,8 @@
1
+ ## [2.11.1](https://github.com/cucumber/gherkin/compare/v2.11.0...v2.11.1)
2
+
3
+ * [JavaScript] Native implementation of JSONFormatter (Aslak Hellesøy)
4
+ * [Core] Add more accurate polish translations. ([#181](https://github.com/cucumber/gherkin/pull/181) Adam Stankiewicz)
5
+
1
6
  ## [2.11.0](https://github.com/cucumber/gherkin/compare/v2.10.0...v2.11.0)
2
7
 
3
8
  * [Core] Alias Feature with Business Need and Ability. ([#167](https://github.com/cucumber/gherkin/issues/167) 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.11.0</version>
57
+ <version>2.11.1</version>
58
58
  </dependency>
59
59
 
60
60
  You can get it manually from [Maven Central](http://search.maven.org/#browse%7C-2073395818)
@@ -143,10 +143,19 @@ And you can try it out with node.js:
143
143
 
144
144
  node js/example/print.js spec/gherkin/fixtures/1.feature
145
145
 
146
+ Or the json formatter:
147
+
148
+ node js/example/json_fomratter_example.js
149
+
146
150
  If you're hacking and just want to rebuild the English parser:
147
151
 
148
152
  rake js/lib/gherkin/lexer/en.js
149
153
 
154
+ In order to test the native JavaScript implementation of JSONFormatter, you also need to define the `GHERKIN_JS_NATIVE` environment
155
+ variable. It's recommended you don't do this permanently, as it will disable testing the Ruby implementation. Try this instead:
156
+
157
+ GHERKIN_JS_NATIVE=true GHERKIN_JS=true bundle exec rake
158
+
150
159
  TODO: Make all specs pass with js lexer - replace 'c(listener)' with 'js(listener)' in i18n.rb
151
160
 
152
161
  ### .NET dll
@@ -230,6 +239,10 @@ Make sure you have access to all the servers where packages are being uploaded:
230
239
  * Make sure you have a key [with no sub-key](https://docs.sonatype.org/display/Repository/How+To+Generate+PGP+Signatures+With+Maven)
231
240
  * nuget: See .NET section above
232
241
 
242
+ Run tests once with GHERKIN_JS_NATIVE=true:
243
+
244
+ GHERKIN_JS_NATIVE=true GHERKIN_JS=true bundle exec rake
245
+
233
246
  Now we can release:
234
247
 
235
248
  * Make sure GHERKIN_JS is defined (see JavaScript section above)
data/gherkin.gemspec CHANGED
@@ -15,7 +15,7 @@ Gem::Specification.new do |s|
15
15
  # When both are building OK, do a `bundle exec rake install` in both cucumber and gherkin projects, revert the changes in the first 2 steps
16
16
  # and release both projects. Do this for both ruby 1.8.7, ruby 1.9.3 and jruby.
17
17
  #
18
- s.version = "2.11.0"
18
+ s.version = "2.11.1"
19
19
  s.authors = ["Mike Sassak", "Gregory Hnatiuk", "Aslak Hellesøy"]
20
20
  s.description = "A fast Gherkin lexer/parser based on the Ragel State Machine Compiler."
21
21
  s.summary = "#{s.name}-#{s.version}"
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
Binary file
Binary file
Binary file
Binary file
@@ -84,7 +84,7 @@ module Gherkin
84
84
  private
85
85
 
86
86
  def add_hook(match, result, hook)
87
- hooks = (feature_element[hook] ||= []);
87
+ hooks = feature_element[hook] ||= []
88
88
  hooks << {'match' => match.to_hash, 'result' => result.to_hash}
89
89
  end
90
90
 
data/lib/gherkin/i18n.yml CHANGED
@@ -432,13 +432,13 @@
432
432
  "pl":
433
433
  name: Polish
434
434
  native: polski
435
- feature: Właściwość
435
+ feature: Właściwość|Funkcja|Aspekt|Potrzeba biznesowa
436
436
  background: Założenia
437
437
  scenario: Scenariusz
438
438
  scenario_outline: Szablon scenariusza
439
439
  examples: Przykłady
440
440
  given: "*|Zakładając|Mając"
441
- when: "*|Jeżeli|Jeśli"
441
+ when: "*|Jeżeli|Jeśli|Gdy|Kiedy"
442
442
  then: "*|Wtedy"
443
443
  and: "*|Oraz|I"
444
444
  but: "*|Ale"
@@ -1,7 +1,7 @@
1
1
  require 'v8'
2
2
 
3
3
  module Gherkin
4
- # Thin adapter for the Javascript lexer, primarily used for testing.
4
+ # Thin adapter for the JavaScript lexer, primarily used for testing.
5
5
  class JsLexer
6
6
  def self.[](i18n_underscored_iso_code)
7
7
  cxt = V8::Context.new
@@ -17,4 +17,4 @@ module Gherkin
17
17
  cxt['exports']['Lexer']
18
18
  end
19
19
  end
20
- end
20
+ end
@@ -1,7 +1,7 @@
1
- if defined?(RUBY_ENGINE) && RUBY_ENGINE == "ironruby"
2
- require 'gherkin/native/ikvm'
3
- elsif defined?(JRUBY_VERSION)
1
+ if defined?(JRUBY_VERSION)
4
2
  require 'gherkin/native/java'
3
+ elsif ENV['GHERKIN_JS_NATIVE']
4
+ require 'gherkin/native/therubyracer'
5
5
  else
6
6
  require 'gherkin/native/null'
7
- end
7
+ end
@@ -17,10 +17,6 @@ class Class
17
17
  end
18
18
  end
19
19
 
20
- def implements(java_class_name)
21
- # no-op
22
- end
23
-
24
20
  # Causes a Java class to be instantiated instead of the Ruby class when
25
21
  # running on JRuby. This is used to test both pure Java and pure Ruby classes
26
22
  # from the same Ruby based test suite. The Java Class must have a package name
@@ -29,6 +25,18 @@ class Class
29
25
  require "#{lib}.jar"
30
26
 
31
27
  class << self
28
+ def new(*args)
29
+ begin
30
+ java_class.new(*javaify(args))
31
+ rescue ArgumentError => e
32
+ e.message << "\n#{java_class.name}"
33
+ raise e
34
+ rescue NameError => e
35
+ e.message << "\n args: #{args.inspect}"
36
+ raise e
37
+ end
38
+ end
39
+
32
40
  def javaify(arg)
33
41
  if Array === arg
34
42
  arg.map{|a| javaify(a)}
@@ -46,18 +54,6 @@ class Class
46
54
  end
47
55
  end
48
56
 
49
- def new(*args)
50
- begin
51
- java_class.new(*javaify(args))
52
- rescue ArgumentError => e
53
- e.message << "\n#{java_class.name}"
54
- raise e
55
- rescue NameError => e
56
- e.message << "\n args: #{args.inspect}"
57
- raise e
58
- end
59
- end
60
-
61
57
  def ===(object)
62
58
  super || object.java_kind_of?(java_class)
63
59
  end
@@ -1,9 +1,5 @@
1
1
  class Class
2
- def implements(java_class_name)
3
- # no-op
4
- end
5
-
6
2
  def native_impl(lib)
7
3
  # no-op
8
4
  end
9
- end
5
+ end
@@ -0,0 +1,39 @@
1
+ require 'v8'
2
+
3
+ class Class
4
+ def native_impl(lib)
5
+ class << self
6
+ def new(*args)
7
+ js = {
8
+ 'Gherkin::Formatter::JSONFormatter' => 'js/lib/gherkin/formatter/json_formatter.js'
9
+ }[self.name]
10
+ if(js)
11
+ Proxy.new(js, *args)
12
+ else
13
+ super(*args)
14
+ end
15
+ end
16
+ end
17
+ end
18
+
19
+ class Proxy
20
+ def initialize(js, *args)
21
+ cxt = V8::Context.new
22
+ cxt['module'] = {}
23
+
24
+ # Mimic Node.js / Firebug console.log
25
+ cxt['console'] = STDOUT
26
+ def STDOUT.log(*a)
27
+ puts sprintf(*a)
28
+ end
29
+
30
+ cxt.load(js)
31
+ @js_obj = cxt['module']['exports'].new(*args)
32
+ end
33
+
34
+ def method_missing(name, *args)
35
+ a = args.map{|a| a.respond_to?(:to_hash) ? a.to_hash : a}
36
+ @js_obj.__send__(name, *a)
37
+ end
38
+ end
39
+ end
@@ -1,5 +1,5 @@
1
1
  #encoding: utf-8
2
- unless defined?(JRUBY_VERSION) || (defined?(RUBY_ENGINE) && RUBY_ENGINE == "ironruby")
2
+ unless defined?(JRUBY_VERSION)
3
3
  require 'spec_helper'
4
4
  require 'gherkin_lexer_en'
5
5
 
@@ -85,7 +85,6 @@ module Gherkin
85
85
  }
86
86
  ]
87
87
  }
88
-
89
88
  JSON.parse(expected).should == JSON.parse(io.string)
90
89
  end
91
90
  end
@@ -1,11 +1,11 @@
1
1
  #encoding: utf-8
2
- if !defined?(JRUBY_VERSION) && !(defined?(RUBY_ENGINE) && RUBY_ENGINE == "ironruby") && ENV['GHERKIN_JS']
2
+ if !defined?(JRUBY_VERSION) && ENV['GHERKIN_JS']
3
3
  require 'spec_helper'
4
4
  require 'gherkin/js_lexer'
5
5
 
6
6
  module Gherkin
7
7
  module Lexer
8
- describe "Javascript Lexer" do
8
+ describe "JavaScript Lexer" do
9
9
  before do
10
10
  @listener = Gherkin::SexpRecorder.new
11
11
  @lexer = Gherkin::JsLexer['en'].new(@listener)
data/tasks/ragel_task.rb CHANGED
@@ -1,5 +1,6 @@
1
1
  require 'yaml'
2
2
  require 'erb'
3
+ require 'rbconfig'
3
4
 
4
5
  class RagelTask
5
6
  begin
@@ -27,7 +28,8 @@ class RagelTask
27
28
  sh "ragel #{flags} #{lang_ragel} -o #{target}"
28
29
  if(@lang == 'js')
29
30
  # Ragel chokes if we put the escaped triple quotes in .rl, so we'll do the replace with sed after the fact. Lots of backslashes!!
30
- sh %{sed -i '' 's/ESCAPED_TRIPLE_QUOTE/\\\\\\\\\\\\"\\\\\\\\\\\\"\\\\\\\\\\\\"/' #{target}}
31
+ sed = Config::CONFIG['host_os'] =~ /linux/i ? "sed -i" : "sed -i ''"
32
+ sh %{#{sed} 's/ESCAPED_TRIPLE_QUOTE/\\\\\\\\\\\\"\\\\\\\\\\\\"\\\\\\\\\\\\"/' #{target}}
31
33
 
32
34
  # Minify
33
35
  sh %{node #{UGLIFYJS} #{target} > #{target.gsub(/\.js$/, '.min.js')}}
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.0
4
+ version: 2.11.1
5
5
  prerelease:
6
6
  platform: x86-mswin32
7
7
  authors:
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2012-06-08 00:00:00.000000000 Z
14
+ date: 2012-06-23 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: json
@@ -252,9 +252,9 @@ files:
252
252
  - lib/gherkin/listener/event.rb
253
253
  - lib/gherkin/listener/formatter_listener.rb
254
254
  - lib/gherkin/native.rb
255
- - lib/gherkin/native/ikvm.rb
256
255
  - lib/gherkin/native/java.rb
257
256
  - lib/gherkin/native/null.rb
257
+ - lib/gherkin/native/therubyracer.rb
258
258
  - lib/gherkin/parser/meta.txt
259
259
  - lib/gherkin/parser/parser.rb
260
260
  - lib/gherkin/parser/root.txt
@@ -451,7 +451,7 @@ rubyforge_project:
451
451
  rubygems_version: 1.8.24
452
452
  signing_key:
453
453
  specification_version: 3
454
- summary: gherkin-2.11.0
454
+ summary: gherkin-2.11.1
455
455
  test_files:
456
456
  - features/escaped_pipes.feature
457
457
  - features/feature_parser.feature
@@ -1,55 +0,0 @@
1
- class Class
2
-
3
- def implements(java_class_name)
4
- m = java_class_name.split('.').inject(Object) do |mod, name|
5
- mod = mod.const_get(name)
6
- end
7
- include m
8
- end
9
-
10
- # Causes a .NET class to be instantiated instead of the Ruby class when
11
- # running on IronRuby. This is used to test both pure .NET and pure Ruby classes
12
- # from the same Ruby based test suite. The .NET Class must have a package name
13
- # that corresponds with the Ruby class.
14
- def native_impl(lib)
15
- begin
16
- load_assembly(lib)
17
- rescue LoadError => e
18
- e.message << "\nTry this: SET MONO_PATH=#{File.expand_path(File.dirname(__FILE__) + '/../..')} (or export MONO_PATH=...)"
19
- raise e
20
- end
21
-
22
- class << self
23
- def ikvmify(arg)
24
- if Array === arg
25
- arg.map{|a| ikvmify(a)}
26
- else
27
- case(arg)
28
- when Regexp
29
- Object.const_get('java').const_get('util').const_get('regex').const_get('Pattern').compile(arg.source)
30
- else
31
- arg
32
- end
33
- end
34
- end
35
-
36
- def new(*args)
37
- ikvm_class.new(*ikvmify(args))
38
- end
39
-
40
- def ===(object)
41
- super || object.java_kind_of?(java_class)
42
- end
43
-
44
- def ikvm_class
45
- names = self.name.split('::')
46
- namespace = Object
47
- names[0..-2].each do |module_name|
48
- namespace = namespace.const_get(module_name.downcase)
49
- end
50
-
51
- namespace.const_get(names[-1])
52
- end
53
- end
54
- end
55
- end