gherkin 0.0.3-universal-java-1.5 → 0.0.4-universal-java-1.5
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +2 -3
- data/README.rdoc +19 -0
- data/Rakefile +16 -15
- data/VERSION.yml +1 -1
- data/bin/gherkin +2 -2
- data/features/pretty_printer.feature +5 -2
- data/features/step_definitions/pretty_printer_steps.rb +6 -1
- data/gherkin.gemspec +16 -52
- data/lib/.gitignore +4 -2
- data/lib/gherkin/c_lexer.rb +3 -3
- data/lib/gherkin/core_ext/array.rb +5 -0
- data/lib/gherkin/lexer.rb +6 -5
- data/lib/gherkin/rb_lexer.rb +3 -2
- data/lib/gherkin/tools/pretty_printer.rb +10 -4
- data/nativegems.sh +5 -0
- data/ragel/lexer.c.rl.erb +28 -12
- data/ragel/lexer.java.rl.erb +5 -3
- data/ragel/lexer.rb.rl.erb +14 -15
- data/ragel/lexer_common.rl.erb +6 -6
- data/spec/gherkin/fixtures/1.feature +8 -0
- data/spec/gherkin/fixtures/complex.feature +2 -2
- data/spec/gherkin/shared/lexer_spec.rb +17 -4
- data/spec/gherkin/shared/py_string_spec.rb +12 -0
- data/tasks/bench.rake +28 -11
- data/tasks/compile.rake +70 -0
- data/tasks/ragel_task.rb +83 -0
- metadata +136 -165
- data/ext/gherkin_lexer/.gitignore +0 -6
- data/ext/gherkin_lexer/extconf.rb +0 -6
- data/tasks/ext.rake +0 -49
- data/tasks/ragel.rake +0 -94
metadata
CHANGED
@@ -1,187 +1,158 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gherkin
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: universal-java-1.5
|
6
6
|
authors:
|
7
|
-
|
8
|
-
|
9
|
-
|
7
|
+
- Mike Sassak
|
8
|
+
- Gregory Hnatiuk
|
9
|
+
- "Aslak Helles\xC3\xB8y"
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
13
|
|
14
|
-
date: 2009-11-
|
14
|
+
date: 2009-11-28 00:00:00 +01:00
|
15
15
|
default_executable: gherkin
|
16
16
|
dependencies:
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
17
|
+
- !ruby/object:Gem::Dependency
|
18
|
+
name: rspec
|
19
|
+
type: :development
|
20
|
+
version_requirement:
|
21
|
+
version_requirements: !ruby/object:Gem::Requirement
|
22
|
+
requirements:
|
23
|
+
- - "="
|
24
|
+
- !ruby/object:Gem::Version
|
25
|
+
version: 1.2.9
|
26
|
+
version:
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: cucumber
|
29
|
+
type: :development
|
30
|
+
version_requirement:
|
31
|
+
version_requirements: !ruby/object:Gem::Requirement
|
32
|
+
requirements:
|
33
|
+
- - "="
|
34
|
+
- !ruby/object:Gem::Version
|
35
|
+
version: 0.4.4
|
36
|
+
version:
|
37
|
+
- !ruby/object:Gem::Dependency
|
38
|
+
name: rake-compiler
|
39
|
+
type: :development
|
40
|
+
version_requirement:
|
41
|
+
version_requirements: !ruby/object:Gem::Requirement
|
42
|
+
requirements:
|
43
|
+
- - "="
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: 0.6.0
|
46
|
+
version:
|
37
47
|
description: A fast Gherkin lexer in Ragel
|
38
48
|
email: cukes@googlegroups.com
|
39
49
|
executables:
|
40
|
-
|
50
|
+
- gherkin
|
41
51
|
extensions: []
|
42
52
|
|
43
53
|
extra_rdoc_files:
|
44
|
-
|
45
|
-
|
54
|
+
- LICENSE
|
55
|
+
- README.rdoc
|
46
56
|
files:
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
- lib/gherkin/rb_lexer/tr.rb
|
127
|
-
- lib/gherkin/rb_lexer/uz.rb
|
128
|
-
- lib/gherkin/rb_lexer/vi.rb
|
129
|
-
- lib/gherkin/rb_lexer/zh-CN.rb
|
130
|
-
- lib/gherkin/rb_lexer/zh-TW.rb
|
131
|
-
- lib/gherkin/rb_parser.rb
|
132
|
-
- lib/gherkin/tools/pretty_printer.rb
|
133
|
-
- ragel/i18n/.gitignore
|
134
|
-
- ragel/lexer.c.rl.erb
|
135
|
-
- ragel/lexer.java.rl.erb
|
136
|
-
- ragel/lexer.rb.rl.erb
|
137
|
-
- ragel/lexer_common.rl.erb
|
138
|
-
- spec/gherkin/c_lexer_spec.rb
|
139
|
-
- spec/gherkin/fixtures/complex.feature
|
140
|
-
- spec/gherkin/fixtures/i18n_fr.feature
|
141
|
-
- spec/gherkin/fixtures/i18n_no.feature
|
142
|
-
- spec/gherkin/fixtures/i18n_zh-CN.feature
|
143
|
-
- spec/gherkin/fixtures/simple.feature
|
144
|
-
- spec/gherkin/fixtures/simple_with_comments.feature
|
145
|
-
- spec/gherkin/fixtures/simple_with_tags.feature
|
146
|
-
- spec/gherkin/i18n_spec.rb
|
147
|
-
- spec/gherkin/java_lexer_spec.rb
|
148
|
-
- spec/gherkin/parser_spec.rb
|
149
|
-
- spec/gherkin/rb_lexer_spec.rb
|
150
|
-
- spec/gherkin/sexp_recorder.rb
|
151
|
-
- spec/gherkin/shared/lexer_spec.rb
|
152
|
-
- spec/gherkin/shared/py_string_spec.rb
|
153
|
-
- spec/gherkin/shared/table_spec.rb
|
154
|
-
- spec/gherkin/shared/tags_spec.rb
|
155
|
-
- spec/spec_helper.rb
|
156
|
-
- tasks/bench.rake
|
157
|
-
- tasks/bench/feature_builder.rb
|
158
|
-
- tasks/bench/generated/.gitignore
|
159
|
-
- tasks/bench/null_listener.rb
|
160
|
-
- tasks/cucumber.rake
|
161
|
-
- tasks/ext.rake
|
162
|
-
- tasks/ragel.rake
|
163
|
-
- tasks/rdoc.rake
|
164
|
-
- tasks/rspec.rake
|
57
|
+
- .gitignore
|
58
|
+
- LICENSE
|
59
|
+
- README.rdoc
|
60
|
+
- Rakefile
|
61
|
+
- VERSION.yml
|
62
|
+
- bin/gherkin
|
63
|
+
- cucumber.yml
|
64
|
+
- features/feature_parser.feature
|
65
|
+
- features/native_lexer.feature
|
66
|
+
- features/parser_with_native_lexer.feature
|
67
|
+
- features/pretty_printer.feature
|
68
|
+
- features/step_definitions/gherkin_steps.rb
|
69
|
+
- features/step_definitions/pretty_printer_steps.rb
|
70
|
+
- features/steps_parser.feature
|
71
|
+
- features/support/env.rb
|
72
|
+
- gherkin.gemspec
|
73
|
+
- java/.gitignore
|
74
|
+
- java/Gherkin.iml
|
75
|
+
- java/build.xml
|
76
|
+
- java/src/gherkin/FixJava.java
|
77
|
+
- java/src/gherkin/Lexer.java
|
78
|
+
- java/src/gherkin/LexingError.java
|
79
|
+
- java/src/gherkin/Listener.java
|
80
|
+
- java/src/gherkin/ParseError.java
|
81
|
+
- java/src/gherkin/Parser.java
|
82
|
+
- java/src/gherkin/lexer/.gitignore
|
83
|
+
- java/src/gherkin/parser/StateMachineReader.java
|
84
|
+
- lib/.gitignore
|
85
|
+
- lib/gherkin.jar
|
86
|
+
- lib/gherkin.rb
|
87
|
+
- lib/gherkin/c_lexer.rb
|
88
|
+
- lib/gherkin/core_ext/array.rb
|
89
|
+
- lib/gherkin/i18n.yml
|
90
|
+
- lib/gherkin/i18n_lexer.rb
|
91
|
+
- lib/gherkin/java_lexer.rb
|
92
|
+
- lib/gherkin/lexer.rb
|
93
|
+
- lib/gherkin/parser.rb
|
94
|
+
- lib/gherkin/parser/meta.txt
|
95
|
+
- lib/gherkin/parser/root.txt
|
96
|
+
- lib/gherkin/parser/steps.txt
|
97
|
+
- lib/gherkin/rb_lexer.rb
|
98
|
+
- lib/gherkin/rb_lexer/.gitignore
|
99
|
+
- lib/gherkin/rb_lexer/README.rdoc
|
100
|
+
- lib/gherkin/rb_parser.rb
|
101
|
+
- lib/gherkin/tools/pretty_printer.rb
|
102
|
+
- nativegems.sh
|
103
|
+
- ragel/i18n/.gitignore
|
104
|
+
- ragel/lexer.c.rl.erb
|
105
|
+
- ragel/lexer.java.rl.erb
|
106
|
+
- ragel/lexer.rb.rl.erb
|
107
|
+
- ragel/lexer_common.rl.erb
|
108
|
+
- spec/gherkin/c_lexer_spec.rb
|
109
|
+
- spec/gherkin/fixtures/1.feature
|
110
|
+
- spec/gherkin/fixtures/complex.feature
|
111
|
+
- spec/gherkin/fixtures/i18n_fr.feature
|
112
|
+
- spec/gherkin/fixtures/i18n_no.feature
|
113
|
+
- spec/gherkin/fixtures/i18n_zh-CN.feature
|
114
|
+
- spec/gherkin/fixtures/simple.feature
|
115
|
+
- spec/gherkin/fixtures/simple_with_comments.feature
|
116
|
+
- spec/gherkin/fixtures/simple_with_tags.feature
|
117
|
+
- spec/gherkin/i18n_spec.rb
|
118
|
+
- spec/gherkin/java_lexer_spec.rb
|
119
|
+
- spec/gherkin/parser_spec.rb
|
120
|
+
- spec/gherkin/rb_lexer_spec.rb
|
121
|
+
- spec/gherkin/sexp_recorder.rb
|
122
|
+
- spec/gherkin/shared/lexer_spec.rb
|
123
|
+
- spec/gherkin/shared/py_string_spec.rb
|
124
|
+
- spec/gherkin/shared/table_spec.rb
|
125
|
+
- spec/gherkin/shared/tags_spec.rb
|
126
|
+
- spec/spec_helper.rb
|
127
|
+
- tasks/bench.rake
|
128
|
+
- tasks/bench/feature_builder.rb
|
129
|
+
- tasks/bench/generated/.gitignore
|
130
|
+
- tasks/bench/null_listener.rb
|
131
|
+
- tasks/compile.rake
|
132
|
+
- tasks/cucumber.rake
|
133
|
+
- tasks/ragel_task.rb
|
134
|
+
- tasks/rdoc.rake
|
135
|
+
- tasks/rspec.rake
|
165
136
|
has_rdoc: true
|
166
137
|
homepage: http://github.com/aslakhellesoy/gherkin
|
167
138
|
licenses: []
|
168
139
|
|
169
140
|
post_install_message:
|
170
141
|
rdoc_options:
|
171
|
-
|
142
|
+
- --charset=UTF-8
|
172
143
|
require_paths:
|
173
|
-
|
144
|
+
- lib
|
174
145
|
required_ruby_version: !ruby/object:Gem::Requirement
|
175
146
|
requirements:
|
176
|
-
|
177
|
-
|
178
|
-
|
147
|
+
- - ">="
|
148
|
+
- !ruby/object:Gem::Version
|
149
|
+
version: "0"
|
179
150
|
version:
|
180
151
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
181
152
|
requirements:
|
182
|
-
|
183
|
-
|
184
|
-
|
153
|
+
- - ">="
|
154
|
+
- !ruby/object:Gem::Version
|
155
|
+
version: "0"
|
185
156
|
version:
|
186
157
|
requirements: []
|
187
158
|
|
@@ -191,14 +162,14 @@ signing_key:
|
|
191
162
|
specification_version: 3
|
192
163
|
summary: Fast Gherkin lexer
|
193
164
|
test_files:
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
165
|
+
- spec/gherkin/c_lexer_spec.rb
|
166
|
+
- spec/gherkin/i18n_spec.rb
|
167
|
+
- spec/gherkin/java_lexer_spec.rb
|
168
|
+
- spec/gherkin/parser_spec.rb
|
169
|
+
- spec/gherkin/rb_lexer_spec.rb
|
170
|
+
- spec/gherkin/sexp_recorder.rb
|
171
|
+
- spec/gherkin/shared/lexer_spec.rb
|
172
|
+
- spec/gherkin/shared/py_string_spec.rb
|
173
|
+
- spec/gherkin/shared/table_spec.rb
|
174
|
+
- spec/gherkin/shared/tags_spec.rb
|
175
|
+
- spec/spec_helper.rb
|
data/tasks/ext.rake
DELETED
@@ -1,49 +0,0 @@
|
|
1
|
-
CLEAN.include [
|
2
|
-
'**/*.{o,bundle,jar,so,obj,pdb,lib,def,exp,log}', 'ext/*/Makefile', 'ext/*/conftest.dSYM',
|
3
|
-
'java/target'
|
4
|
-
]
|
5
|
-
|
6
|
-
if(defined?(JRUBY_VERSION))
|
7
|
-
|
8
|
-
def ext_task(name)
|
9
|
-
desc "Compile the Native Java extensions"
|
10
|
-
task :compile => ['ragel:java'] do
|
11
|
-
sh("ant -f java/build.xml")
|
12
|
-
end
|
13
|
-
end
|
14
|
-
|
15
|
-
else # NOT JRUBY
|
16
|
-
|
17
|
-
def ext_task(name)
|
18
|
-
ext_dir = "ext/#{name}"
|
19
|
-
ext_bundle = "#{ext_dir}/#{name}.#{Config::CONFIG['DLEXT']}"
|
20
|
-
ext_files = FileList[
|
21
|
-
"#{ext_dir}/*.c",
|
22
|
-
"#{ext_dir}/*.h",
|
23
|
-
"#{ext_dir}/*.rl",
|
24
|
-
"#{ext_dir}/extconf.rb",
|
25
|
-
"#{ext_dir}/Makefile",
|
26
|
-
"lib"
|
27
|
-
]
|
28
|
-
|
29
|
-
task "compile:#{name}" => ["#{ext_dir}/Makefile", ext_bundle]
|
30
|
-
|
31
|
-
desc "Compile the Native C extensions"
|
32
|
-
task :compile => ['ragel:c', "compile:#{name}"]
|
33
|
-
|
34
|
-
file "#{ext_dir}/Makefile" => ["#{ext_dir}/extconf.rb"] do
|
35
|
-
cd(ext_dir) { ruby "extconf.rb" }
|
36
|
-
end
|
37
|
-
|
38
|
-
file ext_bundle => ext_files do
|
39
|
-
cd ext_dir do
|
40
|
-
sh(WINDOWS ? 'nmake' : 'make')
|
41
|
-
end
|
42
|
-
cp ext_bundle, 'lib/'
|
43
|
-
end
|
44
|
-
end
|
45
|
-
end
|
46
|
-
|
47
|
-
ext_task :gherkin_lexer
|
48
|
-
|
49
|
-
task :package => :compile
|
data/tasks/ragel.rake
DELETED
@@ -1,94 +0,0 @@
|
|
1
|
-
CLEAN.include [
|
2
|
-
'ragel/i18n/*.rl',
|
3
|
-
'lib/gherkin/rb_lexer/*.rb',
|
4
|
-
'ext/gherkin_lexer/*.c',
|
5
|
-
'java/src/gherkin/lexer/*.java',
|
6
|
-
]
|
7
|
-
|
8
|
-
class RagelCompiler
|
9
|
-
RL_OUTPUT_DIR = File.dirname(__FILE__) + "/../ragel/i18n"
|
10
|
-
|
11
|
-
def initialize(target)
|
12
|
-
require 'yaml'
|
13
|
-
require 'erb'
|
14
|
-
|
15
|
-
@target = target
|
16
|
-
@flag, @output_dir, @filename_proc = case
|
17
|
-
when @target == "rb" then ["-R", "lib/gherkin/rb_lexer", lambda{|name| name}]
|
18
|
-
when @target == "c" then ["-C", "ext/gherkin_lexer", lambda{|name| name}]
|
19
|
-
when @target == "java" then ["-J", "java/src/gherkin/lexer", lambda{|name| name.gsub(/[\s-]/, '').capitalize}]
|
20
|
-
end
|
21
|
-
|
22
|
-
@i18n_languages = YAML.load_file(File.dirname(__FILE__) + '/../lib/gherkin/i18n.yml')
|
23
|
-
@common_tmpl = ERB.new(IO.read(File.dirname(__FILE__) + '/../ragel/lexer_common.rl.erb'))
|
24
|
-
@actions_tmpl = ERB.new(IO.read(File.dirname(__FILE__) + "/../ragel/lexer.#{@target}.rl.erb"))
|
25
|
-
end
|
26
|
-
|
27
|
-
def compile_all
|
28
|
-
@i18n_languages.keys.each do |lang|
|
29
|
-
compile(lang)
|
30
|
-
end
|
31
|
-
end
|
32
|
-
|
33
|
-
def compile(i18n_language)
|
34
|
-
FileUtils.mkdir(RL_OUTPUT_DIR) unless File.exist?(RL_OUTPUT_DIR)
|
35
|
-
|
36
|
-
common_path = RL_OUTPUT_DIR + "/lexer_common.#{i18n_language}.rl"
|
37
|
-
actions_path = RL_OUTPUT_DIR + "/#{i18n_language}.#{@target}.rl"
|
38
|
-
|
39
|
-
generate_common(i18n_language, common_path)
|
40
|
-
generate_actions(i18n_language, actions_path)
|
41
|
-
|
42
|
-
sh "ragel #{@flag} #{actions_path} -o #{@output_dir}/#{@filename_proc.call(i18n_language)}.#{@target}"
|
43
|
-
end
|
44
|
-
|
45
|
-
def generate_common(i18n_language, path)
|
46
|
-
i18n = prep_keywords(@i18n_languages['en'].merge(@i18n_languages[i18n_language]))
|
47
|
-
common = @common_tmpl.result(binding)
|
48
|
-
write common, path
|
49
|
-
end
|
50
|
-
|
51
|
-
def generate_actions(i18n_language, path)
|
52
|
-
i18n_lexer_class_name = i18n_language.gsub(/[\s-]/, '').capitalize
|
53
|
-
impl = @actions_tmpl.result(binding)
|
54
|
-
write impl, path
|
55
|
-
end
|
56
|
-
|
57
|
-
def prep_keywords(i18n)
|
58
|
-
delimited_keywords = %w{feature background scenario scenario_outline examples}
|
59
|
-
bare_keywords = %w{given when then and but}
|
60
|
-
all_keywords = delimited_keywords + bare_keywords
|
61
|
-
|
62
|
-
all_keywords.each { |kw| i18n[kw] = i18n[kw].split("|") }
|
63
|
-
delimited_keywords.each { |kw| i18n[kw].map! { |v| v += ':'} }
|
64
|
-
bare_keywords.each { |kw| i18n[kw].map! { |v| (v + ' ').sub(/< $/,'')} }
|
65
|
-
all_keywords.each { |kw| i18n[kw] = '("' + i18n[kw].join('" | "') + '")' }
|
66
|
-
i18n
|
67
|
-
end
|
68
|
-
|
69
|
-
def write(content, filename)
|
70
|
-
File.open(filename, "wb") do |file|
|
71
|
-
file.write(content)
|
72
|
-
end
|
73
|
-
end
|
74
|
-
end
|
75
|
-
|
76
|
-
namespace :ragel do
|
77
|
-
desc "Generate i18n sources for C lexers (TODO: Do it for all)"
|
78
|
-
task :c do
|
79
|
-
RagelCompiler.new("c").compile('en')
|
80
|
-
end
|
81
|
-
|
82
|
-
desc "Generate all i18n Ruby lexers"
|
83
|
-
task :rb do
|
84
|
-
RagelCompiler.new("rb").compile_all
|
85
|
-
end
|
86
|
-
|
87
|
-
desc "Generate all i18n Java lexers"
|
88
|
-
task :java do
|
89
|
-
RagelCompiler.new("java").compile_all
|
90
|
-
end
|
91
|
-
end
|
92
|
-
|
93
|
-
desc "Generate all i18n lexers for all programming languages"
|
94
|
-
task :ragel => ['ragel:c', 'ragel:rb', 'ragel:java']
|