gherkin 1.0.4 → 1.0.5
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +8 -0
- data/README.rdoc +7 -1
- data/Rakefile +7 -2
- data/VERSION.yml +1 -1
- data/gherkin.gemspec +10 -8
- data/ikvm/.gitignore +3 -0
- data/lib/gherkin/parser/parser.rb +7 -2
- data/ragel/lexer.java.rl.erb +1 -1
- data/spec/gherkin/parser/parser_spec.rb +15 -0
- data/tasks/compile.rake +3 -1
- data/tasks/ikvm.rake +47 -0
- metadata +9 -7
data/History.txt
CHANGED
@@ -1,3 +1,11 @@
|
|
1
|
+
== 1.0.5 (2009-04-08)
|
2
|
+
|
3
|
+
=== New Features
|
4
|
+
* New .NET build of gherkin - an ikvmc build of gherkin.jar to gherkin.dll. (Aslak Hellesøy)
|
5
|
+
|
6
|
+
=== Bugfixes
|
7
|
+
* Made parsers reusable so that the same instance can parse several features. (Aslak Hellesøy)
|
8
|
+
|
1
9
|
== 1.0.4 (2009-04-07)
|
2
10
|
|
3
11
|
=== New features
|
data/README.rdoc
CHANGED
@@ -28,16 +28,22 @@ E.g. in Bash, export RL_LANG="en,fr,no". This can be quite helpful when modifyin
|
|
28
28
|
|
29
29
|
== Release process
|
30
30
|
|
31
|
+
* Bump version in the VERSION file
|
32
|
+
* Do a file search and replace from old version number to new one.
|
31
33
|
* Run "rake clean spec cucumber" for each platform (1.8.6, 1.8.7, 1.9, jruby) to make sure all is green.
|
32
34
|
* rvm 1.8.7
|
33
|
-
* Bump version in the VERSION file
|
34
35
|
* rake clean jar compile
|
35
36
|
* rake gemspec
|
36
37
|
* git commit -a -m "Release vX.Y.Z"
|
37
38
|
* rake gemcutter:release
|
39
|
+
* rake git:release
|
38
40
|
* ./nativegems.sh
|
39
41
|
* gem push pkg/... (for each native gem)
|
40
42
|
* cd java && mvn deploy
|
43
|
+
* rake ikvm
|
44
|
+
* Upload pkg/gherkin-X.Y.Z.dll to Github: http://github.com/aslakhellesoy/gherkin/downloads
|
45
|
+
|
46
|
+
* Announce on Cucumber list, IRC and Twitter.
|
41
47
|
|
42
48
|
== Configuring Rake-Compiler for cross compilation
|
43
49
|
In order to build Windows binaries (so we can release Windows gems from OS X/Linux) we need to set up rake-compiler.
|
data/Rakefile
CHANGED
@@ -3,6 +3,10 @@ require 'rbconfig'
|
|
3
3
|
require 'rubygems'
|
4
4
|
require 'rake'
|
5
5
|
require 'rake/clean'
|
6
|
+
require 'yaml'
|
7
|
+
|
8
|
+
config = YAML.load_file('VERSION.yml')
|
9
|
+
GHERKIN_VERSION = "#{config[:major]}.#{config[:minor]}.#{config[:patch]}"
|
6
10
|
|
7
11
|
begin
|
8
12
|
require 'jeweler'
|
@@ -16,11 +20,12 @@ begin
|
|
16
20
|
gem.executables = ["gherkin"]
|
17
21
|
gem.add_dependency "trollop", ">= 1.15"
|
18
22
|
gem.add_development_dependency "rspec", ">= 1.3.0"
|
19
|
-
gem.add_development_dependency "cucumber", ">= 0.6.
|
23
|
+
gem.add_development_dependency "cucumber", ">= 0.6.4"
|
20
24
|
gem.add_development_dependency "rake-compiler", ">= 0.7.0" unless defined?(JRUBY_VERSION)
|
21
|
-
gem.add_development_dependency "albacore", ">= 0.1.
|
25
|
+
gem.add_development_dependency "albacore", ">= 0.1.2"
|
22
26
|
|
23
27
|
gem.files -= FileList['dotnet/**/*']
|
28
|
+
gem.files -= FileList['ikvm/**/*']
|
24
29
|
gem.files -= FileList['java/**/*']
|
25
30
|
case ENV['PLATFORM']
|
26
31
|
when 'java'
|
data/VERSION.yml
CHANGED
data/gherkin.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{gherkin}
|
8
|
-
s.version = "1.0.
|
8
|
+
s.version = "1.0.5"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Mike Sassak", "Gregory Hnatiuk", "Aslak Helles\303\270y"]
|
12
|
-
s.date = %q{2010-04-
|
12
|
+
s.date = %q{2010-04-08}
|
13
13
|
s.default_executable = %q{gherkin}
|
14
14
|
s.description = %q{A fast Gherkin lexer/parser based on the Ragel State Machine Compiler.}
|
15
15
|
s.email = %q{cukes@googlegroups.com}
|
@@ -81,6 +81,7 @@ Gem::Specification.new do |s|
|
|
81
81
|
"features/steps_parser.feature",
|
82
82
|
"features/support/env.rb",
|
83
83
|
"gherkin.gemspec",
|
84
|
+
"ikvm/.gitignore",
|
84
85
|
"java/.gitignore",
|
85
86
|
"java/Gherkin.iml",
|
86
87
|
"java/src/main/java/gherkin/lexer/.gitignore",
|
@@ -194,6 +195,7 @@ Gem::Specification.new do |s|
|
|
194
195
|
"tasks/bench/null_listener.rb",
|
195
196
|
"tasks/compile.rake",
|
196
197
|
"tasks/cucumber.rake",
|
198
|
+
"tasks/ikvm.rake",
|
197
199
|
"tasks/ragel_task.rb",
|
198
200
|
"tasks/rdoc.rake",
|
199
201
|
"tasks/rspec.rake"
|
@@ -231,22 +233,22 @@ Gem::Specification.new do |s|
|
|
231
233
|
if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
|
232
234
|
s.add_runtime_dependency(%q<trollop>, [">= 1.15"])
|
233
235
|
s.add_development_dependency(%q<rspec>, [">= 1.3.0"])
|
234
|
-
s.add_development_dependency(%q<cucumber>, [">= 0.6.
|
236
|
+
s.add_development_dependency(%q<cucumber>, [">= 0.6.4"])
|
235
237
|
s.add_development_dependency(%q<rake-compiler>, [">= 0.7.0"])
|
236
|
-
s.add_development_dependency(%q<albacore>, [">= 0.1.
|
238
|
+
s.add_development_dependency(%q<albacore>, [">= 0.1.2"])
|
237
239
|
else
|
238
240
|
s.add_dependency(%q<trollop>, [">= 1.15"])
|
239
241
|
s.add_dependency(%q<rspec>, [">= 1.3.0"])
|
240
|
-
s.add_dependency(%q<cucumber>, [">= 0.6.
|
242
|
+
s.add_dependency(%q<cucumber>, [">= 0.6.4"])
|
241
243
|
s.add_dependency(%q<rake-compiler>, [">= 0.7.0"])
|
242
|
-
s.add_dependency(%q<albacore>, [">= 0.1.
|
244
|
+
s.add_dependency(%q<albacore>, [">= 0.1.2"])
|
243
245
|
end
|
244
246
|
else
|
245
247
|
s.add_dependency(%q<trollop>, [">= 1.15"])
|
246
248
|
s.add_dependency(%q<rspec>, [">= 1.3.0"])
|
247
|
-
s.add_dependency(%q<cucumber>, [">= 0.6.
|
249
|
+
s.add_dependency(%q<cucumber>, [">= 0.6.4"])
|
248
250
|
s.add_dependency(%q<rake-compiler>, [">= 0.7.0"])
|
249
|
-
s.add_dependency(%q<albacore>, [">= 0.1.
|
251
|
+
s.add_dependency(%q<albacore>, [">= 0.1.2"])
|
250
252
|
end
|
251
253
|
end
|
252
254
|
|
data/ikvm/.gitignore
ADDED
@@ -7,7 +7,7 @@ module Gherkin
|
|
7
7
|
end
|
8
8
|
|
9
9
|
class Parser
|
10
|
-
def self.new(listener, raise_on_error=
|
10
|
+
def self.new(listener, raise_on_error=true, machine_name='root')
|
11
11
|
if defined?(JRUBY_VERSION)
|
12
12
|
require 'gherkin.jar'
|
13
13
|
Java::GherkinParser::Parser.new(listener, raise_on_error, machine_name)
|
@@ -21,7 +21,8 @@ module Gherkin
|
|
21
21
|
@listener = listener
|
22
22
|
@raise_on_error = raise_on_error
|
23
23
|
@machines = []
|
24
|
-
|
24
|
+
@machine_name = machine_name
|
25
|
+
push_machine(@machine_name)
|
25
26
|
end
|
26
27
|
|
27
28
|
# Doesn't yet fall back to super
|
@@ -30,6 +31,10 @@ module Gherkin
|
|
30
31
|
if(event(method.to_s, args[-1]))
|
31
32
|
@listener.send(method, *args)
|
32
33
|
end
|
34
|
+
if method == :eof
|
35
|
+
pop_machine
|
36
|
+
push_machine(@machine_name)
|
37
|
+
end
|
33
38
|
end
|
34
39
|
|
35
40
|
def event(ev, line)
|
data/ragel/lexer.java.rl.erb
CHANGED
@@ -140,7 +140,7 @@ public class <%= @i18n.sanitized_key.capitalize %> implements Lexer {
|
|
140
140
|
|
141
141
|
%% write data noerror;
|
142
142
|
|
143
|
-
public void scan(CharSequence inputSequence) {
|
143
|
+
public void scan(CharSequence inputSequence) throws Exception {
|
144
144
|
String input = inputSequence.toString() + "\n%_FEATURE_END_%";
|
145
145
|
byte[] data = input.getBytes();
|
146
146
|
int cs, p = 0, pe = data.length;
|
@@ -30,6 +30,21 @@ module Gherkin
|
|
30
30
|
@parser = Parser.new(@listener, false)
|
31
31
|
@parser.background("Background", "Content", 1)
|
32
32
|
end
|
33
|
+
|
34
|
+
[true, false].each do |native|
|
35
|
+
it "should be reusable for several feature files (native lexer: #{native})" do
|
36
|
+
listener = mock('listener', :null_object => true)
|
37
|
+
parser = Parser.new(listener, true)
|
38
|
+
lexer = I18nLexer.new(parser, native)
|
39
|
+
feature = <<-EOF
|
40
|
+
Feature: foo
|
41
|
+
Scenario: bar
|
42
|
+
Given zap
|
43
|
+
EOF
|
44
|
+
lexer.scan(feature)
|
45
|
+
lexer.scan(feature)
|
46
|
+
end
|
47
|
+
end
|
33
48
|
end
|
34
49
|
end
|
35
50
|
end
|
data/tasks/compile.rake
CHANGED
data/tasks/ikvm.rake
ADDED
@@ -0,0 +1,47 @@
|
|
1
|
+
# To test out the pure Java main program on .NET, execute:
|
2
|
+
#
|
3
|
+
# rake ikvm
|
4
|
+
#
|
5
|
+
# Just print dots:
|
6
|
+
#
|
7
|
+
# [mono] pkg/gherkin.exe features
|
8
|
+
#
|
9
|
+
# Pretty print all to STDOUT:
|
10
|
+
#
|
11
|
+
# [mono] pkg/gherkin.exe features pretty
|
12
|
+
#
|
13
|
+
# To test out the pure C# main program on .NET, execute:
|
14
|
+
#
|
15
|
+
# rake ikvm (you need this to generate all the .dll files needed for the next step)
|
16
|
+
#
|
17
|
+
# Then build ikvm/Gherkin.sln. Then:
|
18
|
+
#
|
19
|
+
# [mono] mono ikvm/Gherkin/bin/Debug/Gherkin.exe features/steps_parser.feature
|
20
|
+
#
|
21
|
+
namespace :ikvm do
|
22
|
+
desc 'Make a .NET .exe'
|
23
|
+
task :exe => 'pkg/gherkin.exe'
|
24
|
+
|
25
|
+
desc 'Make a .NET .dll'
|
26
|
+
task :dll => 'pkg/gherkin.dll'
|
27
|
+
|
28
|
+
file 'pkg/gherkin.exe' => 'lib/gherkin.jar' do
|
29
|
+
mkdir_p 'pkg' unless File.directory?('pkg')
|
30
|
+
sh("mono /usr/local/ikvm/bin/ikvmc.exe -target:exe lib/gherkin.jar -out:pkg/gherkin-#{GHERKIN_VERSION}.exe")
|
31
|
+
end
|
32
|
+
|
33
|
+
file 'pkg/gherkin.dll' => 'lib/gherkin.jar' do
|
34
|
+
mkdir_p 'pkg' unless File.directory?('pkg')
|
35
|
+
sh("mono /usr/local/ikvm/bin/ikvmc.exe -target:library lib/gherkin.jar -out:pkg/gherkin-#{GHERKIN_VERSION}.dll")
|
36
|
+
end
|
37
|
+
|
38
|
+
desc 'Copy the IKVM .dll files over to the pkg dir'
|
39
|
+
task :copy_ikvm_dlls do
|
40
|
+
Dir['/usr/local/ikvm/bin/{IKVM.OpenJDK.Core,IKVM.OpenJDK.Text,IKVM.Runtime}.dll'].each do |dll|
|
41
|
+
cp dll, 'pkg'
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
task :ikvm => ['ikvm:exe', 'ikvm:dll', 'ikvm:copy_ikvm_dlls']
|
47
|
+
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 1
|
7
7
|
- 0
|
8
|
-
-
|
9
|
-
version: 1.0.
|
8
|
+
- 5
|
9
|
+
version: 1.0.5
|
10
10
|
platform: ruby
|
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-04-
|
19
|
+
date: 2010-04-08 00:00:00 +02:00
|
20
20
|
default_executable: gherkin
|
21
21
|
dependencies:
|
22
22
|
- !ruby/object:Gem::Dependency
|
@@ -56,8 +56,8 @@ dependencies:
|
|
56
56
|
segments:
|
57
57
|
- 0
|
58
58
|
- 6
|
59
|
-
-
|
60
|
-
version: 0.6.
|
59
|
+
- 4
|
60
|
+
version: 0.6.4
|
61
61
|
type: :development
|
62
62
|
version_requirements: *id003
|
63
63
|
- !ruby/object:Gem::Dependency
|
@@ -84,8 +84,8 @@ dependencies:
|
|
84
84
|
segments:
|
85
85
|
- 0
|
86
86
|
- 1
|
87
|
-
-
|
88
|
-
version: 0.1.
|
87
|
+
- 2
|
88
|
+
version: 0.1.2
|
89
89
|
type: :development
|
90
90
|
version_requirements: *id005
|
91
91
|
description: A fast Gherkin lexer/parser based on the Ragel State Machine Compiler.
|
@@ -199,6 +199,7 @@ files:
|
|
199
199
|
- features/steps_parser.feature
|
200
200
|
- features/support/env.rb
|
201
201
|
- gherkin.gemspec
|
202
|
+
- ikvm/.gitignore
|
202
203
|
- java/.gitignore
|
203
204
|
- java/Gherkin.iml
|
204
205
|
- java/src/main/java/gherkin/lexer/.gitignore
|
@@ -312,6 +313,7 @@ files:
|
|
312
313
|
- tasks/bench/null_listener.rb
|
313
314
|
- tasks/compile.rake
|
314
315
|
- tasks/cucumber.rake
|
316
|
+
- tasks/ikvm.rake
|
315
317
|
- tasks/ragel_task.rb
|
316
318
|
- tasks/rdoc.rake
|
317
319
|
- tasks/rspec.rake
|