gherkin 1.0.30-universal-dotnet → 2.0.0-universal-dotnet

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
data/tasks/compile.rake CHANGED
@@ -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)
data/tasks/rspec.rake CHANGED
@@ -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: universal-dotnet
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:
@@ -97,6 +99,7 @@ files:
97
99
  - .gitattributes
98
100
  - .gitignore
99
101
  - .mailmap
102
+ - .rspec
100
103
  - History.txt
101
104
  - LICENSE
102
105
  - README.rdoc
@@ -106,11 +109,13 @@ files:
106
109
  - cucumber.yml
107
110
  - features/escaped_pipes.feature
108
111
  - features/feature_parser.feature
112
+ - features/json_formatter.feature
109
113
  - features/native_lexer.feature
110
114
  - features/parser_with_native_lexer.feature
111
- - features/pretty_printer.feature
115
+ - features/pretty_formatter.feature
112
116
  - features/step_definitions/eyeball_steps.rb
113
117
  - features/step_definitions/gherkin_steps.rb
118
+ - features/step_definitions/json_formatter_steps.rb
114
119
  - features/step_definitions/pretty_formatter_steps.rb
115
120
  - features/steps_parser.feature
116
121
  - features/support/env.rb
@@ -130,6 +135,7 @@ files:
130
135
  - lib/gherkin/formatter/argument.rb
131
136
  - lib/gherkin/formatter/colors.rb
132
137
  - lib/gherkin/formatter/escaping.rb
138
+ - lib/gherkin/formatter/json_formatter.rb
133
139
  - lib/gherkin/formatter/monochrome_format.rb
134
140
  - lib/gherkin/formatter/pretty_formatter.rb
135
141
  - lib/gherkin/i18n.rb
@@ -141,9 +147,12 @@ files:
141
147
  - lib/gherkin/native/null.rb
142
148
  - lib/gherkin/parser/event.rb
143
149
  - lib/gherkin/parser/filter_listener.rb
150
+ - lib/gherkin/parser/formatter_listener.rb
151
+ - lib/gherkin/parser/json_parser.rb
144
152
  - lib/gherkin/parser/meta.txt
145
153
  - lib/gherkin/parser/parser.rb
146
154
  - lib/gherkin/parser/root.txt
155
+ - lib/gherkin/parser/row.rb
147
156
  - lib/gherkin/parser/steps.txt
148
157
  - lib/gherkin/parser/tag_expression.rb
149
158
  - lib/gherkin/rb_lexer.rb
@@ -161,10 +170,10 @@ files:
161
170
  - ragel/lexer.rb.rl.erb
162
171
  - ragel/lexer_common.rl.erb
163
172
  - spec/gherkin/c_lexer_spec.rb
164
- - spec/gherkin/csharp_lexer_spec.rb
165
173
  - spec/gherkin/fixtures/1.feature
166
174
  - spec/gherkin/fixtures/comments_in_table.feature
167
175
  - spec/gherkin/fixtures/complex.feature
176
+ - spec/gherkin/fixtures/complex.js
168
177
  - spec/gherkin/fixtures/dos_line_endings.feature
169
178
  - spec/gherkin/fixtures/i18n_fr.feature
170
179
  - spec/gherkin/fixtures/i18n_no.feature
@@ -180,15 +189,18 @@ files:
180
189
  - spec/gherkin/i18n_lexer_spec.rb
181
190
  - spec/gherkin/i18n_spec.rb
182
191
  - spec/gherkin/java_lexer_spec.rb
192
+ - spec/gherkin/output_stream_string_io.rb
183
193
  - spec/gherkin/parser/filter_listener_spec.rb
194
+ - spec/gherkin/parser/formatter_listener_spec.rb
195
+ - spec/gherkin/parser/json_parser_spec.rb
184
196
  - spec/gherkin/parser/parser_spec.rb
185
197
  - spec/gherkin/parser/tag_expression_spec.rb
186
198
  - spec/gherkin/rb_lexer_spec.rb
187
199
  - spec/gherkin/sexp_recorder.rb
188
- - spec/gherkin/shared/lexer_spec.rb
189
- - spec/gherkin/shared/py_string_spec.rb
190
- - spec/gherkin/shared/row_spec.rb
191
- - spec/gherkin/shared/tags_spec.rb
200
+ - spec/gherkin/shared/lexer_group.rb
201
+ - spec/gherkin/shared/py_string_group.rb
202
+ - spec/gherkin/shared/row_group.rb
203
+ - spec/gherkin/shared/tags_group.rb
192
204
  - spec/spec_helper.rb
193
205
  - tasks/bench.rake
194
206
  - tasks/bench/feature_builder.rb
@@ -238,20 +250,22 @@ specification_version: 3
238
250
  summary: Fast Gherkin lexer/parser
239
251
  test_files:
240
252
  - spec/gherkin/c_lexer_spec.rb
241
- - spec/gherkin/csharp_lexer_spec.rb
242
253
  - spec/gherkin/formatter/argument_spec.rb
243
254
  - spec/gherkin/formatter/colors_spec.rb
244
255
  - spec/gherkin/formatter/pretty_formatter_spec.rb
245
256
  - spec/gherkin/i18n_lexer_spec.rb
246
257
  - spec/gherkin/i18n_spec.rb
247
258
  - spec/gherkin/java_lexer_spec.rb
259
+ - spec/gherkin/output_stream_string_io.rb
248
260
  - spec/gherkin/parser/filter_listener_spec.rb
261
+ - spec/gherkin/parser/formatter_listener_spec.rb
262
+ - spec/gherkin/parser/json_parser_spec.rb
249
263
  - spec/gherkin/parser/parser_spec.rb
250
264
  - spec/gherkin/parser/tag_expression_spec.rb
251
265
  - spec/gherkin/rb_lexer_spec.rb
252
266
  - spec/gherkin/sexp_recorder.rb
253
- - spec/gherkin/shared/lexer_spec.rb
254
- - spec/gherkin/shared/py_string_spec.rb
255
- - spec/gherkin/shared/row_spec.rb
256
- - spec/gherkin/shared/tags_spec.rb
267
+ - spec/gherkin/shared/lexer_group.rb
268
+ - spec/gherkin/shared/py_string_group.rb
269
+ - spec/gherkin/shared/row_group.rb
270
+ - spec/gherkin/shared/tags_group.rb
257
271
  - 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