gherkin 2.11.6-x86-mingw32 → 2.11.7-x86-mingw32
Sign up to get free protection for your applications and to get access to all the features.
- data/.travis.yml +0 -1
- data/Gemfile +1 -1
- data/History.md +13 -0
- data/README.md +10 -4
- data/examples/parse_and_output_json.rb +2 -2
- data/features/.cucumber/stepdefs.json +66 -66
- data/features/step_definitions/json_formatter_steps.rb +4 -4
- data/features/step_definitions/json_parser_steps.rb +2 -1
- data/features/support/env.rb +2 -3
- data/gherkin.gemspec +8 -6
- data/lib/1.8/gherkin_lexer_ar.so +0 -0
- data/lib/1.8/gherkin_lexer_bg.so +0 -0
- data/lib/1.8/gherkin_lexer_bm.so +0 -0
- data/lib/1.8/gherkin_lexer_ca.so +0 -0
- data/lib/1.8/gherkin_lexer_cs.so +0 -0
- data/lib/1.8/gherkin_lexer_cy_gb.so +0 -0
- data/lib/1.8/gherkin_lexer_da.so +0 -0
- data/lib/1.8/gherkin_lexer_de.so +0 -0
- data/lib/1.8/gherkin_lexer_el.so +0 -0
- data/lib/1.8/gherkin_lexer_en.so +0 -0
- data/lib/1.8/gherkin_lexer_en_au.so +0 -0
- data/lib/1.8/gherkin_lexer_en_lol.so +0 -0
- data/lib/1.8/gherkin_lexer_en_old.so +0 -0
- data/lib/1.8/gherkin_lexer_en_pirate.so +0 -0
- data/lib/1.8/gherkin_lexer_en_scouse.so +0 -0
- data/lib/1.8/gherkin_lexer_en_tx.so +0 -0
- data/lib/1.8/gherkin_lexer_eo.so +0 -0
- data/lib/1.8/gherkin_lexer_es.so +0 -0
- data/lib/1.8/gherkin_lexer_et.so +0 -0
- data/lib/1.8/gherkin_lexer_fa.so +0 -0
- data/lib/1.8/gherkin_lexer_fi.so +0 -0
- data/lib/1.8/gherkin_lexer_fr.so +0 -0
- data/lib/1.8/gherkin_lexer_he.so +0 -0
- data/lib/1.8/gherkin_lexer_hi.so +0 -0
- data/lib/1.8/gherkin_lexer_hr.so +0 -0
- data/lib/1.8/gherkin_lexer_hu.so +0 -0
- data/lib/1.8/gherkin_lexer_id.so +0 -0
- data/lib/1.8/gherkin_lexer_is.so +0 -0
- data/lib/1.8/gherkin_lexer_it.so +0 -0
- data/lib/1.8/gherkin_lexer_ja.so +0 -0
- data/lib/1.8/gherkin_lexer_ko.so +0 -0
- data/lib/1.8/gherkin_lexer_lt.so +0 -0
- data/lib/1.8/gherkin_lexer_lu.so +0 -0
- data/lib/1.8/gherkin_lexer_lv.so +0 -0
- data/lib/1.8/gherkin_lexer_nl.so +0 -0
- data/lib/1.8/gherkin_lexer_no.so +0 -0
- data/lib/1.8/gherkin_lexer_pl.so +0 -0
- data/lib/1.8/gherkin_lexer_pt.so +0 -0
- data/lib/1.8/gherkin_lexer_ro.so +0 -0
- data/lib/1.8/gherkin_lexer_ru.so +0 -0
- data/lib/1.8/gherkin_lexer_sk.so +0 -0
- data/lib/1.8/gherkin_lexer_sr_cyrl.so +0 -0
- data/lib/1.8/gherkin_lexer_sr_latn.so +0 -0
- data/lib/1.8/gherkin_lexer_sv.so +0 -0
- data/lib/1.8/gherkin_lexer_tl.so +0 -0
- data/lib/1.8/gherkin_lexer_tr.so +0 -0
- data/lib/1.8/gherkin_lexer_tt.so +0 -0
- data/lib/1.8/gherkin_lexer_uk.so +0 -0
- data/lib/1.8/gherkin_lexer_uz.so +0 -0
- data/lib/1.8/gherkin_lexer_vi.so +0 -0
- data/lib/1.8/gherkin_lexer_zh_cn.so +0 -0
- data/lib/1.8/gherkin_lexer_zh_tw.so +0 -0
- data/lib/1.9/gherkin_lexer_ar.so +0 -0
- data/lib/1.9/gherkin_lexer_bg.so +0 -0
- data/lib/1.9/gherkin_lexer_bm.so +0 -0
- data/lib/1.9/gherkin_lexer_ca.so +0 -0
- data/lib/1.9/gherkin_lexer_cs.so +0 -0
- data/lib/1.9/gherkin_lexer_cy_gb.so +0 -0
- data/lib/1.9/gherkin_lexer_da.so +0 -0
- data/lib/1.9/gherkin_lexer_de.so +0 -0
- data/lib/1.9/gherkin_lexer_el.so +0 -0
- data/lib/1.9/gherkin_lexer_en.so +0 -0
- data/lib/1.9/gherkin_lexer_en_au.so +0 -0
- data/lib/1.9/gherkin_lexer_en_lol.so +0 -0
- data/lib/1.9/gherkin_lexer_en_old.so +0 -0
- data/lib/1.9/gherkin_lexer_en_pirate.so +0 -0
- data/lib/1.9/gherkin_lexer_en_scouse.so +0 -0
- data/lib/1.9/gherkin_lexer_en_tx.so +0 -0
- data/lib/1.9/gherkin_lexer_eo.so +0 -0
- data/lib/1.9/gherkin_lexer_es.so +0 -0
- data/lib/1.9/gherkin_lexer_et.so +0 -0
- data/lib/1.9/gherkin_lexer_fa.so +0 -0
- data/lib/1.9/gherkin_lexer_fi.so +0 -0
- data/lib/1.9/gherkin_lexer_fr.so +0 -0
- data/lib/1.9/gherkin_lexer_he.so +0 -0
- data/lib/1.9/gherkin_lexer_hi.so +0 -0
- data/lib/1.9/gherkin_lexer_hr.so +0 -0
- data/lib/1.9/gherkin_lexer_hu.so +0 -0
- data/lib/1.9/gherkin_lexer_id.so +0 -0
- data/lib/1.9/gherkin_lexer_is.so +0 -0
- data/lib/1.9/gherkin_lexer_it.so +0 -0
- data/lib/1.9/gherkin_lexer_ja.so +0 -0
- data/lib/1.9/gherkin_lexer_ko.so +0 -0
- data/lib/1.9/gherkin_lexer_lt.so +0 -0
- data/lib/1.9/gherkin_lexer_lu.so +0 -0
- data/lib/1.9/gherkin_lexer_lv.so +0 -0
- data/lib/1.9/gherkin_lexer_nl.so +0 -0
- data/lib/1.9/gherkin_lexer_no.so +0 -0
- data/lib/1.9/gherkin_lexer_pl.so +0 -0
- data/lib/1.9/gherkin_lexer_pt.so +0 -0
- data/lib/1.9/gherkin_lexer_ro.so +0 -0
- data/lib/1.9/gherkin_lexer_ru.so +0 -0
- data/lib/1.9/gherkin_lexer_sk.so +0 -0
- data/lib/1.9/gherkin_lexer_sr_cyrl.so +0 -0
- data/lib/1.9/gherkin_lexer_sr_latn.so +0 -0
- data/lib/1.9/gherkin_lexer_sv.so +0 -0
- data/lib/1.9/gherkin_lexer_tl.so +0 -0
- data/lib/1.9/gherkin_lexer_tr.so +0 -0
- data/lib/1.9/gherkin_lexer_tt.so +0 -0
- data/lib/1.9/gherkin_lexer_uk.so +0 -0
- data/lib/1.9/gherkin_lexer_uz.so +0 -0
- data/lib/1.9/gherkin_lexer_vi.so +0 -0
- data/lib/1.9/gherkin_lexer_zh_cn.so +0 -0
- data/lib/1.9/gherkin_lexer_zh_tw.so +0 -0
- data/lib/gherkin/formatter/json_formatter.rb +5 -5
- data/lib/gherkin/formatter/tag_filter.rb +2 -2
- data/lib/gherkin/i18n.json +28 -0
- data/lib/gherkin/i18n.rb +6 -6
- data/lib/gherkin/json_parser.rb +4 -4
- data/lib/gherkin/native/java.rb +2 -2
- data/lib/gherkin/parser/parser.rb +1 -0
- data/lib/gherkin/platform.rb +12 -0
- data/lib/gherkin/tag_expression.rb +7 -1
- data/spec/gherkin/formatter/json_formatter_spec.rb +74 -3
- data/spec/gherkin/i18n_spec.rb +2 -0
- data/spec/gherkin/json_parser_spec.rb +11 -10
- data/spec/gherkin/parser/parser_spec.rb +1 -1
- data/spec/gherkin/tag_expression_spec.rb +19 -15
- data/spec/spec_helper.rb +4 -1
- data/tasks/rspec.rake +1 -2
- metadata +103 -166
- data/lib/gherkin/lexer/tl.rb +0 -1723
- data/lib/gherkin/lexer/tt.rb +0 -1640
- data/spec/gherkin/output_stream_string_io.rb +0 -20
data/features/support/env.rb
CHANGED
@@ -13,7 +13,6 @@ Bundler.setup
|
|
13
13
|
end
|
14
14
|
require 'gherkin'
|
15
15
|
require 'gherkin/sexp_recorder'
|
16
|
-
require 'gherkin/output_stream_string_io'
|
17
16
|
|
18
17
|
module TransformHelpers
|
19
18
|
def tr_line_number(step_arg)
|
@@ -31,12 +30,12 @@ end
|
|
31
30
|
|
32
31
|
class GherkinWorld
|
33
32
|
include TransformHelpers
|
34
|
-
|
33
|
+
|
35
34
|
def initialize
|
36
35
|
@formatter = Gherkin::SexpRecorder.new
|
37
36
|
end
|
38
37
|
end
|
39
38
|
|
40
|
-
World do
|
39
|
+
World do
|
41
40
|
GherkinWorld.new
|
42
41
|
end
|
data/gherkin.gemspec
CHANGED
@@ -1,4 +1,6 @@
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
2
|
+
$LOAD_PATH.unshift File.expand_path("../lib", __FILE__)
|
3
|
+
require 'gherkin/platform'
|
2
4
|
|
3
5
|
Gem::Specification.new do |s|
|
4
6
|
s.name = "gherkin"
|
@@ -12,10 +14,10 @@ Gem::Specification.new do |s|
|
|
12
14
|
#
|
13
15
|
# Repeat these step for cucumber (swap `cucumber` with `gherkin`).
|
14
16
|
#
|
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
|
17
|
+
# 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
18
|
# and release both projects. Do this for both ruby 1.8.7, ruby 1.9.3 and jruby.
|
17
19
|
#
|
18
|
-
s.version =
|
20
|
+
s.version = Gherkin::VERSION
|
19
21
|
s.authors = ["Mike Sassak", "Gregory Hnatiuk", "Aslak Hellesøy"]
|
20
22
|
s.description = "A fast Gherkin lexer/parser based on the Ragel State Machine Compiler."
|
21
23
|
s.summary = "#{s.name}-#{s.version}"
|
@@ -36,11 +38,11 @@ Gem::Specification.new do |s|
|
|
36
38
|
s.files -= Dir['lib/**/*.dll']
|
37
39
|
s.files -= Dir['lib/**/*.bundle']
|
38
40
|
s.files -= Dir['lib/**/*.so']
|
39
|
-
|
41
|
+
|
40
42
|
if ENV['GEM_PLATFORM']
|
41
43
|
puts "GEM_PLATFORM:#{ENV['GEM_PLATFORM']}"
|
42
44
|
end
|
43
|
-
s.platform = ENV['GEM_PLATFORM'] if ENV['GEM_PLATFORM']
|
45
|
+
s.platform = ENV['GEM_PLATFORM'] if ENV['GEM_PLATFORM']
|
44
46
|
case s.platform.to_s
|
45
47
|
when /java/
|
46
48
|
s.files += Dir['lib/*.jar']
|
@@ -56,7 +58,7 @@ Gem::Specification.new do |s|
|
|
56
58
|
end
|
57
59
|
s.files -= Dir['**/.gitignore']
|
58
60
|
|
59
|
-
s.add_runtime_dependency('
|
61
|
+
s.add_runtime_dependency('multi_json', '~> 1.3')
|
60
62
|
|
61
63
|
s.add_development_dependency('cucumber', '>= 1.2.1')
|
62
64
|
s.add_development_dependency('rake', '>= 10.0.3')
|
@@ -64,7 +66,7 @@ Gem::Specification.new do |s|
|
|
64
66
|
s.add_development_dependency('rspec', '~> 2.12.0')
|
65
67
|
s.add_development_dependency('rubyzip', '>= 0.9.9')
|
66
68
|
|
67
|
-
unless ENV['RUBY_CC_VERSION'] ||
|
69
|
+
unless ENV['RUBY_CC_VERSION'] || Gherkin::JRUBY
|
68
70
|
s.add_development_dependency('therubyracer', '>= 0.11.2') if ENV['GHERKIN_JS']
|
69
71
|
# For Documentation:
|
70
72
|
s.add_development_dependency('yard', '>= 0.8.3')
|
data/lib/1.8/gherkin_lexer_ar.so
CHANGED
Binary file
|
data/lib/1.8/gherkin_lexer_bg.so
CHANGED
Binary file
|
data/lib/1.8/gherkin_lexer_bm.so
CHANGED
Binary file
|
data/lib/1.8/gherkin_lexer_ca.so
CHANGED
Binary file
|
data/lib/1.8/gherkin_lexer_cs.so
CHANGED
Binary file
|
Binary file
|
data/lib/1.8/gherkin_lexer_da.so
CHANGED
Binary file
|
data/lib/1.8/gherkin_lexer_de.so
CHANGED
Binary file
|
Binary file
|
data/lib/1.8/gherkin_lexer_en.so
CHANGED
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
data/lib/1.8/gherkin_lexer_eo.so
CHANGED
Binary file
|
data/lib/1.8/gherkin_lexer_es.so
CHANGED
Binary file
|
data/lib/1.8/gherkin_lexer_et.so
CHANGED
Binary file
|
data/lib/1.8/gherkin_lexer_fa.so
CHANGED
Binary file
|
data/lib/1.8/gherkin_lexer_fi.so
CHANGED
Binary file
|
data/lib/1.8/gherkin_lexer_fr.so
CHANGED
Binary file
|
data/lib/1.8/gherkin_lexer_he.so
CHANGED
Binary file
|
data/lib/1.8/gherkin_lexer_hi.so
CHANGED
Binary file
|
data/lib/1.8/gherkin_lexer_hr.so
CHANGED
Binary file
|
data/lib/1.8/gherkin_lexer_hu.so
CHANGED
Binary file
|
data/lib/1.8/gherkin_lexer_id.so
CHANGED
Binary file
|
data/lib/1.8/gherkin_lexer_is.so
CHANGED
Binary file
|
data/lib/1.8/gherkin_lexer_it.so
CHANGED
Binary file
|
data/lib/1.8/gherkin_lexer_ja.so
CHANGED
Binary file
|
data/lib/1.8/gherkin_lexer_ko.so
CHANGED
Binary file
|
data/lib/1.8/gherkin_lexer_lt.so
CHANGED
Binary file
|
data/lib/1.8/gherkin_lexer_lu.so
CHANGED
Binary file
|
data/lib/1.8/gherkin_lexer_lv.so
CHANGED
Binary file
|
data/lib/1.8/gherkin_lexer_nl.so
CHANGED
Binary file
|
data/lib/1.8/gherkin_lexer_no.so
CHANGED
Binary file
|
data/lib/1.8/gherkin_lexer_pl.so
CHANGED
Binary file
|
data/lib/1.8/gherkin_lexer_pt.so
CHANGED
Binary file
|
data/lib/1.8/gherkin_lexer_ro.so
CHANGED
Binary file
|
data/lib/1.8/gherkin_lexer_ru.so
CHANGED
Binary file
|
data/lib/1.8/gherkin_lexer_sk.so
CHANGED
Binary file
|
Binary file
|
Binary file
|
data/lib/1.8/gherkin_lexer_sv.so
CHANGED
Binary file
|
data/lib/1.8/gherkin_lexer_tl.so
CHANGED
Binary file
|
data/lib/1.8/gherkin_lexer_tr.so
CHANGED
Binary file
|
data/lib/1.8/gherkin_lexer_tt.so
CHANGED
Binary file
|
data/lib/1.8/gherkin_lexer_uk.so
CHANGED
Binary file
|
data/lib/1.8/gherkin_lexer_uz.so
CHANGED
Binary file
|
data/lib/1.8/gherkin_lexer_vi.so
CHANGED
Binary file
|
Binary file
|
Binary file
|
data/lib/1.9/gherkin_lexer_ar.so
CHANGED
Binary file
|
data/lib/1.9/gherkin_lexer_bg.so
CHANGED
Binary file
|
data/lib/1.9/gherkin_lexer_bm.so
CHANGED
Binary file
|
data/lib/1.9/gherkin_lexer_ca.so
CHANGED
Binary file
|
data/lib/1.9/gherkin_lexer_cs.so
CHANGED
Binary file
|
Binary file
|
data/lib/1.9/gherkin_lexer_da.so
CHANGED
Binary file
|
data/lib/1.9/gherkin_lexer_de.so
CHANGED
Binary file
|
Binary file
|
data/lib/1.9/gherkin_lexer_en.so
CHANGED
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
data/lib/1.9/gherkin_lexer_eo.so
CHANGED
Binary file
|
data/lib/1.9/gherkin_lexer_es.so
CHANGED
Binary file
|
data/lib/1.9/gherkin_lexer_et.so
CHANGED
Binary file
|
data/lib/1.9/gherkin_lexer_fa.so
CHANGED
Binary file
|
data/lib/1.9/gherkin_lexer_fi.so
CHANGED
Binary file
|
data/lib/1.9/gherkin_lexer_fr.so
CHANGED
Binary file
|
data/lib/1.9/gherkin_lexer_he.so
CHANGED
Binary file
|
data/lib/1.9/gherkin_lexer_hi.so
CHANGED
Binary file
|
data/lib/1.9/gherkin_lexer_hr.so
CHANGED
Binary file
|
data/lib/1.9/gherkin_lexer_hu.so
CHANGED
Binary file
|
data/lib/1.9/gherkin_lexer_id.so
CHANGED
Binary file
|
data/lib/1.9/gherkin_lexer_is.so
CHANGED
Binary file
|
data/lib/1.9/gherkin_lexer_it.so
CHANGED
Binary file
|
data/lib/1.9/gherkin_lexer_ja.so
CHANGED
Binary file
|
data/lib/1.9/gherkin_lexer_ko.so
CHANGED
Binary file
|
data/lib/1.9/gherkin_lexer_lt.so
CHANGED
Binary file
|
data/lib/1.9/gherkin_lexer_lu.so
CHANGED
Binary file
|
data/lib/1.9/gherkin_lexer_lv.so
CHANGED
Binary file
|
data/lib/1.9/gherkin_lexer_nl.so
CHANGED
Binary file
|
data/lib/1.9/gherkin_lexer_no.so
CHANGED
Binary file
|
data/lib/1.9/gherkin_lexer_pl.so
CHANGED
Binary file
|
data/lib/1.9/gherkin_lexer_pt.so
CHANGED
Binary file
|
data/lib/1.9/gherkin_lexer_ro.so
CHANGED
Binary file
|
data/lib/1.9/gherkin_lexer_ru.so
CHANGED
Binary file
|
data/lib/1.9/gherkin_lexer_sk.so
CHANGED
Binary file
|
Binary file
|
Binary file
|
data/lib/1.9/gherkin_lexer_sv.so
CHANGED
Binary file
|
data/lib/1.9/gherkin_lexer_tl.so
CHANGED
Binary file
|
data/lib/1.9/gherkin_lexer_tr.so
CHANGED
Binary file
|
data/lib/1.9/gherkin_lexer_tt.so
CHANGED
Binary file
|
data/lib/1.9/gherkin_lexer_uk.so
CHANGED
Binary file
|
data/lib/1.9/gherkin_lexer_uz.so
CHANGED
Binary file
|
data/lib/1.9/gherkin_lexer_vi.so
CHANGED
Binary file
|
Binary file
|
Binary file
|
@@ -1,4 +1,4 @@
|
|
1
|
-
require '
|
1
|
+
require 'multi_json'
|
2
2
|
require 'gherkin/formatter/model'
|
3
3
|
require 'gherkin/native'
|
4
4
|
require 'base64'
|
@@ -9,9 +9,9 @@ module Gherkin
|
|
9
9
|
# be turned into JSON.
|
10
10
|
class JSONFormatter
|
11
11
|
native_impl('gherkin')
|
12
|
-
|
12
|
+
|
13
13
|
include Base64
|
14
|
-
|
14
|
+
|
15
15
|
def initialize(io)
|
16
16
|
raise "Must be writeable" unless io.respond_to?(:write)
|
17
17
|
@io = io
|
@@ -20,7 +20,7 @@ module Gherkin
|
|
20
20
|
end
|
21
21
|
|
22
22
|
def done
|
23
|
-
@io.write(@feature_hashes
|
23
|
+
@io.write(MultiJson.dump(@feature_hashes, :pretty => true))
|
24
24
|
end
|
25
25
|
|
26
26
|
def uri(uri)
|
@@ -61,7 +61,7 @@ module Gherkin
|
|
61
61
|
def result(result)
|
62
62
|
@current_step_or_hook['result'] = result.to_hash
|
63
63
|
end
|
64
|
-
|
64
|
+
|
65
65
|
def append_duration(timestamp)
|
66
66
|
#check to make sure result exists (scenario outlines do not have results yet)
|
67
67
|
if !@current_step_or_hook['result'].nil?
|
data/lib/gherkin/i18n.json
CHANGED
@@ -125,6 +125,20 @@
|
|
125
125
|
"and": "*|Und",
|
126
126
|
"but": "*|Aber"
|
127
127
|
},
|
128
|
+
"el": {
|
129
|
+
"name": "Greek",
|
130
|
+
"native": "Ελληνικά",
|
131
|
+
"feature": "Δυνατότητα|Λειτουργία",
|
132
|
+
"background": "Υπόβαθρο",
|
133
|
+
"scenario": "Σενάριο",
|
134
|
+
"scenario_outline": "Περιγραφή Σεναρίου",
|
135
|
+
"examples": "Παραδείγματα|Σενάρια",
|
136
|
+
"given": "*|Δεδομένου|Δεδομένου ότι",
|
137
|
+
"when": "*|Όταν",
|
138
|
+
"then": "*|Τότε",
|
139
|
+
"and": "*|Και",
|
140
|
+
"but": "*|Αλλά"
|
141
|
+
},
|
128
142
|
"en-au": {
|
129
143
|
"name": "Australian",
|
130
144
|
"native": "Australian",
|
@@ -153,6 +167,20 @@
|
|
153
167
|
"and": "*|AN",
|
154
168
|
"but": "*|BUT"
|
155
169
|
},
|
170
|
+
"en-old": {
|
171
|
+
"name": "Old English",
|
172
|
+
"native": "Englisc",
|
173
|
+
"feature": "Hwaet|Hwæt",
|
174
|
+
"background": "Aer|Ær",
|
175
|
+
"scenario": "Swa",
|
176
|
+
"scenario_outline": "Swa hwaer swa|Swa hwær swa",
|
177
|
+
"examples": "Se the|Se þe|Se ðe",
|
178
|
+
"given": "*|Thurh|Þurh|Ðurh",
|
179
|
+
"when": "*|Tha|Þa|Ða",
|
180
|
+
"then": "*|Tha|Þa|Ða|Tha the|Þa þe|Ða ðe",
|
181
|
+
"and": "*|Ond|7",
|
182
|
+
"but": "*|Ac"
|
183
|
+
},
|
156
184
|
"en-pirate": {
|
157
185
|
"name": "Pirate",
|
158
186
|
"native": "Pirate",
|
data/lib/gherkin/i18n.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
|
-
require 'json'
|
2
1
|
require 'gherkin/rubify'
|
3
2
|
require 'gherkin/native'
|
3
|
+
require 'multi_json'
|
4
4
|
|
5
5
|
module Gherkin
|
6
6
|
class I18n
|
@@ -11,7 +11,7 @@ module Gherkin
|
|
11
11
|
FEATURE_ELEMENT_KEYS = %w{feature background scenario scenario_outline examples}
|
12
12
|
STEP_KEYWORD_KEYS = %w{given when then and but}
|
13
13
|
KEYWORD_KEYS = FEATURE_ELEMENT_KEYS + STEP_KEYWORD_KEYS
|
14
|
-
LANGUAGES =
|
14
|
+
LANGUAGES = MultiJson.load(File.open(File.dirname(__FILE__) + '/i18n.json', 'r:utf-8').read)
|
15
15
|
|
16
16
|
class << self
|
17
17
|
include Rubify
|
@@ -30,7 +30,7 @@ module Gherkin
|
|
30
30
|
# there is typically a code generation tool to generate regular expressions for recognising the
|
31
31
|
# various I18n translations of Gherkin's keywords.
|
32
32
|
#
|
33
|
-
# The +keywords+ arguments can be one of <tt>:feature</tt>, <tt>:background</tt>, <tt>:scenario</tt>,
|
33
|
+
# The +keywords+ arguments can be one of <tt>:feature</tt>, <tt>:background</tt>, <tt>:scenario</tt>,
|
34
34
|
# <tt>:scenario_outline</tt>, <tt>:examples</tt>, <tt>:step</tt>.
|
35
35
|
def keyword_regexp(*keywords)
|
36
36
|
unique_keywords = all.map do |i18n|
|
@@ -42,7 +42,7 @@ module Gherkin
|
|
42
42
|
end
|
43
43
|
end
|
44
44
|
end
|
45
|
-
|
45
|
+
|
46
46
|
unique_keywords.flatten.compact.map{|kw| kw.to_s}.sort.reverse.uniq.join('|').gsub(/\*/, '\*')
|
47
47
|
end
|
48
48
|
|
@@ -150,14 +150,14 @@ module Gherkin
|
|
150
150
|
gherkin_keyword_table = KEYWORD_KEYS.map do |key|
|
151
151
|
Formatter::Model::Row.new([], [key, keywords(key).map{|keyword| %{"#{keyword}"}}.join(', ')], nil)
|
152
152
|
end
|
153
|
-
|
153
|
+
|
154
154
|
code_keyword_table = STEP_KEYWORD_KEYS.map do |key|
|
155
155
|
code_keywords = keywords(key).reject{|keyword| keyword == '* '}.map do |keyword|
|
156
156
|
%{"#{self.class.code_keyword_for(keyword)}"}
|
157
157
|
end.join(', ')
|
158
158
|
Formatter::Model::Row.new([], ["#{key} (code)", code_keywords], nil)
|
159
159
|
end
|
160
|
-
|
160
|
+
|
161
161
|
pf.table(gherkin_keyword_table + code_keyword_table)
|
162
162
|
io.string
|
163
163
|
end
|
data/lib/gherkin/json_parser.rb
CHANGED
@@ -1,8 +1,8 @@
|
|
1
|
-
require '
|
2
|
-
require 'gherkin/formatter/model'
|
1
|
+
require 'base64'
|
3
2
|
require 'gherkin/formatter/argument'
|
3
|
+
require 'gherkin/formatter/model'
|
4
4
|
require 'gherkin/native'
|
5
|
-
require '
|
5
|
+
require 'multi_json'
|
6
6
|
|
7
7
|
module Gherkin
|
8
8
|
class JSONParser
|
@@ -17,7 +17,7 @@ module Gherkin
|
|
17
17
|
# Parse a gherkin object +o+, which can either be a JSON String,
|
18
18
|
# or a Hash (from a parsed JSON String).
|
19
19
|
def parse(o)
|
20
|
-
o =
|
20
|
+
o = MultiJson.load(o) if String === o
|
21
21
|
|
22
22
|
o.each do |f|
|
23
23
|
@formatter.uri(f['uri'])
|