gherkin 2.12.2 → 3.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +2 -15
- data/CONTRIBUTING.md +23 -0
- data/Gemfile +0 -3
- data/LICENSE +18 -17
- data/Makefile +65 -0
- data/README.md +9 -268
- data/Rakefile +17 -19
- data/bin/gherkin-generate-ast +21 -0
- data/bin/gherkin-generate-pickles +25 -0
- data/bin/gherkin-generate-tokens +12 -0
- data/gherkin-ruby.razor +218 -0
- data/gherkin.gemspec +22 -76
- data/lib/gherkin/ast_builder.rb +243 -0
- data/lib/gherkin/ast_node.rb +30 -0
- data/lib/gherkin/dialect.rb +58 -0
- data/lib/gherkin/errors.rb +45 -0
- data/lib/gherkin/gherkin-languages.json +2968 -0
- data/lib/gherkin/gherkin_line.rb +95 -0
- data/lib/gherkin/parser.rb +1910 -0
- data/lib/gherkin/pickles/compiler.rb +164 -0
- data/lib/gherkin/token.rb +18 -0
- data/lib/gherkin/token_formatter_builder.rb +39 -0
- data/lib/gherkin/token_matcher.rb +169 -0
- data/lib/gherkin/token_scanner.rb +40 -0
- data/spec/capture_warnings.rb +68 -0
- data/spec/coverage.rb +10 -0
- data/spec/gherkin/parser_spec.rb +146 -0
- metadata +60 -567
- data/.gitattributes +0 -2
- data/.mailmap +0 -2
- data/.rbenv-gemsets +0 -1
- data/.rspec +0 -1
- data/.ruby-gemset +0 -1
- data/.ruby-version +0 -1
- data/.yardopts +0 -5
- data/History.md +0 -881
- data/build_native_gems.sh +0 -7
- data/cucumber.yml +0 -5
- data/examples/parse_and_output_json.rb +0 -19
- data/ext/gherkin_lexer_ar/extconf.rb +0 -6
- data/ext/gherkin_lexer_ar/gherkin_lexer_ar.c +0 -1432
- data/ext/gherkin_lexer_bg/extconf.rb +0 -6
- data/ext/gherkin_lexer_bg/gherkin_lexer_bg.c +0 -1655
- data/ext/gherkin_lexer_bm/extconf.rb +0 -6
- data/ext/gherkin_lexer_bm/gherkin_lexer_bm.c +0 -1516
- data/ext/gherkin_lexer_ca/extconf.rb +0 -6
- data/ext/gherkin_lexer_ca/gherkin_lexer_ca.c +0 -1581
- data/ext/gherkin_lexer_cs/extconf.rb +0 -6
- data/ext/gherkin_lexer_cs/gherkin_lexer_cs.c +0 -1515
- data/ext/gherkin_lexer_cy_gb/extconf.rb +0 -6
- data/ext/gherkin_lexer_cy_gb/gherkin_lexer_cy_gb.c +0 -1282
- data/ext/gherkin_lexer_da/extconf.rb +0 -6
- data/ext/gherkin_lexer_da/gherkin_lexer_da.c +0 -1298
- data/ext/gherkin_lexer_de/extconf.rb +0 -6
- data/ext/gherkin_lexer_de/gherkin_lexer_de.c +0 -1425
- data/ext/gherkin_lexer_el/extconf.rb +0 -6
- data/ext/gherkin_lexer_el/gherkin_lexer_el.c +0 -1919
- data/ext/gherkin_lexer_en/extconf.rb +0 -6
- data/ext/gherkin_lexer_en/gherkin_lexer_en.c +0 -1418
- data/ext/gherkin_lexer_en_au/extconf.rb +0 -6
- data/ext/gherkin_lexer_en_au/gherkin_lexer_en_au.c +0 -1765
- data/ext/gherkin_lexer_en_lol/extconf.rb +0 -6
- data/ext/gherkin_lexer_en_lol/gherkin_lexer_en_lol.c +0 -1177
- data/ext/gherkin_lexer_en_old/extconf.rb +0 -6
- data/ext/gherkin_lexer_en_old/gherkin_lexer_en_old.c +0 -1309
- data/ext/gherkin_lexer_en_pirate/extconf.rb +0 -6
- data/ext/gherkin_lexer_en_pirate/gherkin_lexer_en_pirate.c +0 -1471
- data/ext/gherkin_lexer_en_scouse/extconf.rb +0 -6
- data/ext/gherkin_lexer_en_scouse/gherkin_lexer_en_scouse.c +0 -1634
- data/ext/gherkin_lexer_en_tx/extconf.rb +0 -6
- data/ext/gherkin_lexer_en_tx/gherkin_lexer_en_tx.c +0 -1265
- data/ext/gherkin_lexer_eo/extconf.rb +0 -6
- data/ext/gherkin_lexer_eo/gherkin_lexer_eo.c +0 -1241
- data/ext/gherkin_lexer_es/extconf.rb +0 -6
- data/ext/gherkin_lexer_es/gherkin_lexer_es.c +0 -1399
- data/ext/gherkin_lexer_et/extconf.rb +0 -6
- data/ext/gherkin_lexer_et/gherkin_lexer_et.c +0 -1236
- data/ext/gherkin_lexer_fa/extconf.rb +0 -6
- data/ext/gherkin_lexer_fa/gherkin_lexer_fa.c +0 -1475
- data/ext/gherkin_lexer_fi/extconf.rb +0 -6
- data/ext/gherkin_lexer_fi/gherkin_lexer_fi.c +0 -1215
- data/ext/gherkin_lexer_fr/extconf.rb +0 -6
- data/ext/gherkin_lexer_fr/gherkin_lexer_fr.c +0 -1493
- data/ext/gherkin_lexer_gl/extconf.rb +0 -6
- data/ext/gherkin_lexer_gl/gherkin_lexer_gl.c +0 -1374
- data/ext/gherkin_lexer_he/extconf.rb +0 -6
- data/ext/gherkin_lexer_he/gherkin_lexer_he.c +0 -1374
- data/ext/gherkin_lexer_hi/extconf.rb +0 -6
- data/ext/gherkin_lexer_hi/gherkin_lexer_hi.c +0 -1848
- data/ext/gherkin_lexer_hr/extconf.rb +0 -6
- data/ext/gherkin_lexer_hr/gherkin_lexer_hr.c +0 -1323
- data/ext/gherkin_lexer_hu/extconf.rb +0 -6
- data/ext/gherkin_lexer_hu/gherkin_lexer_hu.c +0 -1376
- data/ext/gherkin_lexer_id/extconf.rb +0 -6
- data/ext/gherkin_lexer_id/gherkin_lexer_id.c +0 -1208
- data/ext/gherkin_lexer_is/extconf.rb +0 -6
- data/ext/gherkin_lexer_is/gherkin_lexer_is.c +0 -1376
- data/ext/gherkin_lexer_it/extconf.rb +0 -6
- data/ext/gherkin_lexer_it/gherkin_lexer_it.c +0 -1340
- data/ext/gherkin_lexer_ja/extconf.rb +0 -6
- data/ext/gherkin_lexer_ja/gherkin_lexer_ja.c +0 -1699
- data/ext/gherkin_lexer_kn/extconf.rb +0 -6
- data/ext/gherkin_lexer_kn/gherkin_lexer_kn.c +0 -1965
- data/ext/gherkin_lexer_ko/extconf.rb +0 -6
- data/ext/gherkin_lexer_ko/gherkin_lexer_ko.c +0 -1360
- data/ext/gherkin_lexer_lt/extconf.rb +0 -6
- data/ext/gherkin_lexer_lt/gherkin_lexer_lt.c +0 -1296
- data/ext/gherkin_lexer_lu/extconf.rb +0 -6
- data/ext/gherkin_lexer_lu/gherkin_lexer_lu.c +0 -1389
- data/ext/gherkin_lexer_lv/extconf.rb +0 -6
- data/ext/gherkin_lexer_lv/gherkin_lexer_lv.c +0 -1425
- data/ext/gherkin_lexer_nl/extconf.rb +0 -6
- data/ext/gherkin_lexer_nl/gherkin_lexer_nl.c +0 -1368
- data/ext/gherkin_lexer_no/extconf.rb +0 -6
- data/ext/gherkin_lexer_no/gherkin_lexer_no.c +0 -1311
- data/ext/gherkin_lexer_pa/extconf.rb +0 -6
- data/ext/gherkin_lexer_pa/gherkin_lexer_pa.c +0 -2160
- data/ext/gherkin_lexer_pl/extconf.rb +0 -6
- data/ext/gherkin_lexer_pl/gherkin_lexer_pl.c +0 -1738
- data/ext/gherkin_lexer_pt/extconf.rb +0 -6
- data/ext/gherkin_lexer_pt/gherkin_lexer_pt.c +0 -1711
- data/ext/gherkin_lexer_ro/extconf.rb +0 -6
- data/ext/gherkin_lexer_ro/gherkin_lexer_ro.c +0 -1427
- data/ext/gherkin_lexer_ru/extconf.rb +0 -6
- data/ext/gherkin_lexer_ru/gherkin_lexer_ru.c +0 -2071
- data/ext/gherkin_lexer_sk/extconf.rb +0 -6
- data/ext/gherkin_lexer_sk/gherkin_lexer_sk.c +0 -1739
- data/ext/gherkin_lexer_sr_cyrl/extconf.rb +0 -6
- data/ext/gherkin_lexer_sr_cyrl/gherkin_lexer_sr_cyrl.c +0 -2112
- data/ext/gherkin_lexer_sr_latn/extconf.rb +0 -6
- data/ext/gherkin_lexer_sr_latn/gherkin_lexer_sr_latn.c +0 -1567
- data/ext/gherkin_lexer_sv/extconf.rb +0 -6
- data/ext/gherkin_lexer_sv/gherkin_lexer_sv.c +0 -1324
- data/ext/gherkin_lexer_th/extconf.rb +0 -6
- data/ext/gherkin_lexer_th/gherkin_lexer_th.c +0 -2840
- data/ext/gherkin_lexer_tl/extconf.rb +0 -6
- data/ext/gherkin_lexer_tl/gherkin_lexer_tl.c +0 -2021
- data/ext/gherkin_lexer_tr/extconf.rb +0 -6
- data/ext/gherkin_lexer_tr/gherkin_lexer_tr.c +0 -1347
- data/ext/gherkin_lexer_tt/extconf.rb +0 -6
- data/ext/gherkin_lexer_tt/gherkin_lexer_tt.c +0 -1936
- data/ext/gherkin_lexer_uk/extconf.rb +0 -6
- data/ext/gherkin_lexer_uk/gherkin_lexer_uk.c +0 -1941
- data/ext/gherkin_lexer_uz/extconf.rb +0 -6
- data/ext/gherkin_lexer_uz/gherkin_lexer_uz.c +0 -1651
- data/ext/gherkin_lexer_vi/extconf.rb +0 -6
- data/ext/gherkin_lexer_vi/gherkin_lexer_vi.c +0 -1458
- data/ext/gherkin_lexer_zh_cn/extconf.rb +0 -6
- data/ext/gherkin_lexer_zh_cn/gherkin_lexer_zh_cn.c +0 -1314
- data/ext/gherkin_lexer_zh_tw/extconf.rb +0 -6
- data/ext/gherkin_lexer_zh_tw/gherkin_lexer_zh_tw.c +0 -1307
- data/features/.cucumber/stepdefs.json +0 -244
- data/features/escaped_pipes.feature +0 -8
- data/features/feature_parser.feature +0 -237
- data/features/json_formatter.feature +0 -498
- data/features/json_parser.feature +0 -331
- data/features/native_lexer.feature +0 -19
- data/features/parser_with_native_lexer.feature +0 -205
- data/features/pretty_formatter.feature +0 -17
- data/features/step_definitions/eyeball_steps.rb +0 -3
- data/features/step_definitions/gherkin_steps.rb +0 -29
- data/features/step_definitions/json_formatter_steps.rb +0 -30
- data/features/step_definitions/json_parser_steps.rb +0 -21
- data/features/step_definitions/pretty_formatter_steps.rb +0 -85
- data/features/steps_parser.feature +0 -46
- data/features/support/env.rb +0 -41
- data/install_mingw_os_x.sh +0 -5
- data/js/.npmignore +0 -1
- data/js/lib/gherkin/lexer/.npmignore +0 -0
- data/lib/gherkin.rb +0 -2
- data/lib/gherkin/README.md +0 -7
- data/lib/gherkin/c_lexer.rb +0 -17
- data/lib/gherkin/formatter/ansi_escapes.rb +0 -97
- data/lib/gherkin/formatter/argument.rb +0 -16
- data/lib/gherkin/formatter/escaping.rb +0 -15
- data/lib/gherkin/formatter/filter_formatter.rb +0 -150
- data/lib/gherkin/formatter/hashable.rb +0 -25
- data/lib/gherkin/formatter/json_formatter.rb +0 -133
- data/lib/gherkin/formatter/line_filter.rb +0 -26
- data/lib/gherkin/formatter/model.rb +0 -281
- data/lib/gherkin/formatter/pretty_formatter.rb +0 -245
- data/lib/gherkin/formatter/regexp_filter.rb +0 -21
- data/lib/gherkin/formatter/step_printer.rb +0 -21
- data/lib/gherkin/formatter/tag_count_formatter.rb +0 -47
- data/lib/gherkin/formatter/tag_filter.rb +0 -19
- data/lib/gherkin/i18n.json +0 -786
- data/lib/gherkin/i18n.rb +0 -176
- data/lib/gherkin/json_parser.rb +0 -177
- data/lib/gherkin/lexer/ar.rb +0 -1170
- data/lib/gherkin/lexer/bg.rb +0 -1382
- data/lib/gherkin/lexer/bm.rb +0 -1250
- data/lib/gherkin/lexer/ca.rb +0 -1310
- data/lib/gherkin/lexer/cs.rb +0 -1246
- data/lib/gherkin/lexer/cy_gb.rb +0 -1032
- data/lib/gherkin/lexer/da.rb +0 -1048
- data/lib/gherkin/lexer/de.rb +0 -1166
- data/lib/gherkin/lexer/el.rb +0 -1628
- data/lib/gherkin/lexer/en.rb +0 -1156
- data/lib/gherkin/lexer/en_au.rb +0 -1486
- data/lib/gherkin/lexer/en_lol.rb +0 -934
- data/lib/gherkin/lexer/en_old.rb +0 -1037
- data/lib/gherkin/lexer/en_pirate.rb +0 -1210
- data/lib/gherkin/lexer/en_scouse.rb +0 -1362
- data/lib/gherkin/lexer/en_tx.rb +0 -1016
- data/lib/gherkin/lexer/encoding.rb +0 -41
- data/lib/gherkin/lexer/eo.rb +0 -995
- data/lib/gherkin/lexer/es.rb +0 -1140
- data/lib/gherkin/lexer/et.rb +0 -990
- data/lib/gherkin/lexer/fa.rb +0 -1214
- data/lib/gherkin/lexer/fi.rb +0 -969
- data/lib/gherkin/lexer/fr.rb +0 -1228
- data/lib/gherkin/lexer/gl.rb +0 -1117
- data/lib/gherkin/lexer/he.rb +0 -1118
- data/lib/gherkin/lexer/hi.rb +0 -1559
- data/lib/gherkin/lexer/hr.rb +0 -1066
- data/lib/gherkin/lexer/hu.rb +0 -1118
- data/lib/gherkin/lexer/i18n_lexer.rb +0 -48
- data/lib/gherkin/lexer/id.rb +0 -963
- data/lib/gherkin/lexer/is.rb +0 -1120
- data/lib/gherkin/lexer/it.rb +0 -1086
- data/lib/gherkin/lexer/ja.rb +0 -1418
- data/lib/gherkin/lexer/kn.rb +0 -1672
- data/lib/gherkin/lexer/ko.rb +0 -1102
- data/lib/gherkin/lexer/lt.rb +0 -1045
- data/lib/gherkin/lexer/lu.rb +0 -1132
- data/lib/gherkin/lexer/lv.rb +0 -1166
- data/lib/gherkin/lexer/nl.rb +0 -1115
- data/lib/gherkin/lexer/no.rb +0 -1060
- data/lib/gherkin/lexer/pa.rb +0 -1852
- data/lib/gherkin/lexer/pl.rb +0 -1457
- data/lib/gherkin/lexer/pt.rb +0 -1430
- data/lib/gherkin/lexer/ro.rb +0 -1164
- data/lib/gherkin/lexer/ru.rb +0 -1766
- data/lib/gherkin/lexer/sk.rb +0 -1452
- data/lib/gherkin/lexer/sr_cyrl.rb +0 -1803
- data/lib/gherkin/lexer/sr_latn.rb +0 -1294
- data/lib/gherkin/lexer/sv.rb +0 -1070
- data/lib/gherkin/lexer/th.rb +0 -2492
- data/lib/gherkin/lexer/tl.rb +0 -1726
- data/lib/gherkin/lexer/tr.rb +0 -1092
- data/lib/gherkin/lexer/tt.rb +0 -1643
- data/lib/gherkin/lexer/uk.rb +0 -1646
- data/lib/gherkin/lexer/uz.rb +0 -1376
- data/lib/gherkin/lexer/vi.rb +0 -1198
- data/lib/gherkin/lexer/zh_cn.rb +0 -1058
- data/lib/gherkin/lexer/zh_tw.rb +0 -1052
- data/lib/gherkin/listener/event.rb +0 -45
- data/lib/gherkin/listener/formatter_listener.rb +0 -150
- data/lib/gherkin/native.rb +0 -7
- data/lib/gherkin/native/java.rb +0 -72
- data/lib/gherkin/native/null.rb +0 -5
- data/lib/gherkin/native/therubyracer.rb +0 -41
- data/lib/gherkin/parser/meta.txt +0 -5
- data/lib/gherkin/parser/parser.rb +0 -166
- data/lib/gherkin/parser/root.txt +0 -11
- data/lib/gherkin/parser/steps.txt +0 -4
- data/lib/gherkin/platform.rb +0 -13
- data/lib/gherkin/rubify.rb +0 -31
- data/lib/gherkin/tag_expression.rb +0 -63
- data/ragel/lexer.c.rl.erb +0 -454
- data/ragel/lexer.java.rl.erb +0 -219
- data/ragel/lexer.js.rl.erb +0 -322
- data/ragel/lexer.rb.rl.erb +0 -179
- data/ragel/lexer_common.rl.erb +0 -50
- data/spec/gherkin/c_lexer_spec.rb +0 -22
- data/spec/gherkin/fixtures/1.feature +0 -8
- data/spec/gherkin/fixtures/comments_in_table.feature +0 -9
- data/spec/gherkin/fixtures/complex.feature +0 -45
- data/spec/gherkin/fixtures/complex.json +0 -139
- data/spec/gherkin/fixtures/complex_for_filtering.feature +0 -60
- data/spec/gherkin/fixtures/complex_with_tags.feature +0 -61
- data/spec/gherkin/fixtures/dos_line_endings.feature +0 -45
- data/spec/gherkin/fixtures/examples_with_only_header.feature +0 -14
- data/spec/gherkin/fixtures/hantu_pisang.feature +0 -35
- data/spec/gherkin/fixtures/i18n_fr.feature +0 -14
- data/spec/gherkin/fixtures/i18n_fr2.feature +0 -8
- data/spec/gherkin/fixtures/i18n_no.feature +0 -7
- data/spec/gherkin/fixtures/i18n_pt1.feature +0 -44
- data/spec/gherkin/fixtures/i18n_pt2.feature +0 -4
- data/spec/gherkin/fixtures/i18n_pt3.feature +0 -4
- data/spec/gherkin/fixtures/i18n_pt4.feature +0 -4
- data/spec/gherkin/fixtures/i18n_zh-CN.feature +0 -9
- data/spec/gherkin/fixtures/iso-8859-1.feature +0 -6
- data/spec/gherkin/fixtures/issue_145.feature +0 -22
- data/spec/gherkin/fixtures/scenario_outline_with_tags.feature +0 -13
- data/spec/gherkin/fixtures/scenario_without_steps.feature +0 -5
- data/spec/gherkin/fixtures/simple_with_comments.feature +0 -7
- data/spec/gherkin/fixtures/simple_with_tags.feature +0 -11
- data/spec/gherkin/fixtures/with_bom.feature +0 -3
- data/spec/gherkin/fixtures/with_bom_and_language_spec.feature +0 -4
- data/spec/gherkin/formatter/ansi_escapes_spec.rb +0 -32
- data/spec/gherkin/formatter/filter_formatter_spec.rb +0 -204
- data/spec/gherkin/formatter/json_formatter_spec.rb +0 -179
- data/spec/gherkin/formatter/model_spec.rb +0 -28
- data/spec/gherkin/formatter/pretty_formatter_spec.rb +0 -184
- data/spec/gherkin/formatter/spaces.feature +0 -9
- data/spec/gherkin/formatter/step_printer_spec.rb +0 -55
- data/spec/gherkin/formatter/tabs.feature +0 -9
- data/spec/gherkin/formatter/tag_count_formatter_spec.rb +0 -30
- data/spec/gherkin/i18n_spec.rb +0 -256
- data/spec/gherkin/java_lexer_spec.rb +0 -20
- data/spec/gherkin/json_parser_spec.rb +0 -165
- data/spec/gherkin/lexer/i18n_lexer_spec.rb +0 -65
- data/spec/gherkin/native_lexer_spec.rb +0 -29
- data/spec/gherkin/parser/parser_spec.rb +0 -16
- data/spec/gherkin/rubify_spec.rb +0 -23
- data/spec/gherkin/sexp_recorder.rb +0 -59
- data/spec/gherkin/shared/doc_string_group.rb +0 -161
- data/spec/gherkin/shared/encoding_group.rb +0 -48
- data/spec/gherkin/shared/lexer_group.rb +0 -589
- data/spec/gherkin/shared/row_group.rb +0 -123
- data/spec/gherkin/shared/tags_group.rb +0 -52
- data/spec/gherkin/tag_expression_spec.rb +0 -146
- data/spec/spec_helper.rb +0 -94
- data/tasks/apidoc.rake +0 -32
- data/tasks/bench.rake +0 -184
- data/tasks/bench/feature_builder.rb +0 -49
- data/tasks/bench/null_listener.rb +0 -4
- data/tasks/compile.rake +0 -83
- data/tasks/cucumber.rake +0 -23
- data/tasks/gems.rake +0 -46
- data/tasks/ikvm.rake +0 -126
- data/tasks/ragel_task.rb +0 -124
- data/tasks/release.rake +0 -34
- data/tasks/rspec.rake +0 -6
- data/tasks/yard/default/layout/html/bubble_32x32.png +0 -0
- data/tasks/yard/default/layout/html/bubble_48x48.png +0 -0
- data/tasks/yard/default/layout/html/footer.erb +0 -5
- data/tasks/yard/default/layout/html/index.erb +0 -1
- data/tasks/yard/default/layout/html/layout.erb +0 -25
- data/tasks/yard/default/layout/html/logo.erb +0 -1
- 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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 616936d9b8360845b1bc12aa9977027ca9798a70
|
4
|
+
data.tar.gz: e86bcaf18d78f4eae825334729b858b144cddb06
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a92897921797ebde32ca547eada1292adb5b338d4d3bd4b26328c361a22032460e9b117bb4acc133a19259b8aeae2b33053bed63747d4391c9521e235053db2f
|
7
|
+
data.tar.gz: c3a596f0c6f3d18088e2861dc40b7635a6d196f3aeceb9bf4eea6fbc17498d7470d6549235c103e996159f90141bc10da56ec98384179e3b66b706faf76f9e61
|
data/.travis.yml
CHANGED
@@ -1,15 +1,2 @@
|
|
1
|
-
|
2
|
-
|
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
|
data/CONTRIBUTING.md
ADDED
@@ -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
data/LICENSE
CHANGED
@@ -1,20 +1,21 @@
|
|
1
|
-
|
1
|
+
The MIT License (MIT)
|
2
2
|
|
3
|
-
|
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
|
-
|
12
|
-
|
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
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
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.
|
data/Makefile
ADDED
@@ -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.
|
1
|
+
[![Build Status](https://secure.travis-ci.org/cucumber/gherkin-ruby.svg)](http://travis-ci.org/cucumber/gherkin-ruby)
|
2
2
|
|
3
|
-
|
3
|
+
Gherkin parser/compiler for Ruby. Please see [Gherkin](https://github.com/cucumber/gherkin) for details.
|
4
4
|
|
5
|
-
|
6
|
-
* This library.
|
5
|
+
## Developers
|
7
6
|
|
8
|
-
|
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
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
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
|
+
~~~
|