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.
Files changed (134) hide show
  1. data/.travis.yml +0 -1
  2. data/Gemfile +1 -1
  3. data/History.md +13 -0
  4. data/README.md +10 -4
  5. data/examples/parse_and_output_json.rb +2 -2
  6. data/features/.cucumber/stepdefs.json +66 -66
  7. data/features/step_definitions/json_formatter_steps.rb +4 -4
  8. data/features/step_definitions/json_parser_steps.rb +2 -1
  9. data/features/support/env.rb +2 -3
  10. data/gherkin.gemspec +8 -6
  11. data/lib/1.8/gherkin_lexer_ar.so +0 -0
  12. data/lib/1.8/gherkin_lexer_bg.so +0 -0
  13. data/lib/1.8/gherkin_lexer_bm.so +0 -0
  14. data/lib/1.8/gherkin_lexer_ca.so +0 -0
  15. data/lib/1.8/gherkin_lexer_cs.so +0 -0
  16. data/lib/1.8/gherkin_lexer_cy_gb.so +0 -0
  17. data/lib/1.8/gherkin_lexer_da.so +0 -0
  18. data/lib/1.8/gherkin_lexer_de.so +0 -0
  19. data/lib/1.8/gherkin_lexer_el.so +0 -0
  20. data/lib/1.8/gherkin_lexer_en.so +0 -0
  21. data/lib/1.8/gherkin_lexer_en_au.so +0 -0
  22. data/lib/1.8/gherkin_lexer_en_lol.so +0 -0
  23. data/lib/1.8/gherkin_lexer_en_old.so +0 -0
  24. data/lib/1.8/gherkin_lexer_en_pirate.so +0 -0
  25. data/lib/1.8/gherkin_lexer_en_scouse.so +0 -0
  26. data/lib/1.8/gherkin_lexer_en_tx.so +0 -0
  27. data/lib/1.8/gherkin_lexer_eo.so +0 -0
  28. data/lib/1.8/gherkin_lexer_es.so +0 -0
  29. data/lib/1.8/gherkin_lexer_et.so +0 -0
  30. data/lib/1.8/gherkin_lexer_fa.so +0 -0
  31. data/lib/1.8/gherkin_lexer_fi.so +0 -0
  32. data/lib/1.8/gherkin_lexer_fr.so +0 -0
  33. data/lib/1.8/gherkin_lexer_he.so +0 -0
  34. data/lib/1.8/gherkin_lexer_hi.so +0 -0
  35. data/lib/1.8/gherkin_lexer_hr.so +0 -0
  36. data/lib/1.8/gherkin_lexer_hu.so +0 -0
  37. data/lib/1.8/gherkin_lexer_id.so +0 -0
  38. data/lib/1.8/gherkin_lexer_is.so +0 -0
  39. data/lib/1.8/gherkin_lexer_it.so +0 -0
  40. data/lib/1.8/gherkin_lexer_ja.so +0 -0
  41. data/lib/1.8/gherkin_lexer_ko.so +0 -0
  42. data/lib/1.8/gherkin_lexer_lt.so +0 -0
  43. data/lib/1.8/gherkin_lexer_lu.so +0 -0
  44. data/lib/1.8/gherkin_lexer_lv.so +0 -0
  45. data/lib/1.8/gherkin_lexer_nl.so +0 -0
  46. data/lib/1.8/gherkin_lexer_no.so +0 -0
  47. data/lib/1.8/gherkin_lexer_pl.so +0 -0
  48. data/lib/1.8/gherkin_lexer_pt.so +0 -0
  49. data/lib/1.8/gherkin_lexer_ro.so +0 -0
  50. data/lib/1.8/gherkin_lexer_ru.so +0 -0
  51. data/lib/1.8/gherkin_lexer_sk.so +0 -0
  52. data/lib/1.8/gherkin_lexer_sr_cyrl.so +0 -0
  53. data/lib/1.8/gherkin_lexer_sr_latn.so +0 -0
  54. data/lib/1.8/gherkin_lexer_sv.so +0 -0
  55. data/lib/1.8/gherkin_lexer_tl.so +0 -0
  56. data/lib/1.8/gherkin_lexer_tr.so +0 -0
  57. data/lib/1.8/gherkin_lexer_tt.so +0 -0
  58. data/lib/1.8/gherkin_lexer_uk.so +0 -0
  59. data/lib/1.8/gherkin_lexer_uz.so +0 -0
  60. data/lib/1.8/gherkin_lexer_vi.so +0 -0
  61. data/lib/1.8/gherkin_lexer_zh_cn.so +0 -0
  62. data/lib/1.8/gherkin_lexer_zh_tw.so +0 -0
  63. data/lib/1.9/gherkin_lexer_ar.so +0 -0
  64. data/lib/1.9/gherkin_lexer_bg.so +0 -0
  65. data/lib/1.9/gherkin_lexer_bm.so +0 -0
  66. data/lib/1.9/gherkin_lexer_ca.so +0 -0
  67. data/lib/1.9/gherkin_lexer_cs.so +0 -0
  68. data/lib/1.9/gherkin_lexer_cy_gb.so +0 -0
  69. data/lib/1.9/gherkin_lexer_da.so +0 -0
  70. data/lib/1.9/gherkin_lexer_de.so +0 -0
  71. data/lib/1.9/gherkin_lexer_el.so +0 -0
  72. data/lib/1.9/gherkin_lexer_en.so +0 -0
  73. data/lib/1.9/gherkin_lexer_en_au.so +0 -0
  74. data/lib/1.9/gherkin_lexer_en_lol.so +0 -0
  75. data/lib/1.9/gherkin_lexer_en_old.so +0 -0
  76. data/lib/1.9/gherkin_lexer_en_pirate.so +0 -0
  77. data/lib/1.9/gherkin_lexer_en_scouse.so +0 -0
  78. data/lib/1.9/gherkin_lexer_en_tx.so +0 -0
  79. data/lib/1.9/gherkin_lexer_eo.so +0 -0
  80. data/lib/1.9/gherkin_lexer_es.so +0 -0
  81. data/lib/1.9/gherkin_lexer_et.so +0 -0
  82. data/lib/1.9/gherkin_lexer_fa.so +0 -0
  83. data/lib/1.9/gherkin_lexer_fi.so +0 -0
  84. data/lib/1.9/gherkin_lexer_fr.so +0 -0
  85. data/lib/1.9/gherkin_lexer_he.so +0 -0
  86. data/lib/1.9/gherkin_lexer_hi.so +0 -0
  87. data/lib/1.9/gherkin_lexer_hr.so +0 -0
  88. data/lib/1.9/gherkin_lexer_hu.so +0 -0
  89. data/lib/1.9/gherkin_lexer_id.so +0 -0
  90. data/lib/1.9/gherkin_lexer_is.so +0 -0
  91. data/lib/1.9/gherkin_lexer_it.so +0 -0
  92. data/lib/1.9/gherkin_lexer_ja.so +0 -0
  93. data/lib/1.9/gherkin_lexer_ko.so +0 -0
  94. data/lib/1.9/gherkin_lexer_lt.so +0 -0
  95. data/lib/1.9/gherkin_lexer_lu.so +0 -0
  96. data/lib/1.9/gherkin_lexer_lv.so +0 -0
  97. data/lib/1.9/gherkin_lexer_nl.so +0 -0
  98. data/lib/1.9/gherkin_lexer_no.so +0 -0
  99. data/lib/1.9/gherkin_lexer_pl.so +0 -0
  100. data/lib/1.9/gherkin_lexer_pt.so +0 -0
  101. data/lib/1.9/gherkin_lexer_ro.so +0 -0
  102. data/lib/1.9/gherkin_lexer_ru.so +0 -0
  103. data/lib/1.9/gherkin_lexer_sk.so +0 -0
  104. data/lib/1.9/gherkin_lexer_sr_cyrl.so +0 -0
  105. data/lib/1.9/gherkin_lexer_sr_latn.so +0 -0
  106. data/lib/1.9/gherkin_lexer_sv.so +0 -0
  107. data/lib/1.9/gherkin_lexer_tl.so +0 -0
  108. data/lib/1.9/gherkin_lexer_tr.so +0 -0
  109. data/lib/1.9/gherkin_lexer_tt.so +0 -0
  110. data/lib/1.9/gherkin_lexer_uk.so +0 -0
  111. data/lib/1.9/gherkin_lexer_uz.so +0 -0
  112. data/lib/1.9/gherkin_lexer_vi.so +0 -0
  113. data/lib/1.9/gherkin_lexer_zh_cn.so +0 -0
  114. data/lib/1.9/gherkin_lexer_zh_tw.so +0 -0
  115. data/lib/gherkin/formatter/json_formatter.rb +5 -5
  116. data/lib/gherkin/formatter/tag_filter.rb +2 -2
  117. data/lib/gherkin/i18n.json +28 -0
  118. data/lib/gherkin/i18n.rb +6 -6
  119. data/lib/gherkin/json_parser.rb +4 -4
  120. data/lib/gherkin/native/java.rb +2 -2
  121. data/lib/gherkin/parser/parser.rb +1 -0
  122. data/lib/gherkin/platform.rb +12 -0
  123. data/lib/gherkin/tag_expression.rb +7 -1
  124. data/spec/gherkin/formatter/json_formatter_spec.rb +74 -3
  125. data/spec/gherkin/i18n_spec.rb +2 -0
  126. data/spec/gherkin/json_parser_spec.rb +11 -10
  127. data/spec/gherkin/parser/parser_spec.rb +1 -1
  128. data/spec/gherkin/tag_expression_spec.rb +19 -15
  129. data/spec/spec_helper.rb +4 -1
  130. data/tasks/rspec.rake +1 -2
  131. metadata +103 -166
  132. data/lib/gherkin/lexer/tl.rb +0 -1723
  133. data/lib/gherkin/lexer/tt.rb +0 -1640
  134. data/spec/gherkin/output_stream_string_io.rb +0 -20
@@ -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
@@ -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 = "2.11.6"
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('json', '>= 1.7.6')
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'] || defined?(JRUBY_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')
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
@@ -1,4 +1,4 @@
1
- require 'json'
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.to_json)
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?
@@ -8,7 +8,7 @@ module Gherkin
8
8
  end
9
9
 
10
10
  def eval(tags, names, ranges)
11
- @tag_expression.eval(tags.uniq)
11
+ @tag_expression.evaluate(tags.uniq)
12
12
  end
13
13
 
14
14
  def filter_table_body_rows(rows)
@@ -16,4 +16,4 @@ module Gherkin
16
16
  end
17
17
  end
18
18
  end
19
- end
19
+ end
@@ -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",
@@ -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 = JSON.parse(File.open(File.dirname(__FILE__) + '/i18n.json', 'r:utf-8').read)
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
@@ -1,8 +1,8 @@
1
- require 'json'
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 'base64'
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 = JSON.parse(o) if String === o
20
+ o = MultiJson.load(o) if String === o
21
21
 
22
22
  o.each do |f|
23
23
  @formatter.uri(f['uri'])