gherkin 1.0.30-java → 2.0.0-java

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 +38 -25
  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
@@ -3,10 +3,10 @@ name: gherkin
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease: false
5
5
  segments:
6
- - 1
6
+ - 2
7
7
  - 0
8
- - 30
9
- version: 1.0.30
8
+ - 0
9
+ version: 2.0.0
10
10
  platform: java
11
11
  authors:
12
12
  - Mike Sassak
@@ -16,7 +16,7 @@ autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
18
 
19
- date: 2010-05-20 00:00:00 +02:00
19
+ date: 2010-06-15 00:00:00 +02:00
20
20
  default_executable: gherkin
21
21
  dependencies:
22
22
  - !ruby/object:Gem::Dependency
@@ -24,7 +24,7 @@ dependencies:
24
24
  prerelease: false
25
25
  requirement: &id001 !ruby/object:Gem::Requirement
26
26
  requirements:
27
- - - ">="
27
+ - - ~>
28
28
  - !ruby/object:Gem::Version
29
29
  segments:
30
30
  - 1
@@ -38,13 +38,15 @@ dependencies:
38
38
  prerelease: false
39
39
  requirement: &id002 !ruby/object:Gem::Requirement
40
40
  requirements:
41
- - - ">="
41
+ - - ~>
42
42
  - !ruby/object:Gem::Version
43
43
  segments:
44
- - 1
45
- - 3
44
+ - 2
46
45
  - 0
47
- version: 1.3.0
46
+ - 0
47
+ - beta
48
+ - 11
49
+ version: 2.0.0.beta.11
48
50
  type: :development
49
51
  version_requirements: *id002
50
52
  - !ruby/object:Gem::Dependency
@@ -52,13 +54,13 @@ dependencies:
52
54
  prerelease: false
53
55
  requirement: &id003 !ruby/object:Gem::Requirement
54
56
  requirements:
55
- - - ">="
57
+ - - ~>
56
58
  - !ruby/object:Gem::Version
57
59
  segments:
58
60
  - 0
59
- - 7
60
- - 2
61
- version: 0.7.2
61
+ - 8
62
+ - 1
63
+ version: 0.8.1
62
64
  type: :development
63
65
  version_requirements: *id003
64
66
  description: A fast Gherkin lexer/parser based on the Ragel State Machine Compiler.
@@ -74,6 +76,7 @@ files:
74
76
  - .gitattributes
75
77
  - .gitignore
76
78
  - .mailmap
79
+ - .rspec
77
80
  - History.txt
78
81
  - LICENSE
79
82
  - README.rdoc
@@ -83,11 +86,13 @@ files:
83
86
  - cucumber.yml
84
87
  - features/escaped_pipes.feature
85
88
  - features/feature_parser.feature
89
+ - features/json_formatter.feature
86
90
  - features/native_lexer.feature
87
91
  - features/parser_with_native_lexer.feature
88
- - features/pretty_printer.feature
92
+ - features/pretty_formatter.feature
89
93
  - features/step_definitions/eyeball_steps.rb
90
94
  - features/step_definitions/gherkin_steps.rb
95
+ - features/step_definitions/json_formatter_steps.rb
91
96
  - features/step_definitions/pretty_formatter_steps.rb
92
97
  - features/steps_parser.feature
93
98
  - features/support/env.rb
@@ -96,13 +101,13 @@ files:
96
101
  - java/src/main/java/gherkin/lexer/.gitignore
97
102
  - java/src/main/resources/gherkin/.gitignore
98
103
  - lib/.gitignore
99
- - lib/gherkin.jar
100
104
  - lib/gherkin.rb
101
105
  - lib/gherkin/c_lexer.rb
102
106
  - lib/gherkin/cli/main.rb
103
107
  - lib/gherkin/formatter/argument.rb
104
108
  - lib/gherkin/formatter/colors.rb
105
109
  - lib/gherkin/formatter/escaping.rb
110
+ - lib/gherkin/formatter/json_formatter.rb
106
111
  - lib/gherkin/formatter/monochrome_format.rb
107
112
  - lib/gherkin/formatter/pretty_formatter.rb
108
113
  - lib/gherkin/i18n.rb
@@ -114,9 +119,12 @@ files:
114
119
  - lib/gherkin/native/null.rb
115
120
  - lib/gherkin/parser/event.rb
116
121
  - lib/gherkin/parser/filter_listener.rb
122
+ - lib/gherkin/parser/formatter_listener.rb
123
+ - lib/gherkin/parser/json_parser.rb
117
124
  - lib/gherkin/parser/meta.txt
118
125
  - lib/gherkin/parser/parser.rb
119
126
  - lib/gherkin/parser/root.txt
127
+ - lib/gherkin/parser/row.rb
120
128
  - lib/gherkin/parser/steps.txt
121
129
  - lib/gherkin/parser/tag_expression.rb
122
130
  - lib/gherkin/rb_lexer.rb
@@ -134,10 +142,10 @@ files:
134
142
  - ragel/lexer.rb.rl.erb
135
143
  - ragel/lexer_common.rl.erb
136
144
  - spec/gherkin/c_lexer_spec.rb
137
- - spec/gherkin/csharp_lexer_spec.rb
138
145
  - spec/gherkin/fixtures/1.feature
139
146
  - spec/gherkin/fixtures/comments_in_table.feature
140
147
  - spec/gherkin/fixtures/complex.feature
148
+ - spec/gherkin/fixtures/complex.js
141
149
  - spec/gherkin/fixtures/dos_line_endings.feature
142
150
  - spec/gherkin/fixtures/i18n_fr.feature
143
151
  - spec/gherkin/fixtures/i18n_no.feature
@@ -153,15 +161,18 @@ files:
153
161
  - spec/gherkin/i18n_lexer_spec.rb
154
162
  - spec/gherkin/i18n_spec.rb
155
163
  - spec/gherkin/java_lexer_spec.rb
164
+ - spec/gherkin/output_stream_string_io.rb
156
165
  - spec/gherkin/parser/filter_listener_spec.rb
166
+ - spec/gherkin/parser/formatter_listener_spec.rb
167
+ - spec/gherkin/parser/json_parser_spec.rb
157
168
  - spec/gherkin/parser/parser_spec.rb
158
169
  - spec/gherkin/parser/tag_expression_spec.rb
159
170
  - spec/gherkin/rb_lexer_spec.rb
160
171
  - spec/gherkin/sexp_recorder.rb
161
- - spec/gherkin/shared/lexer_spec.rb
162
- - spec/gherkin/shared/py_string_spec.rb
163
- - spec/gherkin/shared/row_spec.rb
164
- - spec/gherkin/shared/tags_spec.rb
172
+ - spec/gherkin/shared/lexer_group.rb
173
+ - spec/gherkin/shared/py_string_group.rb
174
+ - spec/gherkin/shared/row_group.rb
175
+ - spec/gherkin/shared/tags_group.rb
165
176
  - spec/spec_helper.rb
166
177
  - tasks/bench.rake
167
178
  - tasks/bench/feature_builder.rb
@@ -208,19 +219,21 @@ summary: Fast Gherkin lexer/parser
208
219
  test_files:
209
220
  - spec/spec_helper.rb
210
221
  - spec/gherkin/c_lexer_spec.rb
211
- - spec/gherkin/csharp_lexer_spec.rb
212
222
  - spec/gherkin/i18n_lexer_spec.rb
213
223
  - spec/gherkin/i18n_spec.rb
214
224
  - spec/gherkin/java_lexer_spec.rb
225
+ - spec/gherkin/output_stream_string_io.rb
215
226
  - spec/gherkin/rb_lexer_spec.rb
216
227
  - spec/gherkin/sexp_recorder.rb
217
228
  - spec/gherkin/formatter/argument_spec.rb
218
229
  - spec/gherkin/formatter/colors_spec.rb
219
230
  - spec/gherkin/formatter/pretty_formatter_spec.rb
220
231
  - spec/gherkin/parser/filter_listener_spec.rb
232
+ - spec/gherkin/parser/formatter_listener_spec.rb
233
+ - spec/gherkin/parser/json_parser_spec.rb
221
234
  - spec/gherkin/parser/parser_spec.rb
222
235
  - spec/gherkin/parser/tag_expression_spec.rb
223
- - spec/gherkin/shared/lexer_spec.rb
224
- - spec/gherkin/shared/py_string_spec.rb
225
- - spec/gherkin/shared/row_spec.rb
226
- - spec/gherkin/shared/tags_spec.rb
236
+ - spec/gherkin/shared/lexer_group.rb
237
+ - spec/gherkin/shared/py_string_group.rb
238
+ - spec/gherkin/shared/row_group.rb
239
+ - spec/gherkin/shared/tags_group.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