gherkin 1.0.30 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (58) hide show
  1. data/.rspec +1 -0
  2. data/History.txt +19 -0
  3. data/Rakefile +4 -4
  4. data/VERSION.yml +2 -2
  5. data/features/feature_parser.feature +11 -0
  6. data/features/json_formatter.feature +238 -0
  7. data/features/pretty_formatter.feature +9 -0
  8. data/features/step_definitions/gherkin_steps.rb +1 -1
  9. data/features/step_definitions/json_formatter_steps.rb +32 -0
  10. data/features/step_definitions/pretty_formatter_steps.rb +24 -23
  11. data/features/support/env.rb +3 -3
  12. data/lib/gherkin/formatter/json_formatter.rb +82 -0
  13. data/lib/gherkin/formatter/pretty_formatter.rb +73 -78
  14. data/lib/gherkin/i18n.rb +22 -18
  15. data/lib/gherkin/i18n.yml +9 -9
  16. data/lib/gherkin/i18n_lexer.rb +2 -2
  17. data/lib/gherkin/parser/event.rb +6 -6
  18. data/lib/gherkin/parser/filter_listener.rb +5 -1
  19. data/lib/gherkin/parser/formatter_listener.rb +113 -0
  20. data/lib/gherkin/parser/json_parser.rb +102 -0
  21. data/lib/gherkin/parser/parser.rb +10 -2
  22. data/lib/gherkin/parser/row.rb +15 -0
  23. data/lib/gherkin/rubify.rb +2 -0
  24. data/lib/gherkin/tools/files.rb +1 -1
  25. data/lib/gherkin/tools/reformat.rb +1 -2
  26. data/lib/gherkin/tools/stats.rb +1 -1
  27. data/lib/gherkin/tools/stats_listener.rb +5 -5
  28. data/ragel/lexer.c.rl.erb +41 -12
  29. data/ragel/lexer.java.rl.erb +26 -17
  30. data/ragel/lexer.rb.rl.erb +10 -5
  31. data/ragel/lexer_common.rl.erb +6 -6
  32. data/spec/gherkin/c_lexer_spec.rb +2 -2
  33. data/spec/gherkin/fixtures/complex.js +105 -0
  34. data/spec/gherkin/formatter/argument_spec.rb +3 -3
  35. data/spec/gherkin/formatter/colors_spec.rb +3 -4
  36. data/spec/gherkin/formatter/pretty_formatter_spec.rb +21 -50
  37. data/spec/gherkin/i18n_lexer_spec.rb +6 -6
  38. data/spec/gherkin/i18n_spec.rb +16 -9
  39. data/spec/gherkin/java_lexer_spec.rb +1 -2
  40. data/spec/gherkin/output_stream_string_io.rb +24 -0
  41. data/spec/gherkin/parser/filter_listener_spec.rb +16 -9
  42. data/spec/gherkin/parser/formatter_listener_spec.rb +134 -0
  43. data/spec/gherkin/parser/json_parser_spec.rb +129 -0
  44. data/spec/gherkin/parser/parser_spec.rb +9 -9
  45. data/spec/gherkin/parser/tag_expression_spec.rb +8 -8
  46. data/spec/gherkin/rb_lexer_spec.rb +1 -1
  47. data/spec/gherkin/sexp_recorder.rb +21 -1
  48. data/spec/gherkin/shared/{lexer_spec.rb → lexer_group.rb} +172 -102
  49. data/spec/gherkin/shared/{py_string_spec.rb → py_string_group.rb} +21 -17
  50. data/spec/gherkin/shared/{row_spec.rb → row_group.rb} +36 -19
  51. data/spec/gherkin/shared/{tags_spec.rb → tags_group.rb} +13 -9
  52. data/spec/spec_helper.rb +18 -38
  53. data/tasks/bench.rake +3 -3
  54. data/tasks/compile.rake +13 -14
  55. data/tasks/rspec.rake +6 -11
  56. metadata +42 -28
  57. data/features/pretty_printer.feature +0 -14
  58. data/spec/gherkin/csharp_lexer_spec.rb +0 -20
@@ -8,6 +8,7 @@ CLEAN.include [
8
8
  'java/target',
9
9
  'ragel/i18n/*.rl',
10
10
  'lib/gherkin/rb_lexer/*.rb',
11
+ 'lib/*.dll',
11
12
  'ext/**/*.c',
12
13
  'java/src/main/java/gherkin/lexer/*.java',
13
14
  'java/src/main/resources/gherkin/*.properties',
@@ -27,22 +28,20 @@ langs.each do |i18n|
27
28
  java = RagelTask.new('java', i18n)
28
29
  rb = RagelTask.new('rb', i18n)
29
30
 
30
- file 'lib/gherkin.jar' => [java.target, rb.target]
31
-
32
- begin
33
- if defined?(JRUBY_VERSION)
34
- java_properties = "java/src/main/resources/gherkin/I18nKeywords_#{i18n.iso_code.gsub(/-/, '_')}.properties"
35
- file java_properties => 'lib/gherkin/i18n.yml' do
36
- File.open(java_properties, 'wb') do |io|
37
- io.puts("# Generated file. Do not edit.")
38
- Gherkin::I18n::KEYWORD_KEYS.each do |key|
39
- value = Gherkin::I18n.unicode_escape(i18n.keywords(key).join("|"))
40
- io.puts("#{key}:#{value}")
41
- end
31
+ java_properties = "java/src/main/resources/gherkin/I18nKeywords_#{i18n.iso_code.gsub(/-/, '_')}.properties"
32
+ file java_properties => 'lib/gherkin/i18n.yml' do
33
+ File.open(java_properties, 'wb') do |io|
34
+ io.puts("# Generated file. Do not edit.")
35
+ Gherkin::I18n::KEYWORD_KEYS.each do |key|
36
+ value = Gherkin::I18n.unicode_escape(i18n.keywords(key).join("|"))
37
+ io.puts("#{key}:#{value}")
42
38
  end
43
39
  end
44
- file 'lib/gherkin.jar' => java_properties
45
- else
40
+ end
41
+ file 'lib/gherkin.jar' => [java.target, rb.target, java_properties]
42
+
43
+ begin
44
+ if !defined?(JRUBY_VERSION)
46
45
  require 'rake/extensiontask'
47
46
 
48
47
  c = RagelTask.new('c', i18n)
@@ -1,15 +1,10 @@
1
- require 'spec/rake/spectask'
1
+ require 'rspec/core/rake_task'
2
2
 
3
- Spec::Rake::SpecTask.new(:spec) do |spec|
4
- spec.libs << 'lib' << 'spec'
5
- spec.spec_opts << '--color --diff'
6
- end
3
+ RSpec::Core::RakeTask.new(:spec)
7
4
  task :spec => [:check_dependencies]
8
5
 
9
- Spec::Rake::SpecTask.new(:rcov) do |spec|
10
- spec.libs << 'lib' << 'spec'
11
- spec.spec_opts << '--color --diff'
12
- spec.pattern = 'spec/**/*_spec.rb'
13
- spec.rcov = true
14
- spec.rcov_opts = %w{--exclude spec\/}
6
+ RSpec::Core::RakeTask.new(:rcov) do |t|
7
+ t.pattern = 'spec/**/*_spec.rb'
8
+ t.rcov = true
9
+ t.rcov_opts = %w{--exclude osx\/objc,gems\/,spec\/}
15
10
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gherkin
3
3
  version: !ruby/object:Gem::Version
4
- hash: 43
4
+ hash: 15
5
5
  prerelease: false
6
6
  segments:
7
- - 1
7
+ - 2
8
8
  - 0
9
- - 30
10
- version: 1.0.30
9
+ - 0
10
+ version: 2.0.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - Mike Sassak
@@ -17,7 +17,7 @@ autorequire:
17
17
  bindir: bin
18
18
  cert_chain: []
19
19
 
20
- date: 2010-05-20 00:00:00 +02:00
20
+ date: 2010-06-15 00:00:00 +02:00
21
21
  default_executable: gherkin
22
22
  dependencies:
23
23
  - !ruby/object:Gem::Dependency
@@ -26,7 +26,7 @@ dependencies:
26
26
  requirement: &id001 !ruby/object:Gem::Requirement
27
27
  none: false
28
28
  requirements:
29
- - - ">="
29
+ - - ~>
30
30
  - !ruby/object:Gem::Version
31
31
  hash: 83
32
32
  segments:
@@ -42,14 +42,16 @@ dependencies:
42
42
  requirement: &id002 !ruby/object:Gem::Requirement
43
43
  none: false
44
44
  requirements:
45
- - - ">="
45
+ - - ~>
46
46
  - !ruby/object:Gem::Version
47
- hash: 27
47
+ hash: 62196469
48
48
  segments:
49
- - 1
50
- - 3
49
+ - 2
50
+ - 0
51
51
  - 0
52
- version: 1.3.0
52
+ - beta
53
+ - 11
54
+ version: 2.0.0.beta.11
53
55
  type: :development
54
56
  version_requirements: *id002
55
57
  - !ruby/object:Gem::Dependency
@@ -58,14 +60,14 @@ dependencies:
58
60
  requirement: &id003 !ruby/object:Gem::Requirement
59
61
  none: false
60
62
  requirements:
61
- - - ">="
63
+ - - ~>
62
64
  - !ruby/object:Gem::Version
63
- hash: 7
65
+ hash: 61
64
66
  segments:
65
67
  - 0
66
- - 7
67
- - 2
68
- version: 0.7.2
68
+ - 8
69
+ - 1
70
+ version: 0.8.1
69
71
  type: :development
70
72
  version_requirements: *id003
71
73
  - !ruby/object:Gem::Dependency
@@ -74,7 +76,7 @@ dependencies:
74
76
  requirement: &id004 !ruby/object:Gem::Requirement
75
77
  none: false
76
78
  requirements:
77
- - - ">="
79
+ - - ~>
78
80
  - !ruby/object:Gem::Version
79
81
  hash: 3
80
82
  segments:
@@ -140,6 +142,7 @@ files:
140
142
  - .gitattributes
141
143
  - .gitignore
142
144
  - .mailmap
145
+ - .rspec
143
146
  - History.txt
144
147
  - LICENSE
145
148
  - README.rdoc
@@ -193,11 +196,13 @@ files:
193
196
  - ext/gherkin_lexer_zh_tw/gherkin_lexer_zh_tw.c
194
197
  - features/escaped_pipes.feature
195
198
  - features/feature_parser.feature
199
+ - features/json_formatter.feature
196
200
  - features/native_lexer.feature
197
201
  - features/parser_with_native_lexer.feature
198
- - features/pretty_printer.feature
202
+ - features/pretty_formatter.feature
199
203
  - features/step_definitions/eyeball_steps.rb
200
204
  - features/step_definitions/gherkin_steps.rb
205
+ - features/step_definitions/json_formatter_steps.rb
201
206
  - features/step_definitions/pretty_formatter_steps.rb
202
207
  - features/steps_parser.feature
203
208
  - features/support/env.rb
@@ -212,6 +217,7 @@ files:
212
217
  - lib/gherkin/formatter/argument.rb
213
218
  - lib/gherkin/formatter/colors.rb
214
219
  - lib/gherkin/formatter/escaping.rb
220
+ - lib/gherkin/formatter/json_formatter.rb
215
221
  - lib/gherkin/formatter/monochrome_format.rb
216
222
  - lib/gherkin/formatter/pretty_formatter.rb
217
223
  - lib/gherkin/i18n.rb
@@ -223,9 +229,12 @@ files:
223
229
  - lib/gherkin/native/null.rb
224
230
  - lib/gherkin/parser/event.rb
225
231
  - lib/gherkin/parser/filter_listener.rb
232
+ - lib/gherkin/parser/formatter_listener.rb
233
+ - lib/gherkin/parser/json_parser.rb
226
234
  - lib/gherkin/parser/meta.txt
227
235
  - lib/gherkin/parser/parser.rb
228
236
  - lib/gherkin/parser/root.txt
237
+ - lib/gherkin/parser/row.rb
229
238
  - lib/gherkin/parser/steps.txt
230
239
  - lib/gherkin/parser/tag_expression.rb
231
240
  - lib/gherkin/rb_lexer.rb
@@ -287,10 +296,10 @@ files:
287
296
  - ragel/lexer.rb.rl.erb
288
297
  - ragel/lexer_common.rl.erb
289
298
  - spec/gherkin/c_lexer_spec.rb
290
- - spec/gherkin/csharp_lexer_spec.rb
291
299
  - spec/gherkin/fixtures/1.feature
292
300
  - spec/gherkin/fixtures/comments_in_table.feature
293
301
  - spec/gherkin/fixtures/complex.feature
302
+ - spec/gherkin/fixtures/complex.js
294
303
  - spec/gherkin/fixtures/dos_line_endings.feature
295
304
  - spec/gherkin/fixtures/i18n_fr.feature
296
305
  - spec/gherkin/fixtures/i18n_no.feature
@@ -306,15 +315,18 @@ files:
306
315
  - spec/gherkin/i18n_lexer_spec.rb
307
316
  - spec/gherkin/i18n_spec.rb
308
317
  - spec/gherkin/java_lexer_spec.rb
318
+ - spec/gherkin/output_stream_string_io.rb
309
319
  - spec/gherkin/parser/filter_listener_spec.rb
320
+ - spec/gherkin/parser/formatter_listener_spec.rb
321
+ - spec/gherkin/parser/json_parser_spec.rb
310
322
  - spec/gherkin/parser/parser_spec.rb
311
323
  - spec/gherkin/parser/tag_expression_spec.rb
312
324
  - spec/gherkin/rb_lexer_spec.rb
313
325
  - spec/gherkin/sexp_recorder.rb
314
- - spec/gherkin/shared/lexer_spec.rb
315
- - spec/gherkin/shared/py_string_spec.rb
316
- - spec/gherkin/shared/row_spec.rb
317
- - spec/gherkin/shared/tags_spec.rb
326
+ - spec/gherkin/shared/lexer_group.rb
327
+ - spec/gherkin/shared/py_string_group.rb
328
+ - spec/gherkin/shared/row_group.rb
329
+ - spec/gherkin/shared/tags_group.rb
318
330
  - spec/spec_helper.rb
319
331
  - tasks/bench.rake
320
332
  - tasks/bench/feature_builder.rb
@@ -408,20 +420,22 @@ specification_version: 3
408
420
  summary: Fast Gherkin lexer/parser
409
421
  test_files:
410
422
  - spec/gherkin/c_lexer_spec.rb
411
- - spec/gherkin/csharp_lexer_spec.rb
412
423
  - spec/gherkin/formatter/argument_spec.rb
413
424
  - spec/gherkin/formatter/colors_spec.rb
414
425
  - spec/gherkin/formatter/pretty_formatter_spec.rb
415
426
  - spec/gherkin/i18n_lexer_spec.rb
416
427
  - spec/gherkin/i18n_spec.rb
417
428
  - spec/gherkin/java_lexer_spec.rb
429
+ - spec/gherkin/output_stream_string_io.rb
418
430
  - spec/gherkin/parser/filter_listener_spec.rb
431
+ - spec/gherkin/parser/formatter_listener_spec.rb
432
+ - spec/gherkin/parser/json_parser_spec.rb
419
433
  - spec/gherkin/parser/parser_spec.rb
420
434
  - spec/gherkin/parser/tag_expression_spec.rb
421
435
  - spec/gherkin/rb_lexer_spec.rb
422
436
  - spec/gherkin/sexp_recorder.rb
423
- - spec/gherkin/shared/lexer_spec.rb
424
- - spec/gherkin/shared/py_string_spec.rb
425
- - spec/gherkin/shared/row_spec.rb
426
- - spec/gherkin/shared/tags_spec.rb
437
+ - spec/gherkin/shared/lexer_group.rb
438
+ - spec/gherkin/shared/py_string_group.rb
439
+ - spec/gherkin/shared/row_group.rb
440
+ - spec/gherkin/shared/tags_group.rb
427
441
  - spec/spec_helper.rb
@@ -1,14 +0,0 @@
1
- Feature: Pretty printer
2
- In order to have pretty gherkin
3
- I want to verify that all prettified cucumber features parse OK
4
-
5
- Scenario: Parse all the features in Cucumber
6
- Given I have Cucumber's home dir defined in CUCUMBER_HOME
7
- When I find all of the .feature files
8
- And I parse the prettified representation of each of them
9
- # Of course, we don't really want any errors. The last
10
- # two files that were not identical are written to p1.feature
11
- # and p2.feature. Do a diff -u p1.feature p2.feature
12
- #
13
- Then the following files should have errors:
14
- | Path | Error |
@@ -1,20 +0,0 @@
1
- #encoding: utf-8
2
- if defined?(RUBY_ENGINE) && RUBY_ENGINE == "ironruby"
3
- require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
4
-
5
- module Gherkin
6
- module Lexer
7
- describe "C# Lexer" do
8
- before do
9
- @listener = Gherkin::SexpRecorder.new
10
- @lexer = Gherkin::Lexer.csharp['en'].new(@listener)
11
- end
12
-
13
- it_should_behave_like "a Gherkin lexer"
14
- it_should_behave_like "a Gherkin lexer lexing tags"
15
- it_should_behave_like "a Gherkin lexer lexing py_strings"
16
- it_should_behave_like "a Gherkin lexer lexing rows"
17
- end
18
- end
19
- end
20
- end