gherkin 2.9.3-x86-mswin32 → 2.10.0-x86-mswin32

Sign up to get free protection for your applications and to get access to all the features.
Files changed (110) hide show
  1. data/History.md +7 -0
  2. data/README.md +43 -39
  3. data/examples/parse_and_output_json.rb +1 -1
  4. data/gherkin.gemspec +8 -8
  5. data/install_mingw_os_x.sh +7 -0
  6. data/lib/1.8/gherkin_lexer_ar.so +0 -0
  7. data/lib/1.8/gherkin_lexer_bg.so +0 -0
  8. data/lib/1.8/gherkin_lexer_bm.so +0 -0
  9. data/lib/1.8/gherkin_lexer_ca.so +0 -0
  10. data/lib/1.8/gherkin_lexer_cs.so +0 -0
  11. data/lib/1.8/gherkin_lexer_cy_gb.so +0 -0
  12. data/lib/1.8/gherkin_lexer_da.so +0 -0
  13. data/lib/1.8/gherkin_lexer_de.so +0 -0
  14. data/lib/1.8/gherkin_lexer_en.so +0 -0
  15. data/lib/1.8/gherkin_lexer_en_au.so +0 -0
  16. data/lib/1.8/gherkin_lexer_en_lol.so +0 -0
  17. data/lib/1.8/gherkin_lexer_en_pirate.so +0 -0
  18. data/lib/1.8/gherkin_lexer_en_scouse.so +0 -0
  19. data/lib/1.8/gherkin_lexer_en_tx.so +0 -0
  20. data/lib/1.8/gherkin_lexer_eo.so +0 -0
  21. data/lib/1.8/gherkin_lexer_es.so +0 -0
  22. data/lib/1.8/gherkin_lexer_et.so +0 -0
  23. data/lib/1.8/gherkin_lexer_fi.so +0 -0
  24. data/lib/1.8/gherkin_lexer_fr.so +0 -0
  25. data/lib/1.8/gherkin_lexer_he.so +0 -0
  26. data/lib/1.8/gherkin_lexer_hr.so +0 -0
  27. data/lib/1.8/gherkin_lexer_hu.so +0 -0
  28. data/lib/1.8/gherkin_lexer_id.so +0 -0
  29. data/lib/1.8/gherkin_lexer_is.so +0 -0
  30. data/lib/1.8/gherkin_lexer_it.so +0 -0
  31. data/lib/1.8/gherkin_lexer_ja.so +0 -0
  32. data/lib/1.8/gherkin_lexer_ko.so +0 -0
  33. data/lib/1.8/gherkin_lexer_lt.so +0 -0
  34. data/lib/1.8/gherkin_lexer_lu.so +0 -0
  35. data/lib/1.8/gherkin_lexer_lv.so +0 -0
  36. data/lib/1.8/gherkin_lexer_nl.so +0 -0
  37. data/lib/1.8/gherkin_lexer_no.so +0 -0
  38. data/lib/1.8/gherkin_lexer_pl.so +0 -0
  39. data/lib/1.8/gherkin_lexer_pt.so +0 -0
  40. data/lib/1.8/gherkin_lexer_ro.so +0 -0
  41. data/lib/1.8/gherkin_lexer_ru.so +0 -0
  42. data/lib/1.8/gherkin_lexer_sk.so +0 -0
  43. data/lib/1.8/gherkin_lexer_sr_cyrl.so +0 -0
  44. data/lib/1.8/gherkin_lexer_sr_latn.so +0 -0
  45. data/lib/1.8/gherkin_lexer_sv.so +0 -0
  46. data/lib/1.8/gherkin_lexer_tr.so +0 -0
  47. data/lib/1.8/gherkin_lexer_uk.so +0 -0
  48. data/lib/1.8/gherkin_lexer_uz.so +0 -0
  49. data/lib/1.8/gherkin_lexer_vi.so +0 -0
  50. data/lib/1.8/gherkin_lexer_zh_cn.so +0 -0
  51. data/lib/1.8/gherkin_lexer_zh_tw.so +0 -0
  52. data/lib/1.9/gherkin_lexer_ar.so +0 -0
  53. data/lib/1.9/gherkin_lexer_bg.so +0 -0
  54. data/lib/1.9/gherkin_lexer_bm.so +0 -0
  55. data/lib/1.9/gherkin_lexer_ca.so +0 -0
  56. data/lib/1.9/gherkin_lexer_cs.so +0 -0
  57. data/lib/1.9/gherkin_lexer_cy_gb.so +0 -0
  58. data/lib/1.9/gherkin_lexer_da.so +0 -0
  59. data/lib/1.9/gherkin_lexer_de.so +0 -0
  60. data/lib/1.9/gherkin_lexer_en.so +0 -0
  61. data/lib/1.9/gherkin_lexer_en_au.so +0 -0
  62. data/lib/1.9/gherkin_lexer_en_lol.so +0 -0
  63. data/lib/1.9/gherkin_lexer_en_pirate.so +0 -0
  64. data/lib/1.9/gherkin_lexer_en_scouse.so +0 -0
  65. data/lib/1.9/gherkin_lexer_en_tx.so +0 -0
  66. data/lib/1.9/gherkin_lexer_eo.so +0 -0
  67. data/lib/1.9/gherkin_lexer_es.so +0 -0
  68. data/lib/1.9/gherkin_lexer_et.so +0 -0
  69. data/lib/1.9/gherkin_lexer_fi.so +0 -0
  70. data/lib/1.9/gherkin_lexer_fr.so +0 -0
  71. data/lib/1.9/gherkin_lexer_he.so +0 -0
  72. data/lib/1.9/gherkin_lexer_hr.so +0 -0
  73. data/lib/1.9/gherkin_lexer_hu.so +0 -0
  74. data/lib/1.9/gherkin_lexer_id.so +0 -0
  75. data/lib/1.9/gherkin_lexer_is.so +0 -0
  76. data/lib/1.9/gherkin_lexer_it.so +0 -0
  77. data/lib/1.9/gherkin_lexer_ja.so +0 -0
  78. data/lib/1.9/gherkin_lexer_ko.so +0 -0
  79. data/lib/1.9/gherkin_lexer_lt.so +0 -0
  80. data/lib/1.9/gherkin_lexer_lu.so +0 -0
  81. data/lib/1.9/gherkin_lexer_lv.so +0 -0
  82. data/lib/1.9/gherkin_lexer_nl.so +0 -0
  83. data/lib/1.9/gherkin_lexer_no.so +0 -0
  84. data/lib/1.9/gherkin_lexer_pl.so +0 -0
  85. data/lib/1.9/gherkin_lexer_pt.so +0 -0
  86. data/lib/1.9/gherkin_lexer_ro.so +0 -0
  87. data/lib/1.9/gherkin_lexer_ru.so +0 -0
  88. data/lib/1.9/gherkin_lexer_sk.so +0 -0
  89. data/lib/1.9/gherkin_lexer_sr_cyrl.so +0 -0
  90. data/lib/1.9/gherkin_lexer_sr_latn.so +0 -0
  91. data/lib/1.9/gherkin_lexer_sv.so +0 -0
  92. data/lib/1.9/gherkin_lexer_tr.so +0 -0
  93. data/lib/1.9/gherkin_lexer_uk.so +0 -0
  94. data/lib/1.9/gherkin_lexer_uz.so +0 -0
  95. data/lib/1.9/gherkin_lexer_vi.so +0 -0
  96. data/lib/1.9/gherkin_lexer_zh_cn.so +0 -0
  97. data/lib/1.9/gherkin_lexer_zh_tw.so +0 -0
  98. data/lib/gherkin/formatter/step_printer.rb +7 -3
  99. data/lib/gherkin/i18n.rb +2 -2
  100. data/lib/gherkin/i18n.yml +17 -4
  101. data/lib/gherkin/native/java.rb +1 -1
  102. data/spec/gherkin/fixtures/i18n_pt1.feature +44 -0
  103. data/spec/gherkin/fixtures/i18n_pt2.feature +4 -0
  104. data/spec/gherkin/fixtures/i18n_pt3.feature +4 -0
  105. data/spec/gherkin/fixtures/i18n_pt4.feature +4 -0
  106. data/spec/gherkin/formatter/pretty_formatter_spec.rb +19 -0
  107. data/spec/gherkin/i18n_spec.rb +75 -2
  108. data/spec/gherkin/json_parser_spec.rb +3 -3
  109. data/tasks/ragel_task.rb +1 -1
  110. metadata +21 -26
data/History.md CHANGED
@@ -1,3 +1,10 @@
1
+ ## [2.10.0](https://github.com/cucumber/gherkin/compare/v2.9.3...v2.10.0)
2
+
3
+ * [Core] Added Malay language support. ([#176](https://github.com/cucumber/gherkin/pull/176) Choon Siong)
4
+ * [JRuby] Fixed `I18n.language_table` so that `cucumber --i18n help` works again on JRuby. ([cucumber #272](https://github.com/cucumber/cucumber/issues/272) Aslak Hellesøy)
5
+ * [Java] Line numbers are Integer instead of int or Long (Aslak Hellesøy)
6
+ * [Java, Ruby] Fix for exception when an argument is missing. ([#171](https://github.com/cucumber/gherkin/pull/171) Matt Nathan, Aslak Hellesøy)
7
+
1
8
  ## [2.9.3](https://github.com/cucumber/gherkin/compare/v2.9.2...v2.9.3)
2
9
 
3
10
  * [Java] Fixed a bug in PrettyFormatter.setMonochrome(false) (Aslak Hellesøy)
data/README.md CHANGED
@@ -8,7 +8,7 @@ A fast lexer and parser for the Gherkin language based on Ragel. Gherkin is two
8
8
 
9
9
  Supported platforms:
10
10
 
11
- * [Ruby](https://rubygems.org/gems/gherkin) 1.8.6-1.9.3 (MRI, JRuby, REE, Rubinius)
11
+ * [Ruby](https://rubygems.org/gems/gherkin) 1.8.7-1.9.3 (MRI, JRuby, REE, Rubinius)
12
12
  * [Pure Java](http://search.maven.org/#search%7Cga%7C1%7Cgherkin) (jar file)
13
13
  * [JavaScript](http://search.npmjs.org/#/gherkin) (Tested with V8/node.js/Chrome, but might work on other JavaScript engines)
14
14
  * [.NET](http://nuget.org/List/Packages/gherkin) (dll file)
@@ -55,7 +55,7 @@ The jar file is in the central Maven repo.
55
55
  <dependency>
56
56
  <groupId>info.cukes</groupId>
57
57
  <artifactId>gherkin</artifactId>
58
- <version>2.9.3</version>
58
+ <version>2.10.0</version>
59
59
  </dependency>
60
60
 
61
61
  You can get it manually from [Maven Central](http://search.maven.org/#browse%7C-2073395818)
@@ -127,21 +127,15 @@ Now you can build the jar with:
127
127
 
128
128
  In order to build and test Gherkin for JavaScript you must install:
129
129
 
130
- * Node.js (0.4.6 or higher)
131
- * NPM (0.3.18 or higher)
130
+ * Node.js (0.6.17 or higher with npm)
132
131
  * Ragel with JavaScript support: http://github.com/dominicmarks/ragel-js
133
- ** Make sure you have `autoconf` and `automake` (`brew install automake && brew install autoconf`)
134
- ** Make sure you have the official ragel (`brew install ragel`)
135
- ** Make sure you have kelbt (`brew install kelbt`). If that fails, install manually from http://www.complang.org/kelbt/
136
- ** `cd ragel-js/ragel-svn && ./autogen.sh && ./configure --disable-manual`
132
+ * Make sure you have `autoconf` and `automake` (`brew install automake`)
133
+ * Make sure you have the official ragel (`brew install ragel`)
134
+ * Make sure you have kelbt (`brew install kelbt`). If that fails, install manually from http://www.complang.org/kelbt/
135
+ * `cd ragel-js/ragel-svn && ./autogen.sh && ./configure --disable-manual`
136
+ * `make && make install`
137
137
  * Define the GHERKIN_JS environment variable in your shell (any value will do)
138
138
 
139
- Prepare the environment:
140
-
141
- pushd js
142
- npm install
143
- popd
144
-
145
139
  Now you can build the JavaScript with:
146
140
 
147
141
  rake js
@@ -152,13 +146,15 @@ And you can try it out with node.js:
152
146
 
153
147
  If you're hacking and just want to rebuild the English parser:
154
148
 
155
- rake js/lib/gherkin/lexer/en.js
149
+ rake js/lib/gherkin/lexer/en.js
156
150
 
157
151
  TODO: Make all specs pass with js lexer - replace 'c(listener)' with 'js(listener)' in i18n.rb
158
152
 
159
153
  ### .NET dll
160
154
 
161
- You must install Mono SDK 2.10.8 or newer.
155
+ You must install Mono SDK 2.10.8. The OS X package installer is not recommended as it modifies your system PATH and makes Homebrew unhappy. Install with homebrew instead:
156
+
157
+ brew install ikvm/mono.rb
162
158
 
163
159
  You must also download NuGet.exe from [CodePlex](http://nuget.codeplex.com/releases) and place it in `/usr/local/nuget/NuGet.exe`. When it's installed, update it and register your NuGet API Key:
164
160
 
@@ -166,69 +162,77 @@ You must also download NuGet.exe from [CodePlex](http://nuget.codeplex.com/relea
166
162
  mono /usr/local/nuget/NuGet.exe Update -self
167
163
 
168
164
  # The key is at https://nuget.org/account
169
- mono /usr/local/nuget/NuGet.exe SetApiKey xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxx
165
+ mono --runtime=v4.0.30319 /usr/local/nuget/NuGet.exe SetApiKey xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxx
170
166
 
171
167
  Now you can build the .NET dll with:
172
168
 
169
+ mkdir release
173
170
  rake ikvm
171
+ rake release/nuspec/lib/gherkin.dll
174
172
 
175
- This should put the dll into `release/nuspec/lib/gherkin.dll`
173
+ This should build `release/nuspec/lib/gherkin.dll`
176
174
 
177
175
  ### MinGW Rubies (for Windows gems)
178
176
 
179
- In order to build Windows binaries (so we can release Windows gems from OS X/Linux) we first need to install MinGW.
180
- Follow the MinGW installation instructions from the [rake-compiler](https://github.com/luislavena/rake-compiler) project.
181
- IMPORTANT! You may have to get an older version - gcc 4.7.0 is experimental. See [this issue](https://github.com/luislavena/rake-compiler/issues/50)
177
+ In order to build Windows binaries (so we can release Windows gems from OS X/Linux) we first need to install MinGW:
182
178
 
183
- Now, make sure you have openssl installed:
179
+ ./install_mingw_os_x.sh
180
+
181
+ Now, make sure you have openssl installed - it's needed to build the rubies.
184
182
 
185
183
  brew install openssl
186
184
 
187
185
  Next, we're going to install Ruby 1.8.7 and Ruby 1.9.3 for MinGW. We need both versions so we can build Windows binaries for both.
188
186
  OS X Lion (or later) doesn't ship with an LLVM free gcc, which you will need in order to install ruby 1.8.7. We can install it with:
189
187
 
190
- brew install https://raw.github.com/adamv/homebrew-alt/master/duplicates/apple-gcc42.rb
191
- export CC=gcc-4.2
188
+ brew install https://raw.github.com/Homebrew/homebrew-dupes/master/apple-gcc42.rb
192
189
 
193
190
  For more info see:
194
191
 
195
192
  * http://stackoverflow.com/questions/6170813/why-cant-i-install-rails-on-lion-using-rvm
196
193
  * https://github.com/mxcl/homebrew/wiki/Custom-GCC-and-cross-compilers
197
194
 
198
- Now we need to set up [rake-compiler](http://github.com/luislavena/rake-compiler/)
199
- First, set the `CC` variable to your mingw32-gcc, for example:
200
-
201
- export CC=/usr/local/mingw/bin/i686-w64-mingw32-gcc
195
+ Now we're ready to install the Windows rubies:
202
196
 
203
- Now, let's install some rubies:
197
+ unset GHERKIN_JS
204
198
 
205
- # 1.8.7
206
- rvm install 1.8.7-p352
207
- rvm use 1.8.7-p352
199
+ # 1.9.3
200
+ rvm install 1.9.3-p194
201
+ rvm use 1.9.3-p194
208
202
  rvm gemset create cucumber
209
203
  rvm gemset use cucumber
210
204
  gem install bundler
211
- unset GHERKIN_JS
212
205
  bundle install
213
- rake-compiler cross-ruby VERSION=1.8.7-p352
206
+ PATH=/usr/local/mingw/bin:$PATH CC=/usr/local/mingw/bin/i686-w64-mingw32-gcc rake-compiler cross-ruby VERSION=1.9.3-p194
214
207
 
215
- # 1.9.3
216
- rvm install 1.9.3-p125
217
- rvm use 1.9.3-p125
208
+ # 1.8.7
209
+ CC=gcc-4.2 rvm install 1.8.7-p352
210
+ rvm use 1.8.7-p352
218
211
  rvm gemset create cucumber
219
212
  rvm gemset use cucumber
220
213
  gem install bundler
221
- unset GHERKIN_JS
222
214
  bundle install
223
- rake-compiler cross-ruby VERSION=1.9.3-p125
215
+ PATH=/usr/local/mingw/bin:$PATH CC=/usr/local/mingw/bin/i686-w64-mingw32-gcc rake-compiler cross-ruby VERSION=1.8.7-p352
224
216
 
225
217
  Now you can build Windows gems:
226
218
 
227
219
  rake compile
220
+ mkdir release
228
221
  rake gems:win
229
222
 
230
223
  ## Release process
231
224
 
225
+ Make sure you have access to all the servers where packages are being uploaded:
226
+
227
+ * npm registry: `npm login`
228
+ * rubygems.org: `gem push`
229
+ * cukes.info: `ssh cukes.info`
230
+ * sonatype: Check `~/.m2/settings.xml` and that you have gnupg (OS X users: Install [GPGTools](http://www.gpgtools.org/installer/index.html))
231
+ * Make sure you have a key [with no sub-key](https://docs.sonatype.org/display/Repository/How+To+Generate+PGP+Signatures+With+Maven)
232
+ * nuget: See .NET section above
233
+
234
+ Now we can release:
235
+
232
236
  * Make sure GHERKIN_JS is defined (see JavaScript section above)
233
237
  * Bump version in:
234
238
  * This file (Installation/Java section)
@@ -15,5 +15,5 @@ sources.each do |s|
15
15
  parser.parse(IO.read(path), path, 0)
16
16
  end
17
17
 
18
- formatter.close
18
+ formatter.done
19
19
  puts JSON.pretty_generate(JSON.parse(io.string))
data/gherkin.gemspec CHANGED
@@ -4,8 +4,8 @@ Gem::Specification.new do |s|
4
4
  s.name = "gherkin"
5
5
  # If the major version is bumped, verify that the change is ok:
6
6
  #
7
- # * Comment out cucumber dependency in gemspec
8
- # * Uncomment cucumber location in Gemfile
7
+ # * Comment out the cucumber dependency below
8
+ # * Uncomment the cucumber location in Gemfile
9
9
  # * Bump cucumber's gherkin dependency to the new version
10
10
  # * bundle update
11
11
  # * bundle exec rake
@@ -13,9 +13,9 @@ Gem::Specification.new do |s|
13
13
  # Repeat these step for cucumber (swap `cucumber` with `gherkin`).
14
14
  #
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
- # and release both projects.
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.9.3"
18
+ s.version = "2.10.0"
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}"
@@ -58,16 +58,16 @@ Gem::Specification.new do |s|
58
58
 
59
59
  s.add_runtime_dependency('json', '>= 1.4.6')
60
60
 
61
- s.add_development_dependency('cucumber', '>= 1.1.9')
61
+ s.add_development_dependency('cucumber', '>= 1.2.0')
62
62
  s.add_development_dependency('rake', '>= 0.9.2')
63
63
  s.add_development_dependency('bundler', '>= 1.1.0')
64
64
  s.add_development_dependency('rspec', '~> 2.9.0')
65
- s.add_development_dependency('rubyzip', '>= 0.9.6.1')
65
+ s.add_development_dependency('rubyzip', '>= 0.9.8')
66
66
 
67
67
  unless ENV['RUBY_CC_VERSION'] || defined?(JRUBY_VERSION)
68
- s.add_development_dependency('therubyracer', '>= 0.9.10') if ENV['GHERKIN_JS']
68
+ s.add_development_dependency('therubyracer', '>= 0.10.1') if ENV['GHERKIN_JS']
69
69
  # For Documentation:
70
- s.add_development_dependency('yard', '>= 0.7.5')
70
+ s.add_development_dependency('yard', '>= 0.8.0')
71
71
  s.add_development_dependency('rdiscount', '>= 1.6.8')
72
72
  end
73
73
 
@@ -0,0 +1,7 @@
1
+ #!/bin/sh
2
+
3
+ mkdir -p /usr/local/mingw
4
+ cd /usr/local/mingw
5
+ # Don't attempt any of the newer versions - they don't work (gcc 4.7.0)
6
+ wget http://downloads.sourceforge.net/project/mingw-w64/Toolchains%20targetting%20Win32/Automated%20Builds/mingw-w32-1.0-bin_i686-darwin_20110819.tar.bz2
7
+ tar xvfj mingw-w32-1.0-bin_i686-darwin_20110819.tar.bz2
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
@@ -6,9 +6,13 @@ module Gherkin
6
6
 
7
7
  text_start = 0
8
8
  arguments.each do |arg|
9
- io.write(text_format.text(unpacked_step_name[text_start..arg.offset-1].pack("U*"))) unless arg.offset == 0
10
- io.write(arg_format.text(arg.val))
11
- text_start = arg.offset + arg.val.unpack("U*").length
9
+ if(arg.offset != 0 && !arg.offset.nil?)
10
+ io.write(text_format.text(unpacked_step_name[text_start..arg.offset-1].pack("U*")))
11
+ end
12
+ if(!arg.val.nil?)
13
+ io.write(arg_format.text(arg.val))
14
+ text_start = arg.offset + arg.val.unpack("U*").length
15
+ end
12
16
  end
13
17
  io.write(text_format.text(unpacked_step_name[text_start..-1].pack("U*"))) unless text_start == unpacked_step_name.length
14
18
  end
data/lib/gherkin/i18n.rb CHANGED
@@ -59,9 +59,9 @@ module Gherkin
59
59
  require 'gherkin/formatter/pretty_formatter'
60
60
  require 'gherkin/formatter/model'
61
61
  io = StringIO.new
62
- pf = Gherkin::Formatter::PrettyFormatter.new(io, false, false)
62
+ pf = Gherkin::Formatter::PrettyFormatter.new(io, true, false)
63
63
  table = all.map do |i18n|
64
- Formatter::Model::Row.new([], [i18n.iso_code, i18n.keywords('name')[0], i18n.keywords('native')[0]], nil)
64
+ Formatter::Model::DataTableRow.new([], [i18n.iso_code, i18n.keywords('name')[0], i18n.keywords('native')[0]], nil)
65
65
  end
66
66
  pf.table(table)
67
67
  io.string
data/lib/gherkin/i18n.yml CHANGED
@@ -39,6 +39,19 @@
39
39
  then: "*|اذاً|ثم"
40
40
  and: "*|و"
41
41
  but: "*|لكن"
42
+ "bm":
43
+ name: Malay
44
+ native: Bahasa Melayu
45
+ feature: Fungsi
46
+ background: Latar Belakang
47
+ scenario: Senario
48
+ scenario_outline: Menggariskan Senario
49
+ examples: Contoh
50
+ given: "*|Bagi"
51
+ when: "*|Apabila"
52
+ then: "*|Kemudian"
53
+ and: "*|Dan"
54
+ but: "*|Tetapi"
42
55
  "bg":
43
56
  name: Bulgarian
44
57
  native: български
@@ -432,11 +445,11 @@
432
445
  "pt":
433
446
  name: Portuguese
434
447
  native: português
435
- background: Contexto
436
- feature: Funcionalidade
448
+ background: Contexto|Cenário de Fundo|Cenario de Fundo|Fundo
449
+ feature: Funcionalidade|Característica|Caracteristica
437
450
  scenario: Cenário|Cenario
438
- scenario_outline: Esquema do Cenário|Esquema do Cenario
439
- examples: Exemplos
451
+ scenario_outline: Esquema do Cenário|Esquema do Cenario|Delineação do Cenário|Delineacao do Cenario
452
+ examples: Exemplos|Cenários|Cenarios
440
453
  given: "*|Dado|Dada|Dados|Dadas"
441
454
  when: "*|Quando"
442
455
  then: "*|Então|Entao"
@@ -73,4 +73,4 @@ class Class
73
73
  end
74
74
  end
75
75
  end
76
- end
76
+ end
@@ -0,0 +1,44 @@
1
+ # language: pt
2
+ Funcionalidade: Reconhece "Funcionalidade"
3
+
4
+ Contexto: Reconhece "Contexto"
5
+
6
+ Cenário: Reconhece "Cenário" com acento
7
+
8
+ Cenario: Reconhece "Cenário" sem acento
9
+
10
+ Esquema do Cenário: Reconhece "Esquema do Cenário" com acento
11
+ Dado que <Valor> é um valor e que reconhece "Dado";
12
+ Dada a afirmação de que reconhece "Dada";
13
+ Dados os factos acima e ainda que reconhece "Dados";
14
+ Dadas as afirmações acima e ainda que reconhece "Dadas";
15
+ Quando reconhece "Quando";
16
+ Então também reconhece "Então" com acento e
17
+ Entao também reconhece "Então" sem acento;
18
+ E reconhece "E";
19
+ Mas também reconhece "Mas".
20
+
21
+ Exemplos: Reconhece "Exemplos"
22
+ | Valor |
23
+ | 1 |
24
+
25
+ Esquema do Cenario: Reconhece "Esquema do Cenário" sem acento
26
+ Dado que <Valor> é um valor;
27
+
28
+ Cenários: Reconhece "Cenários" com acento
29
+ | Valor |
30
+ | 1 |
31
+
32
+ Delineação do Cenário: Reconhece "Delineação do Cenário" com acento
33
+ Dado que <Valor> é um valor;
34
+
35
+ Cenarios: Reconhece "Cenários" sem acento
36
+ | Valor |
37
+ | 1 |
38
+
39
+ Delineacao do Cenario: Reconhece "Delineação do Cenário" sem acento
40
+ Dado que <Valor> é um valor;
41
+
42
+ Exemplos: Reconhece "Exemplos"
43
+ | Valor |
44
+ | 1 |
@@ -0,0 +1,4 @@
1
+ # language: pt
2
+ Característica: Reconhece "Característica" com acento
3
+
4
+ Cenário de Fundo: Reconhece "Cenário de Fundo" com acento
@@ -0,0 +1,4 @@
1
+ # language: pt
2
+ Caracteristica: Reconhece "Característica" sem acento
3
+
4
+ Cenario de Fundo: Reconhece "Cenário de Fundo" sem acento
@@ -0,0 +1,4 @@
1
+ # language: pt
2
+ Característica: Reconhece "Característica" com acento
3
+
4
+ Fundo: Reconhece "Fundo"
@@ -95,6 +95,25 @@ module Gherkin
95
95
  )
96
96
  end
97
97
 
98
+ # See https://github.com/cucumber/gherkin/pull/171
99
+ it "should highlight arguments when there are optional arguments" do
100
+ @f.uri("foo.feature")
101
+ @f.scenario(Model::Scenario.new([], [], "Scenario", "Lots of cukes", "", 3, "lots-of-cukes"))
102
+ @f.step(Model::Step.new([], "Given ", "I have 999 cukes in my belly", 3, nil, nil))
103
+ @f.match(Model::Match.new([
104
+ Gherkin::Formatter::Argument.new(nil, nil), # An optional argument
105
+ Gherkin::Formatter::Argument.new(7, '999')
106
+ ], nil))
107
+ @f.result(Model::Result.new('passed', 6, nil))
108
+
109
+ assert_io(
110
+ "\n" +
111
+ " Scenario: Lots of cukes \e[90m# foo.feature:3\e[0m\n" +
112
+ " #{executing}Given #{reset}#{executing}I have #{reset}#{executing_arg}999#{reset}#{executing} cukes in my belly#{reset}\n" +
113
+ "#{up(1)} #{passed}Given #{reset}#{passed}I have #{reset}#{passed_arg}999#{reset}#{passed} cukes in my belly#{reset}\n"
114
+ )
115
+ end
116
+
98
117
  it "should prettify scenario" do
99
118
  assert_pretty(%{Feature: Feature Description
100
119
  Some preamble
@@ -76,6 +76,80 @@ module Gherkin
76
76
  ]
77
77
  end
78
78
 
79
+ it "should recognize keywords in Portuguese (1st variant)" do
80
+ lexer = Gherkin::Lexer::I18nLexer.new(@listener, false)
81
+ scan_file(lexer, "i18n_pt1.feature")
82
+ @listener.to_sexp.should == [
83
+ [:comment, "# language: pt", 1],
84
+ [:feature, "Funcionalidade", "Reconhece \"Funcionalidade\"", "", 2],
85
+ [:background, "Contexto", "Reconhece \"Contexto\"", "", 4],
86
+ [:scenario, "Cenário", "Reconhece \"Cenário\" com acento", "", 6],
87
+ [:scenario, "Cenario", "Reconhece \"Cenário\" sem acento", "", 8],
88
+ [:scenario_outline, "Esquema do Cenário", "Reconhece \"Esquema do Cenário\" com acento", "", 10],
89
+ [:step, "Dado ", "que <Valor> é um valor e que reconhece \"Dado\";", 11],
90
+ [:step, "Dada ", "a afirmação de que reconhece \"Dada\";", 12],
91
+ [:step, "Dados ", "os factos acima e ainda que reconhece \"Dados\";", 13],
92
+ [:step, "Dadas ", "as afirmações acima e ainda que reconhece \"Dadas\";", 14],
93
+ [:step, "Quando ", "reconhece \"Quando\";", 15],
94
+ [:step, "Então ", "também reconhece \"Então\" com acento e", 16],
95
+ [:step, "Entao ", "também reconhece \"Então\" sem acento;", 17],
96
+ [:step, "E ", "reconhece \"E\";", 18],
97
+ [:step, "Mas ", "também reconhece \"Mas\".", 19],
98
+ [:examples, "Exemplos", "Reconhece \"Exemplos\"", "", 21],
99
+ [:row, ["Valor"], 22],
100
+ [:row, ["1"], 23],
101
+ [:scenario_outline, "Esquema do Cenario", "Reconhece \"Esquema do Cenário\" sem acento", "", 25],
102
+ [:step, "Dado ", "que <Valor> é um valor;", 26],
103
+ [:examples, "Cenários", "Reconhece \"Cenários\" com acento", "", 28],
104
+ [:row, ["Valor"], 29],
105
+ [:row, ["1"], 30],
106
+ [:scenario_outline, "Delineação do Cenário", "Reconhece \"Delineação do Cenário\" com acento", "", 32],
107
+ [:step, "Dado ", "que <Valor> é um valor;", 33],
108
+ [:examples, "Cenarios", "Reconhece \"Cenários\" sem acento", "", 35],
109
+ [:row, ["Valor"], 36],
110
+ [:row, ["1"], 37],
111
+ [:scenario_outline, "Delineacao do Cenario", "Reconhece \"Delineação do Cenário\" sem acento", "", 39],
112
+ [:step, "Dado ", "que <Valor> é um valor;", 40],
113
+ [:examples, "Exemplos", "Reconhece \"Exemplos\"", "", 42],
114
+ [:row, ["Valor"], 43],
115
+ [:row, ["1"], 44],
116
+ [:eof]
117
+ ]
118
+ end
119
+
120
+ it "should recognize keywords in Portuguese (2nd variant)" do
121
+ lexer = Gherkin::Lexer::I18nLexer.new(@listener, false)
122
+ scan_file(lexer, "i18n_pt2.feature")
123
+ @listener.to_sexp.should == [
124
+ [:comment, "# language: pt", 1],
125
+ [:feature, "Característica", "Reconhece \"Característica\" com acento", "", 2],
126
+ [:background, "Cenário de Fundo", "Reconhece \"Cenário de Fundo\" com acento", "", 4],
127
+ [:eof]
128
+ ]
129
+ end
130
+
131
+ it "should recognize keywords in Portuguese (3rd variant)" do
132
+ lexer = Gherkin::Lexer::I18nLexer.new(@listener, false)
133
+ scan_file(lexer, "i18n_pt3.feature")
134
+ @listener.to_sexp.should == [
135
+ [:comment, "# language: pt", 1],
136
+ [:feature, "Caracteristica", "Reconhece \"Característica\" sem acento", "", 2],
137
+ [:background, "Cenario de Fundo", "Reconhece \"Cenário de Fundo\" sem acento", "", 4],
138
+ [:eof]
139
+ ]
140
+ end
141
+
142
+ it "should recognize keywords in Portuguese (4th variant)" do
143
+ lexer = Gherkin::Lexer::I18nLexer.new(@listener, false)
144
+ scan_file(lexer, "i18n_pt4.feature")
145
+ @listener.to_sexp.should == [
146
+ [:comment, "# language: pt", 1],
147
+ [:feature, "Característica", "Reconhece \"Característica\" com acento", "", 2],
148
+ [:background, "Fundo", "Reconhece \"Fundo\"", "", 4],
149
+ [:eof]
150
+ ]
151
+ end
152
+
79
153
  describe 'keywords' do
80
154
  it "should have code keywords without space, comma, exclamation or apostrophe" do
81
155
  ['Avast', 'Akkor', 'Etantdonné', 'Lorsque', '假設'].each do |code_keyword|
@@ -91,11 +165,11 @@ module Gherkin
91
165
  Gherkin::I18n.keyword_regexp(:step).should =~ /\|Quando \|Quand \|Quan \|Pryd \|Pokud \|/
92
166
  end
93
167
 
94
- unless defined?(JRUBY_VERSION)
95
168
  it "should print available languages" do
96
169
  ("\n" + Gherkin::I18n.language_table).should == %{
97
170
  | ar | Arabic | العربية |
98
171
  | bg | Bulgarian | български |
172
+ | bm | Malay | Bahasa Melayu |
99
173
  | ca | Catalan | català |
100
174
  | cs | Czech | Česky |
101
175
  | cy-GB | Welsh | Cymraeg |
@@ -141,7 +215,6 @@ module Gherkin
141
215
  | zh-TW | Chinese traditional | 繁體中文 |
142
216
  }
143
217
  end
144
- end
145
218
 
146
219
  it "should print keywords for a given language" do
147
220
  ("\n" + Gherkin::I18n.get('fr').keyword_table).should == %{
@@ -29,7 +29,7 @@ module Gherkin
29
29
  end
30
30
  end
31
31
 
32
- xit "should parse a barely empty feature" do
32
+ it "should parse a barely empty feature" do
33
33
  check_json(%{[
34
34
  {
35
35
  "id": "one",
@@ -42,7 +42,7 @@ module Gherkin
42
42
  ]})
43
43
  end
44
44
 
45
- xit "should parse feature with tags and one scenario" do
45
+ it "should parse feature with tags and one scenario" do
46
46
  check_json(%{[
47
47
  {
48
48
  "id": "one",
@@ -131,7 +131,7 @@ module Gherkin
131
131
  })
132
132
  end
133
133
 
134
- xit "shoud parse a complex feature" do
134
+ it "shoud parse a complex feature" do
135
135
  check_json('[' + fixture("complex.json") + ']')
136
136
  end
137
137
  end
data/tasks/ragel_task.rb CHANGED
@@ -37,7 +37,7 @@ class RagelTask
37
37
  file UGLIFYJS do
38
38
  unless File.exist?(UGLIFYJS)
39
39
  Dir.chdir('js') do
40
- sh "npm link"
40
+ sh "npm install"
41
41
  end
42
42
  end
43
43
  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.9.3
4
+ version: 2.10.0
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-03-26 00:00:00.000000000 Z
14
+ date: 2012-05-07 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: json
@@ -36,7 +36,7 @@ dependencies:
36
36
  requirements:
37
37
  - - ! '>='
38
38
  - !ruby/object:Gem::Version
39
- version: 1.1.9
39
+ version: 1.2.0
40
40
  type: :development
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.1.9
47
+ version: 1.2.0
48
48
  - !ruby/object:Gem::Dependency
49
49
  name: rake
50
50
  requirement: !ruby/object:Gem::Requirement
@@ -100,7 +100,7 @@ dependencies:
100
100
  requirements:
101
101
  - - ! '>='
102
102
  - !ruby/object:Gem::Version
103
- version: 0.9.6.1
103
+ version: 0.9.8
104
104
  type: :development
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
@@ -108,23 +108,7 @@ dependencies:
108
108
  requirements:
109
109
  - - ! '>='
110
110
  - !ruby/object:Gem::Version
111
- version: 0.9.6.1
112
- - !ruby/object:Gem::Dependency
113
- name: therubyracer
114
- requirement: !ruby/object:Gem::Requirement
115
- none: false
116
- requirements:
117
- - - ! '>='
118
- - !ruby/object:Gem::Version
119
- version: 0.9.10
120
- type: :development
121
- prerelease: false
122
- version_requirements: !ruby/object:Gem::Requirement
123
- none: false
124
- requirements:
125
- - - ! '>='
126
- - !ruby/object:Gem::Version
127
- version: 0.9.10
111
+ version: 0.9.8
128
112
  - !ruby/object:Gem::Dependency
129
113
  name: yard
130
114
  requirement: !ruby/object:Gem::Requirement
@@ -132,7 +116,7 @@ dependencies:
132
116
  requirements:
133
117
  - - ! '>='
134
118
  - !ruby/object:Gem::Version
135
- version: 0.7.5
119
+ version: 0.8.0
136
120
  type: :development
137
121
  prerelease: false
138
122
  version_requirements: !ruby/object:Gem::Requirement
@@ -140,7 +124,7 @@ dependencies:
140
124
  requirements:
141
125
  - - ! '>='
142
126
  - !ruby/object:Gem::Version
143
- version: 0.7.5
127
+ version: 0.8.0
144
128
  - !ruby/object:Gem::Dependency
145
129
  name: rdiscount
146
130
  requirement: !ruby/object:Gem::Requirement
@@ -226,6 +210,7 @@ files:
226
210
  - features/steps_parser.feature
227
211
  - features/support/env.rb
228
212
  - gherkin.gemspec
213
+ - install_mingw_os_x.sh
229
214
  - js/.npmignore
230
215
  - js/lib/gherkin/lexer/.npmignore
231
216
  - lib/gherkin.rb
@@ -280,6 +265,10 @@ files:
280
265
  - spec/gherkin/fixtures/i18n_fr.feature
281
266
  - spec/gherkin/fixtures/i18n_fr2.feature
282
267
  - spec/gherkin/fixtures/i18n_no.feature
268
+ - spec/gherkin/fixtures/i18n_pt1.feature
269
+ - spec/gherkin/fixtures/i18n_pt2.feature
270
+ - spec/gherkin/fixtures/i18n_pt3.feature
271
+ - spec/gherkin/fixtures/i18n_pt4.feature
283
272
  - spec/gherkin/fixtures/i18n_zh-CN.feature
284
273
  - spec/gherkin/fixtures/issue_145.feature
285
274
  - spec/gherkin/fixtures/scenario_outline_with_tags.feature
@@ -332,6 +321,7 @@ files:
332
321
  - tasks/yard/default/layout/html/setup.rb
333
322
  - lib/1.8/gherkin_lexer_ar.so
334
323
  - lib/1.8/gherkin_lexer_bg.so
324
+ - lib/1.8/gherkin_lexer_bm.so
335
325
  - lib/1.8/gherkin_lexer_ca.so
336
326
  - lib/1.8/gherkin_lexer_cs.so
337
327
  - lib/1.8/gherkin_lexer_cy_gb.so
@@ -377,6 +367,7 @@ files:
377
367
  - lib/1.8/gherkin_lexer_zh_tw.so
378
368
  - lib/1.9/gherkin_lexer_ar.so
379
369
  - lib/1.9/gherkin_lexer_bg.so
370
+ - lib/1.9/gherkin_lexer_bm.so
380
371
  - lib/1.9/gherkin_lexer_ca.so
381
372
  - lib/1.9/gherkin_lexer_cs.so
382
373
  - lib/1.9/gherkin_lexer_cy_gb.so
@@ -441,10 +432,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
441
432
  version: '0'
442
433
  requirements: []
443
434
  rubyforge_project:
444
- rubygems_version: 1.8.19
435
+ rubygems_version: 1.8.24
445
436
  signing_key:
446
437
  specification_version: 3
447
- summary: gherkin-2.9.3
438
+ summary: gherkin-2.10.0
448
439
  test_files:
449
440
  - features/escaped_pipes.feature
450
441
  - features/feature_parser.feature
@@ -473,6 +464,10 @@ test_files:
473
464
  - spec/gherkin/fixtures/i18n_fr.feature
474
465
  - spec/gherkin/fixtures/i18n_fr2.feature
475
466
  - spec/gherkin/fixtures/i18n_no.feature
467
+ - spec/gherkin/fixtures/i18n_pt1.feature
468
+ - spec/gherkin/fixtures/i18n_pt2.feature
469
+ - spec/gherkin/fixtures/i18n_pt3.feature
470
+ - spec/gherkin/fixtures/i18n_pt4.feature
476
471
  - spec/gherkin/fixtures/i18n_zh-CN.feature
477
472
  - spec/gherkin/fixtures/issue_145.feature
478
473
  - spec/gherkin/fixtures/scenario_outline_with_tags.feature