gherkin 2.12.2 → 3.2.0

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.
Files changed (333) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +2 -15
  3. data/CONTRIBUTING.md +23 -0
  4. data/Gemfile +0 -3
  5. data/LICENSE +18 -17
  6. data/Makefile +65 -0
  7. data/README.md +9 -268
  8. data/Rakefile +17 -19
  9. data/bin/gherkin-generate-ast +21 -0
  10. data/bin/gherkin-generate-pickles +25 -0
  11. data/bin/gherkin-generate-tokens +12 -0
  12. data/gherkin-ruby.razor +218 -0
  13. data/gherkin.gemspec +22 -76
  14. data/lib/gherkin/ast_builder.rb +243 -0
  15. data/lib/gherkin/ast_node.rb +30 -0
  16. data/lib/gherkin/dialect.rb +58 -0
  17. data/lib/gherkin/errors.rb +45 -0
  18. data/lib/gherkin/gherkin-languages.json +2968 -0
  19. data/lib/gherkin/gherkin_line.rb +95 -0
  20. data/lib/gherkin/parser.rb +1910 -0
  21. data/lib/gherkin/pickles/compiler.rb +164 -0
  22. data/lib/gherkin/token.rb +18 -0
  23. data/lib/gherkin/token_formatter_builder.rb +39 -0
  24. data/lib/gherkin/token_matcher.rb +169 -0
  25. data/lib/gherkin/token_scanner.rb +40 -0
  26. data/spec/capture_warnings.rb +68 -0
  27. data/spec/coverage.rb +10 -0
  28. data/spec/gherkin/parser_spec.rb +146 -0
  29. metadata +60 -567
  30. data/.gitattributes +0 -2
  31. data/.mailmap +0 -2
  32. data/.rbenv-gemsets +0 -1
  33. data/.rspec +0 -1
  34. data/.ruby-gemset +0 -1
  35. data/.ruby-version +0 -1
  36. data/.yardopts +0 -5
  37. data/History.md +0 -881
  38. data/build_native_gems.sh +0 -7
  39. data/cucumber.yml +0 -5
  40. data/examples/parse_and_output_json.rb +0 -19
  41. data/ext/gherkin_lexer_ar/extconf.rb +0 -6
  42. data/ext/gherkin_lexer_ar/gherkin_lexer_ar.c +0 -1432
  43. data/ext/gherkin_lexer_bg/extconf.rb +0 -6
  44. data/ext/gherkin_lexer_bg/gherkin_lexer_bg.c +0 -1655
  45. data/ext/gherkin_lexer_bm/extconf.rb +0 -6
  46. data/ext/gherkin_lexer_bm/gherkin_lexer_bm.c +0 -1516
  47. data/ext/gherkin_lexer_ca/extconf.rb +0 -6
  48. data/ext/gherkin_lexer_ca/gherkin_lexer_ca.c +0 -1581
  49. data/ext/gherkin_lexer_cs/extconf.rb +0 -6
  50. data/ext/gherkin_lexer_cs/gherkin_lexer_cs.c +0 -1515
  51. data/ext/gherkin_lexer_cy_gb/extconf.rb +0 -6
  52. data/ext/gherkin_lexer_cy_gb/gherkin_lexer_cy_gb.c +0 -1282
  53. data/ext/gherkin_lexer_da/extconf.rb +0 -6
  54. data/ext/gherkin_lexer_da/gherkin_lexer_da.c +0 -1298
  55. data/ext/gherkin_lexer_de/extconf.rb +0 -6
  56. data/ext/gherkin_lexer_de/gherkin_lexer_de.c +0 -1425
  57. data/ext/gherkin_lexer_el/extconf.rb +0 -6
  58. data/ext/gherkin_lexer_el/gherkin_lexer_el.c +0 -1919
  59. data/ext/gherkin_lexer_en/extconf.rb +0 -6
  60. data/ext/gherkin_lexer_en/gherkin_lexer_en.c +0 -1418
  61. data/ext/gherkin_lexer_en_au/extconf.rb +0 -6
  62. data/ext/gherkin_lexer_en_au/gherkin_lexer_en_au.c +0 -1765
  63. data/ext/gherkin_lexer_en_lol/extconf.rb +0 -6
  64. data/ext/gherkin_lexer_en_lol/gherkin_lexer_en_lol.c +0 -1177
  65. data/ext/gherkin_lexer_en_old/extconf.rb +0 -6
  66. data/ext/gherkin_lexer_en_old/gherkin_lexer_en_old.c +0 -1309
  67. data/ext/gherkin_lexer_en_pirate/extconf.rb +0 -6
  68. data/ext/gherkin_lexer_en_pirate/gherkin_lexer_en_pirate.c +0 -1471
  69. data/ext/gherkin_lexer_en_scouse/extconf.rb +0 -6
  70. data/ext/gherkin_lexer_en_scouse/gherkin_lexer_en_scouse.c +0 -1634
  71. data/ext/gherkin_lexer_en_tx/extconf.rb +0 -6
  72. data/ext/gherkin_lexer_en_tx/gherkin_lexer_en_tx.c +0 -1265
  73. data/ext/gherkin_lexer_eo/extconf.rb +0 -6
  74. data/ext/gherkin_lexer_eo/gherkin_lexer_eo.c +0 -1241
  75. data/ext/gherkin_lexer_es/extconf.rb +0 -6
  76. data/ext/gherkin_lexer_es/gherkin_lexer_es.c +0 -1399
  77. data/ext/gherkin_lexer_et/extconf.rb +0 -6
  78. data/ext/gherkin_lexer_et/gherkin_lexer_et.c +0 -1236
  79. data/ext/gherkin_lexer_fa/extconf.rb +0 -6
  80. data/ext/gherkin_lexer_fa/gherkin_lexer_fa.c +0 -1475
  81. data/ext/gherkin_lexer_fi/extconf.rb +0 -6
  82. data/ext/gherkin_lexer_fi/gherkin_lexer_fi.c +0 -1215
  83. data/ext/gherkin_lexer_fr/extconf.rb +0 -6
  84. data/ext/gherkin_lexer_fr/gherkin_lexer_fr.c +0 -1493
  85. data/ext/gherkin_lexer_gl/extconf.rb +0 -6
  86. data/ext/gherkin_lexer_gl/gherkin_lexer_gl.c +0 -1374
  87. data/ext/gherkin_lexer_he/extconf.rb +0 -6
  88. data/ext/gherkin_lexer_he/gherkin_lexer_he.c +0 -1374
  89. data/ext/gherkin_lexer_hi/extconf.rb +0 -6
  90. data/ext/gherkin_lexer_hi/gherkin_lexer_hi.c +0 -1848
  91. data/ext/gherkin_lexer_hr/extconf.rb +0 -6
  92. data/ext/gherkin_lexer_hr/gherkin_lexer_hr.c +0 -1323
  93. data/ext/gherkin_lexer_hu/extconf.rb +0 -6
  94. data/ext/gherkin_lexer_hu/gherkin_lexer_hu.c +0 -1376
  95. data/ext/gherkin_lexer_id/extconf.rb +0 -6
  96. data/ext/gherkin_lexer_id/gherkin_lexer_id.c +0 -1208
  97. data/ext/gherkin_lexer_is/extconf.rb +0 -6
  98. data/ext/gherkin_lexer_is/gherkin_lexer_is.c +0 -1376
  99. data/ext/gherkin_lexer_it/extconf.rb +0 -6
  100. data/ext/gherkin_lexer_it/gherkin_lexer_it.c +0 -1340
  101. data/ext/gherkin_lexer_ja/extconf.rb +0 -6
  102. data/ext/gherkin_lexer_ja/gherkin_lexer_ja.c +0 -1699
  103. data/ext/gherkin_lexer_kn/extconf.rb +0 -6
  104. data/ext/gherkin_lexer_kn/gherkin_lexer_kn.c +0 -1965
  105. data/ext/gherkin_lexer_ko/extconf.rb +0 -6
  106. data/ext/gherkin_lexer_ko/gherkin_lexer_ko.c +0 -1360
  107. data/ext/gherkin_lexer_lt/extconf.rb +0 -6
  108. data/ext/gherkin_lexer_lt/gherkin_lexer_lt.c +0 -1296
  109. data/ext/gherkin_lexer_lu/extconf.rb +0 -6
  110. data/ext/gherkin_lexer_lu/gherkin_lexer_lu.c +0 -1389
  111. data/ext/gherkin_lexer_lv/extconf.rb +0 -6
  112. data/ext/gherkin_lexer_lv/gherkin_lexer_lv.c +0 -1425
  113. data/ext/gherkin_lexer_nl/extconf.rb +0 -6
  114. data/ext/gherkin_lexer_nl/gherkin_lexer_nl.c +0 -1368
  115. data/ext/gherkin_lexer_no/extconf.rb +0 -6
  116. data/ext/gherkin_lexer_no/gherkin_lexer_no.c +0 -1311
  117. data/ext/gherkin_lexer_pa/extconf.rb +0 -6
  118. data/ext/gherkin_lexer_pa/gherkin_lexer_pa.c +0 -2160
  119. data/ext/gherkin_lexer_pl/extconf.rb +0 -6
  120. data/ext/gherkin_lexer_pl/gherkin_lexer_pl.c +0 -1738
  121. data/ext/gherkin_lexer_pt/extconf.rb +0 -6
  122. data/ext/gherkin_lexer_pt/gherkin_lexer_pt.c +0 -1711
  123. data/ext/gherkin_lexer_ro/extconf.rb +0 -6
  124. data/ext/gherkin_lexer_ro/gherkin_lexer_ro.c +0 -1427
  125. data/ext/gherkin_lexer_ru/extconf.rb +0 -6
  126. data/ext/gherkin_lexer_ru/gherkin_lexer_ru.c +0 -2071
  127. data/ext/gherkin_lexer_sk/extconf.rb +0 -6
  128. data/ext/gherkin_lexer_sk/gherkin_lexer_sk.c +0 -1739
  129. data/ext/gherkin_lexer_sr_cyrl/extconf.rb +0 -6
  130. data/ext/gherkin_lexer_sr_cyrl/gherkin_lexer_sr_cyrl.c +0 -2112
  131. data/ext/gherkin_lexer_sr_latn/extconf.rb +0 -6
  132. data/ext/gherkin_lexer_sr_latn/gherkin_lexer_sr_latn.c +0 -1567
  133. data/ext/gherkin_lexer_sv/extconf.rb +0 -6
  134. data/ext/gherkin_lexer_sv/gherkin_lexer_sv.c +0 -1324
  135. data/ext/gherkin_lexer_th/extconf.rb +0 -6
  136. data/ext/gherkin_lexer_th/gherkin_lexer_th.c +0 -2840
  137. data/ext/gherkin_lexer_tl/extconf.rb +0 -6
  138. data/ext/gherkin_lexer_tl/gherkin_lexer_tl.c +0 -2021
  139. data/ext/gherkin_lexer_tr/extconf.rb +0 -6
  140. data/ext/gherkin_lexer_tr/gherkin_lexer_tr.c +0 -1347
  141. data/ext/gherkin_lexer_tt/extconf.rb +0 -6
  142. data/ext/gherkin_lexer_tt/gherkin_lexer_tt.c +0 -1936
  143. data/ext/gherkin_lexer_uk/extconf.rb +0 -6
  144. data/ext/gherkin_lexer_uk/gherkin_lexer_uk.c +0 -1941
  145. data/ext/gherkin_lexer_uz/extconf.rb +0 -6
  146. data/ext/gherkin_lexer_uz/gherkin_lexer_uz.c +0 -1651
  147. data/ext/gherkin_lexer_vi/extconf.rb +0 -6
  148. data/ext/gherkin_lexer_vi/gherkin_lexer_vi.c +0 -1458
  149. data/ext/gherkin_lexer_zh_cn/extconf.rb +0 -6
  150. data/ext/gherkin_lexer_zh_cn/gherkin_lexer_zh_cn.c +0 -1314
  151. data/ext/gherkin_lexer_zh_tw/extconf.rb +0 -6
  152. data/ext/gherkin_lexer_zh_tw/gherkin_lexer_zh_tw.c +0 -1307
  153. data/features/.cucumber/stepdefs.json +0 -244
  154. data/features/escaped_pipes.feature +0 -8
  155. data/features/feature_parser.feature +0 -237
  156. data/features/json_formatter.feature +0 -498
  157. data/features/json_parser.feature +0 -331
  158. data/features/native_lexer.feature +0 -19
  159. data/features/parser_with_native_lexer.feature +0 -205
  160. data/features/pretty_formatter.feature +0 -17
  161. data/features/step_definitions/eyeball_steps.rb +0 -3
  162. data/features/step_definitions/gherkin_steps.rb +0 -29
  163. data/features/step_definitions/json_formatter_steps.rb +0 -30
  164. data/features/step_definitions/json_parser_steps.rb +0 -21
  165. data/features/step_definitions/pretty_formatter_steps.rb +0 -85
  166. data/features/steps_parser.feature +0 -46
  167. data/features/support/env.rb +0 -41
  168. data/install_mingw_os_x.sh +0 -5
  169. data/js/.npmignore +0 -1
  170. data/js/lib/gherkin/lexer/.npmignore +0 -0
  171. data/lib/gherkin.rb +0 -2
  172. data/lib/gherkin/README.md +0 -7
  173. data/lib/gherkin/c_lexer.rb +0 -17
  174. data/lib/gherkin/formatter/ansi_escapes.rb +0 -97
  175. data/lib/gherkin/formatter/argument.rb +0 -16
  176. data/lib/gherkin/formatter/escaping.rb +0 -15
  177. data/lib/gherkin/formatter/filter_formatter.rb +0 -150
  178. data/lib/gherkin/formatter/hashable.rb +0 -25
  179. data/lib/gherkin/formatter/json_formatter.rb +0 -133
  180. data/lib/gherkin/formatter/line_filter.rb +0 -26
  181. data/lib/gherkin/formatter/model.rb +0 -281
  182. data/lib/gherkin/formatter/pretty_formatter.rb +0 -245
  183. data/lib/gherkin/formatter/regexp_filter.rb +0 -21
  184. data/lib/gherkin/formatter/step_printer.rb +0 -21
  185. data/lib/gherkin/formatter/tag_count_formatter.rb +0 -47
  186. data/lib/gherkin/formatter/tag_filter.rb +0 -19
  187. data/lib/gherkin/i18n.json +0 -786
  188. data/lib/gherkin/i18n.rb +0 -176
  189. data/lib/gherkin/json_parser.rb +0 -177
  190. data/lib/gherkin/lexer/ar.rb +0 -1170
  191. data/lib/gherkin/lexer/bg.rb +0 -1382
  192. data/lib/gherkin/lexer/bm.rb +0 -1250
  193. data/lib/gherkin/lexer/ca.rb +0 -1310
  194. data/lib/gherkin/lexer/cs.rb +0 -1246
  195. data/lib/gherkin/lexer/cy_gb.rb +0 -1032
  196. data/lib/gherkin/lexer/da.rb +0 -1048
  197. data/lib/gherkin/lexer/de.rb +0 -1166
  198. data/lib/gherkin/lexer/el.rb +0 -1628
  199. data/lib/gherkin/lexer/en.rb +0 -1156
  200. data/lib/gherkin/lexer/en_au.rb +0 -1486
  201. data/lib/gherkin/lexer/en_lol.rb +0 -934
  202. data/lib/gherkin/lexer/en_old.rb +0 -1037
  203. data/lib/gherkin/lexer/en_pirate.rb +0 -1210
  204. data/lib/gherkin/lexer/en_scouse.rb +0 -1362
  205. data/lib/gherkin/lexer/en_tx.rb +0 -1016
  206. data/lib/gherkin/lexer/encoding.rb +0 -41
  207. data/lib/gherkin/lexer/eo.rb +0 -995
  208. data/lib/gherkin/lexer/es.rb +0 -1140
  209. data/lib/gherkin/lexer/et.rb +0 -990
  210. data/lib/gherkin/lexer/fa.rb +0 -1214
  211. data/lib/gherkin/lexer/fi.rb +0 -969
  212. data/lib/gherkin/lexer/fr.rb +0 -1228
  213. data/lib/gherkin/lexer/gl.rb +0 -1117
  214. data/lib/gherkin/lexer/he.rb +0 -1118
  215. data/lib/gherkin/lexer/hi.rb +0 -1559
  216. data/lib/gherkin/lexer/hr.rb +0 -1066
  217. data/lib/gherkin/lexer/hu.rb +0 -1118
  218. data/lib/gherkin/lexer/i18n_lexer.rb +0 -48
  219. data/lib/gherkin/lexer/id.rb +0 -963
  220. data/lib/gherkin/lexer/is.rb +0 -1120
  221. data/lib/gherkin/lexer/it.rb +0 -1086
  222. data/lib/gherkin/lexer/ja.rb +0 -1418
  223. data/lib/gherkin/lexer/kn.rb +0 -1672
  224. data/lib/gherkin/lexer/ko.rb +0 -1102
  225. data/lib/gherkin/lexer/lt.rb +0 -1045
  226. data/lib/gherkin/lexer/lu.rb +0 -1132
  227. data/lib/gherkin/lexer/lv.rb +0 -1166
  228. data/lib/gherkin/lexer/nl.rb +0 -1115
  229. data/lib/gherkin/lexer/no.rb +0 -1060
  230. data/lib/gherkin/lexer/pa.rb +0 -1852
  231. data/lib/gherkin/lexer/pl.rb +0 -1457
  232. data/lib/gherkin/lexer/pt.rb +0 -1430
  233. data/lib/gherkin/lexer/ro.rb +0 -1164
  234. data/lib/gherkin/lexer/ru.rb +0 -1766
  235. data/lib/gherkin/lexer/sk.rb +0 -1452
  236. data/lib/gherkin/lexer/sr_cyrl.rb +0 -1803
  237. data/lib/gherkin/lexer/sr_latn.rb +0 -1294
  238. data/lib/gherkin/lexer/sv.rb +0 -1070
  239. data/lib/gherkin/lexer/th.rb +0 -2492
  240. data/lib/gherkin/lexer/tl.rb +0 -1726
  241. data/lib/gherkin/lexer/tr.rb +0 -1092
  242. data/lib/gherkin/lexer/tt.rb +0 -1643
  243. data/lib/gherkin/lexer/uk.rb +0 -1646
  244. data/lib/gherkin/lexer/uz.rb +0 -1376
  245. data/lib/gherkin/lexer/vi.rb +0 -1198
  246. data/lib/gherkin/lexer/zh_cn.rb +0 -1058
  247. data/lib/gherkin/lexer/zh_tw.rb +0 -1052
  248. data/lib/gherkin/listener/event.rb +0 -45
  249. data/lib/gherkin/listener/formatter_listener.rb +0 -150
  250. data/lib/gherkin/native.rb +0 -7
  251. data/lib/gherkin/native/java.rb +0 -72
  252. data/lib/gherkin/native/null.rb +0 -5
  253. data/lib/gherkin/native/therubyracer.rb +0 -41
  254. data/lib/gherkin/parser/meta.txt +0 -5
  255. data/lib/gherkin/parser/parser.rb +0 -166
  256. data/lib/gherkin/parser/root.txt +0 -11
  257. data/lib/gherkin/parser/steps.txt +0 -4
  258. data/lib/gherkin/platform.rb +0 -13
  259. data/lib/gherkin/rubify.rb +0 -31
  260. data/lib/gherkin/tag_expression.rb +0 -63
  261. data/ragel/lexer.c.rl.erb +0 -454
  262. data/ragel/lexer.java.rl.erb +0 -219
  263. data/ragel/lexer.js.rl.erb +0 -322
  264. data/ragel/lexer.rb.rl.erb +0 -179
  265. data/ragel/lexer_common.rl.erb +0 -50
  266. data/spec/gherkin/c_lexer_spec.rb +0 -22
  267. data/spec/gherkin/fixtures/1.feature +0 -8
  268. data/spec/gherkin/fixtures/comments_in_table.feature +0 -9
  269. data/spec/gherkin/fixtures/complex.feature +0 -45
  270. data/spec/gherkin/fixtures/complex.json +0 -139
  271. data/spec/gherkin/fixtures/complex_for_filtering.feature +0 -60
  272. data/spec/gherkin/fixtures/complex_with_tags.feature +0 -61
  273. data/spec/gherkin/fixtures/dos_line_endings.feature +0 -45
  274. data/spec/gherkin/fixtures/examples_with_only_header.feature +0 -14
  275. data/spec/gherkin/fixtures/hantu_pisang.feature +0 -35
  276. data/spec/gherkin/fixtures/i18n_fr.feature +0 -14
  277. data/spec/gherkin/fixtures/i18n_fr2.feature +0 -8
  278. data/spec/gherkin/fixtures/i18n_no.feature +0 -7
  279. data/spec/gherkin/fixtures/i18n_pt1.feature +0 -44
  280. data/spec/gherkin/fixtures/i18n_pt2.feature +0 -4
  281. data/spec/gherkin/fixtures/i18n_pt3.feature +0 -4
  282. data/spec/gherkin/fixtures/i18n_pt4.feature +0 -4
  283. data/spec/gherkin/fixtures/i18n_zh-CN.feature +0 -9
  284. data/spec/gherkin/fixtures/iso-8859-1.feature +0 -6
  285. data/spec/gherkin/fixtures/issue_145.feature +0 -22
  286. data/spec/gherkin/fixtures/scenario_outline_with_tags.feature +0 -13
  287. data/spec/gherkin/fixtures/scenario_without_steps.feature +0 -5
  288. data/spec/gherkin/fixtures/simple_with_comments.feature +0 -7
  289. data/spec/gherkin/fixtures/simple_with_tags.feature +0 -11
  290. data/spec/gherkin/fixtures/with_bom.feature +0 -3
  291. data/spec/gherkin/fixtures/with_bom_and_language_spec.feature +0 -4
  292. data/spec/gherkin/formatter/ansi_escapes_spec.rb +0 -32
  293. data/spec/gherkin/formatter/filter_formatter_spec.rb +0 -204
  294. data/spec/gherkin/formatter/json_formatter_spec.rb +0 -179
  295. data/spec/gherkin/formatter/model_spec.rb +0 -28
  296. data/spec/gherkin/formatter/pretty_formatter_spec.rb +0 -184
  297. data/spec/gherkin/formatter/spaces.feature +0 -9
  298. data/spec/gherkin/formatter/step_printer_spec.rb +0 -55
  299. data/spec/gherkin/formatter/tabs.feature +0 -9
  300. data/spec/gherkin/formatter/tag_count_formatter_spec.rb +0 -30
  301. data/spec/gherkin/i18n_spec.rb +0 -256
  302. data/spec/gherkin/java_lexer_spec.rb +0 -20
  303. data/spec/gherkin/json_parser_spec.rb +0 -165
  304. data/spec/gherkin/lexer/i18n_lexer_spec.rb +0 -65
  305. data/spec/gherkin/native_lexer_spec.rb +0 -29
  306. data/spec/gherkin/parser/parser_spec.rb +0 -16
  307. data/spec/gherkin/rubify_spec.rb +0 -23
  308. data/spec/gherkin/sexp_recorder.rb +0 -59
  309. data/spec/gherkin/shared/doc_string_group.rb +0 -161
  310. data/spec/gherkin/shared/encoding_group.rb +0 -48
  311. data/spec/gherkin/shared/lexer_group.rb +0 -589
  312. data/spec/gherkin/shared/row_group.rb +0 -123
  313. data/spec/gherkin/shared/tags_group.rb +0 -52
  314. data/spec/gherkin/tag_expression_spec.rb +0 -146
  315. data/spec/spec_helper.rb +0 -94
  316. data/tasks/apidoc.rake +0 -32
  317. data/tasks/bench.rake +0 -184
  318. data/tasks/bench/feature_builder.rb +0 -49
  319. data/tasks/bench/null_listener.rb +0 -4
  320. data/tasks/compile.rake +0 -83
  321. data/tasks/cucumber.rake +0 -23
  322. data/tasks/gems.rake +0 -46
  323. data/tasks/ikvm.rake +0 -126
  324. data/tasks/ragel_task.rb +0 -124
  325. data/tasks/release.rake +0 -34
  326. data/tasks/rspec.rake +0 -6
  327. data/tasks/yard/default/layout/html/bubble_32x32.png +0 -0
  328. data/tasks/yard/default/layout/html/bubble_48x48.png +0 -0
  329. data/tasks/yard/default/layout/html/footer.erb +0 -5
  330. data/tasks/yard/default/layout/html/index.erb +0 -1
  331. data/tasks/yard/default/layout/html/layout.erb +0 -25
  332. data/tasks/yard/default/layout/html/logo.erb +0 -1
  333. data/tasks/yard/default/layout/html/setup.rb +0 -4
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 19714bd5cd76b6a265f7804b22ceb27939c5b8ef
4
- data.tar.gz: e042bb512f5b4ad6f7e22b62caad67fe0f02fc0d
3
+ metadata.gz: 616936d9b8360845b1bc12aa9977027ca9798a70
4
+ data.tar.gz: e86bcaf18d78f4eae825334729b858b144cddb06
5
5
  SHA512:
6
- metadata.gz: dd77eb77ea763b77f6d19ba13548e76c554e3e996d8b0ebabc49ac4f5286dcd6a27d3b58a02b916fd303ac7d89fb3157287c00458174f56adb5421d0eecd6f25
7
- data.tar.gz: 875400eab0b0d54a392fa4931d8c2324f037b1d05b293f001ca01c70a2814893e9ccea628c6714d86bf650beb72d1e9e6c96c34dd4063b35a99f90727db61868
6
+ metadata.gz: a92897921797ebde32ca547eada1292adb5b338d4d3bd4b26328c361a22032460e9b117bb4acc133a19259b8aeae2b33053bed63747d4391c9521e235053db2f
7
+ data.tar.gz: c3a596f0c6f3d18088e2861dc40b7635a6d196f3aeceb9bf4eea6fbc17498d7470d6549235c103e996159f90141bc10da56ec98384179e3b66b706faf76f9e61
@@ -1,15 +1,2 @@
1
- before_install: gem install bundler -v 1.3.5
2
- rvm:
3
- - 2.0.0
4
- - 1.9.3
5
- - jruby
6
- # whitelist
7
- branches:
8
- only:
9
- - master
10
-
11
- notifications:
12
- email:
13
- - cukes-devs@googlegroups.com
14
- irc:
15
- - "irc.freenode.org#cucumber"
1
+ language: ruby
2
+ sudo: false
@@ -0,0 +1,23 @@
1
+ Please read [CONTRIBUTING](https://github.com/cucumber/gherkin/blob/master/CONTRIBUTING.md) first.
2
+ You should clone the [cucumber/gherkin](https://github.com/cucumber/gherkin) repo if you want
3
+ to contribute.
4
+
5
+ ## Run tests
6
+
7
+ ### Using make
8
+
9
+ Just run `make` from this directory.
10
+
11
+ Even if you prefer `make` - run `rake` occasionally, as it reports better warnings.
12
+
13
+ ### Using rake
14
+
15
+ Just run `rake` from this directory.
16
+
17
+ Keep in mind that this will only run unit tests. The acceptance tests are only
18
+ run when you build with `make`.
19
+
20
+ ## Make a release
21
+
22
+ # Change version in `gherkin.gemspec` and commit
23
+ bundle exec rake build release
data/Gemfile CHANGED
@@ -1,5 +1,2 @@
1
1
  source "https://rubygems.org"
2
2
  gemspec
3
-
4
- # gem 'cucumber', :path => '../cucumber'
5
-
data/LICENSE CHANGED
@@ -1,20 +1,21 @@
1
- Copyright (c) 2009-2013 Mike Sassak, Gregory Hnatiuk, Aslak Hellesøy
1
+ The MIT License (MIT)
2
2
 
3
- Permission is hereby granted, free of charge, to any person obtaining
4
- a copy of this software and associated documentation files (the
5
- "Software"), to deal in the Software without restriction, including
6
- without limitation the rights to use, copy, modify, merge, publish,
7
- distribute, sublicense, and/or sell copies of the Software, and to
8
- permit persons to whom the Software is furnished to do so, subject to
9
- the following conditions:
3
+ Copyright (c) 2014-2016 Cucumber Ltd, Gaspar Nagy
10
4
 
11
- The above copyright notice and this permission notice shall be
12
- included in all copies or substantial portions of the Software.
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
13
11
 
14
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
- LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
- OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
- WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
@@ -0,0 +1,65 @@
1
+ GOOD_FEATURE_FILES = $(shell find ../testdata/good -name "*.feature")
2
+ BAD_FEATURE_FILES = $(shell find ../testdata/bad -name "*.feature")
3
+
4
+ TOKENS = $(patsubst ../testdata/%.feature,acceptance/testdata/%.feature.tokens,$(GOOD_FEATURE_FILES))
5
+ ASTS = $(patsubst ../testdata/%.feature,acceptance/testdata/%.feature.ast.json,$(GOOD_FEATURE_FILES))
6
+ PICKLES = $(patsubst ../testdata/%.feature,acceptance/testdata/%.feature.pickles.json,$(GOOD_FEATURE_FILES))
7
+ ERRORS = $(patsubst ../testdata/%.feature,acceptance/testdata/%.feature.errors,$(BAD_FEATURE_FILES))
8
+
9
+ RUBY_FILES = $(shell find . -name "*.rb")
10
+
11
+ all: .compared
12
+ .PHONY: all
13
+
14
+ .compared: .built $(TOKENS) $(ASTS) $(PICKLES) $(ERRORS)
15
+ touch $@
16
+
17
+ .built: lib/gherkin/parser.rb lib/gherkin/gherkin-languages.json $(RUBY_FILES) Gemfile.lock LICENSE
18
+ bundle exec rspec --color
19
+ touch $@
20
+
21
+ acceptance/testdata/%.feature.tokens: ../testdata/%.feature ../testdata/%.feature.tokens .built
22
+ mkdir -p `dirname $@`
23
+ bin/gherkin-generate-tokens $< > $@
24
+ diff --unified $<.tokens $@
25
+ .DELETE_ON_ERROR: acceptance/testdata/%.feature.tokens
26
+
27
+ acceptance/testdata/%.feature.ast.json: ../testdata/%.feature ../testdata/%.feature.ast.json .built
28
+ mkdir -p `dirname $@`
29
+ bin/gherkin-generate-ast $< | jq --sort-keys "." > $@
30
+ diff --unified $<.ast.json $@
31
+ .DELETE_ON_ERROR: acceptance/testdata/%.feature.ast.json
32
+
33
+ acceptance/testdata/%.feature.pickles.json: ../testdata/%.feature ../testdata/%.feature.pickles.json .built
34
+ mkdir -p `dirname $@`
35
+ bin/gherkin-generate-pickles $< | jq --sort-keys "." > $@
36
+ diff --unified $<.pickles.json $@
37
+ .DELETE_ON_ERROR: acceptance/testdata/%.feature.pickles.json
38
+
39
+ acceptance/testdata/%.feature.errors: ../testdata/%.feature ../testdata/%.feature.errors .built
40
+ mkdir -p `dirname $@`
41
+ ! bin/gherkin-generate-ast $< 2> $@
42
+ diff --unified $<.errors $@
43
+ .DELETE_ON_ERROR: acceptance/testdata/%.feature.errors
44
+
45
+ lib/gherkin/gherkin-languages.json: ../gherkin-languages.json
46
+ cp $^ $@
47
+
48
+ clean:
49
+ rm -rf .compared .built acceptance lib/gherkin/parser.rb lib/gherkin/gherkin-languages.json coverage
50
+ .PHONY: clean
51
+
52
+ lib/gherkin/parser.rb: ../gherkin.berp gherkin-ruby.razor ../bin/berp.exe
53
+ mono ../bin/berp.exe -g ../gherkin.berp -t gherkin-ruby.razor -o $@
54
+ # Remove BOM
55
+ tail -c +4 $@ > $@.nobom
56
+ mv $@.nobom $@
57
+
58
+ Gemfile.lock: Gemfile
59
+ bundle install
60
+
61
+ LICENSE: ../LICENSE
62
+ cp $< $@
63
+
64
+ update-gherkin-languages: lib/gherkin/gherkin-languages.json
65
+ .PHONY: update-gherkin-languages
data/README.md CHANGED
@@ -1,272 +1,13 @@
1
- [![Build Status](https://secure.travis-ci.org/cucumber/gherkin.png)](http://travis-ci.org/cucumber/gherkin)
1
+ [![Build Status](https://secure.travis-ci.org/cucumber/gherkin-ruby.svg)](http://travis-ci.org/cucumber/gherkin-ruby)
2
2
 
3
- A fast lexer and parser for the Gherkin language based on Ragel. Gherkin is two things:
3
+ Gherkin parser/compiler for Ruby. Please see [Gherkin](https://github.com/cucumber/gherkin) for details.
4
4
 
5
- * The language that has evolved out of the Cucumber project.
6
- * This library.
5
+ ## Developers
7
6
 
8
- Supported platforms:
7
+ Some files are generated from the `gherkin-ruby.razor` file. Please run the
8
+ following command to generate the ruby files.
9
9
 
10
- * [Ruby](https://rubygems.org/gems/gherkin) 1.9.3-2.0.0 (MRI, JRuby, REE, Rubinius)
11
- * [Pure Java](http://search.maven.org/#search%7Cga%7C1%7Cgherkin) (jar file)
12
- * [JavaScript](http://search.npmjs.org/#/gherkin) (Tested with V8/node.js/Chrome, but might work on other JavaScript engines)
13
- * [.NET](http://nuget.org/List/Packages/gherkin) (dll file)
14
-
15
- ## Installation
16
-
17
- ### Ruby/JRuby
18
-
19
- gem install gherkin
20
-
21
- #### Troubleshooting
22
-
23
- On JRuby you may get an error saying:
24
-
25
- ERROR: While executing gem ... (ArgumentError)
26
- undefined class/module YAML::Syck::DefaultKey
27
-
28
- You can get around this problem by upgrading rubygems:
29
-
30
- jruby -S gem install rubygems-update
31
- gem update --system
32
-
33
- Another problem you might encounter is:
34
-
35
- ERROR: While executing gem ... (ArgumentError)
36
- invalid byte sequence in US-ASCII
37
-
38
- If this happens, try defining your shell's encoding:
39
-
40
- # Linux
41
- export LANG=en_US.UTF-8
42
-
43
- # OS X
44
- export LC_CTYPE=en_US.UTF-8
45
-
46
- ### Node.js
47
-
48
- npm install gherkin
49
-
50
- ### Java
51
-
52
- The jar file is in the central Maven repo.
53
-
54
- <dependency>
55
- <groupId>info.cukes</groupId>
56
- <artifactId>gherkin</artifactId>
57
- <version>2.12.2</version>
58
- </dependency>
59
-
60
- You can get it manually from [Maven Central](http://search.maven.org/#browse%7C-2073395818)
61
-
62
- ### .NET
63
-
64
- Get the dll from [NuGet](http://nuget.org/List/Packages/gherkin)
65
-
66
- ## API Docs
67
-
68
- * [Ruby](http://cukes.info/api/gherkin/yardoc/)
69
- * [Java](http://cukes.info/api/gherkin/javadoc/)
70
-
71
- ## Hacking: Installing the toolchain
72
-
73
- Due to the cross-platform nature of this library, you have to install a lot of tools to build gherkin yourself.
74
- In order to make it easier for occasional contributors to get the development environment up and running, you don't
75
- have to install everything up front. The build scripts should tell you if you are missing something. For example,
76
- you shouldn't have to install MinGW to build windows binaries if you are a Linux user and just want to fix a bug in
77
- the C code.
78
-
79
- ### Common dependencies
80
-
81
- These are the minimal tools you need to install:
82
-
83
- * Ragel (brew install ragel or apt-get install ragel)
84
- * Ruby (any version should do).
85
- * A clone of the cucumber git repo to a "cucumber" sibling folder of your gherkin folder. (Only needed to run cucumber tests)
86
- * RVM (you may not need this if you are only building for a single platform)
87
-
88
- With this minimal tool chain installed, install Ruby gems needed by the build:
89
-
90
- gem install bundler
91
- bundle install
92
-
93
- Running RSpec and Cucumber tests
94
-
95
- rake clean spec cucumber
96
-
97
- If the RL_LANGS environment variable is set, only the parsers for the languages specified there will be built.
98
- E.g. in Bash, export RL_LANGS="en,fr,no". This can be quite helpful when modifying the Ragel grammar.
99
-
100
- See subsections for building for a specific platform.
101
-
102
- ### MRI, REE or Rubinius
103
-
104
- You'll need GCC installed.
105
-
106
- Build the gem with:
107
-
108
- rake build
109
-
110
- ### Pure Java and JRuby
111
-
112
- You must install JRuby to build the pure Java jar or the JRuby gem:
113
-
114
- rvm install jruby
115
- rvm use jruby
116
- rvm gemset create cucumber
117
- rvm gemset use cucumber
118
- gem install bundler
119
- bundle install
120
-
121
- Now you can build the jar with:
122
-
123
- rake clean jar
124
-
125
- ### JavaScript
126
-
127
- In order to build and test Gherkin for JavaScript you must install:
128
-
129
- * Node.js (0.10.9 or higher with npm)
130
- * Ragel with JavaScript support: http://github.com/dominicmarks/ragel-js
131
- * Make sure you have gcc/g++ 4.6 (4.7 is too strict to build ragel-js)
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
- * Define the GHERKIN_JS environment variable in your shell (any value will do)
138
-
139
- Update gems (to install gems which are needed only for js support):
140
-
141
- bundle update
142
-
143
- Now you can build the JavaScript with:
144
-
145
- bundle exec rake js
146
-
147
- And you can try it out with node.js:
148
-
149
- node js/example/print.js spec/gherkin/fixtures/1.feature
150
-
151
- Or the json formatter:
152
-
153
- node js/example/json_formatter_example.js
154
-
155
- If you're hacking and just want to rebuild the English parser:
156
-
157
- rake js/lib/gherkin/lexer/en.js
158
-
159
- In order to test the native JavaScript implementation of JSONFormatter, you also need to define the `GHERKIN_JS_NATIVE` environment
160
- variable. It's recommended you don't do this permanently, as it will disable testing the Ruby implementation. Try this instead:
161
-
162
- GHERKIN_JS_NATIVE=true GHERKIN_JS=true bundle exec rake
163
-
164
- TODO: Make all specs pass with js lexer - replace 'c(listener)' with 'js(listener)' in i18n.rb
165
-
166
- ### .NET dll
167
-
168
- You must install Mono SDK 3.2.1 (or possibly newer). The OS X package installer is recommended, but make sure you run `brew doctor`
169
- after installing.
170
-
171
- Now we must update NuGet.exe and register our NuGet API Key:
172
-
173
- # In case we need to update
174
- mono ikvm/NuGet.exe Update -self
175
-
176
- # The key is at https://nuget.org/account
177
- mono --runtime=v4.0.30319 ikvm/NuGet.exe SetApiKey xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxx
178
- (Note: you may need to run 'mozroots --import --sync' to help mono trusts https setificate, see http://monomvc.wordpress.com/2012/03/06/nuget-on-mono/ for more information)
179
-
180
- Now you can build the .NET dll with:
181
-
182
- mkdir release
183
- rake ikvm
184
- rake release/nuspec/lib/gherkin.dll
185
-
186
- This should build `release/nuspec/lib/gherkin.dll`
187
-
188
- ### MinGW Rubies (for Windows gems)
189
-
190
- In order to build Windows binaries (so we can release Windows gems from OS X/Linux) we first need to install MinGW:
191
-
192
- ./install_mingw_os_x.sh
193
-
194
- Now, make sure you have openssl installed - it's needed to build the rubies.
195
-
196
- brew install openssl
197
-
198
- Next, we're going to install Ruby 1.9.3 and 2.0.0 for MinGW. We need both versions so we can build Windows binaries for both.
199
-
200
- export PATH=/usr/local/mingw/bin:$PATH
201
- # Test that it's on your PATH
202
- i686-w64-mingw32-gcc -v
203
-
204
- Now we're ready to install the Windows rubies. You should be able to replace `rvm` with `rbenv`
205
-
206
- unset GHERKIN_JS
207
-
208
- # 1.9.3
209
- rvm install 1.9.3-p448
210
- rvm use 1.9.3-p448
211
- rvm gemset use cucumber --create
212
- gem install bundler
213
- bundle install
214
- PATH=/usr/local/mingw/bin:$PATH CC=/usr/local/mingw/bin/i686-w64-mingw32-gcc rake-compiler cross-ruby VERSION=1.9.3-p448
215
-
216
- # 2.0.0
217
- rvm install 2.0.0-p247
218
- rvm use 2.0.0-p247
219
- rvm gemset use cucumber --create
220
- gem install bundler
221
- bundle install
222
- PATH=/usr/local/mingw/bin:$PATH CC=/usr/local/mingw/bin/i686-w64-mingw32-gcc rake-compiler cross-ruby VERSION=2.0.0-p247
223
-
224
- Now you can build Windows gems:
225
-
226
- rake compile
227
- mkdir release
228
- PATH=/usr/local/mingw/bin:$PATH CC=/usr/local/mingw/bin/i686-w64-mingw32-gcc rake gems:win
229
-
230
- ## Release process
231
-
232
- Make sure you have access to all the servers where packages are being uploaded:
233
-
234
- * npm registry: `npm login`
235
- * rubygems.org: `gem push`
236
- * sonatype: Check `~/.m2/settings.xml` and that you have gnupg (OS X users: Install [GPGTools](http://www.gpgtools.org/installer/index.html))
237
- * Make sure you have a key [with no sub-key](https://docs.sonatype.org/display/Repository/How+To+Generate+PGP+Signatures+With+Maven)
238
- * nuget: See .NET section above
239
-
240
- Run tests once with GHERKIN_JS_NATIVE=true:
241
-
242
- GHERKIN_JS_NATIVE=true GHERKIN_JS=true bundle exec rake
243
-
244
- Now we can release:
245
-
246
- * Make sure you have rbenv installed
247
- * And that you have merged this patch: https://github.com/sstephenson/rbenv/issues/121
248
- * `cd ~/.rbenv && git pull git@github.com:sstephenson/rbenv.git exec-next`
249
- * Make sure GHERKIN_JS is defined (see JavaScript section above)
250
- * Bump version in:
251
- * This file (Installation/Java section)
252
- * lib/gherkin/platform.rb
253
- * java/pom.xml
254
- * js/package.json
255
- * History.md
256
- * Run `bundle update`, so Gemfile.lock gets updated with the changes.
257
- * Commit changes, otherwise you will get an error at the end when a tag is made.
258
- * Run `i686-w64-mingw32-gcc -v && bundle exec rake gems:prepare && ./build_native_gems.sh && bundle exec rake release:ALL`
259
-
260
- ## Note on Patches/Pull Requests
261
-
262
- * Fork the project.
263
- * Run `bundle install` to install dependencies.
264
- * Run `rake` to make sure all the tests are passing.
265
- * Make your feature addition or bug fix.
266
- * Add tests for it. This is important so I don't break it in a future version unintentionally.
267
- * Commit, do not mess with History.md.
268
- * Send me a pull request. Bonus points for topic branches.
269
-
270
- ## Copyright
271
-
272
- Copyright (c) 2009-2013 Mike Sassak, Gregory Hnatiuk, Aslak Hellesøy. See LICENSE for details.
10
+ ~~~bash
11
+ cd <project_root>/ruby
12
+ make
13
+ ~~~