gherkin 2.2.1 → 2.2.3
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +2 -1
- data/Gemfile +1 -0
- data/History.txt +12 -1
- data/README.rdoc +1 -3
- data/VERSION +1 -1
- data/gherkin.gemspec +5 -2
- data/lib/gherkin/formatter/json_formatter.rb +10 -4
- data/lib/gherkin/json_parser.rb +4 -2
- data/spec/gherkin/parser/parser_spec.rb +7 -5
- data/spec/spec_helper.rb +0 -1
- metadata +61 -14
- data/Gemfile.lock +0 -49
data/.gitignore
CHANGED
data/Gemfile
CHANGED
data/History.txt
CHANGED
@@ -1,4 +1,15 @@
|
|
1
|
-
== 2.2.
|
1
|
+
== 2.2.3 (2010-09-21)
|
2
|
+
|
3
|
+
=== Bugfixes
|
4
|
+
* Add back missing development dependency on cucumber (Aslak Hellesøy)
|
5
|
+
|
6
|
+
== 2.2.2 (2010-09-21)
|
7
|
+
|
8
|
+
=== New Features
|
9
|
+
* Use json instead of json_pure (Aslak Hellesøy)
|
10
|
+
* JSON formatter and parser can now omit JSON serialization (for speed) and work directly on objects (Aslak Hellesøy)
|
11
|
+
|
12
|
+
== 2.2.1 (2010-09-12)
|
2
13
|
|
3
14
|
=== New Features
|
4
15
|
* Windows gems are now built against 1.8.6-p287 and 1.9.1-p243, on both mswin32 and mingw32, and should work on 1.8.6, 1.8.7, 1.9.1 and 1.9.2 versions of rubyinstaller.org as well as older windows rubies. (Aslak Hellesøy)
|
data/README.rdoc
CHANGED
@@ -28,11 +28,9 @@ 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
|
31
|
+
* Bump version in the VERSION file and:
|
32
32
|
** java/pom.xml
|
33
33
|
** ikvm/Gherkin/Gherkin.csproj
|
34
|
-
* Make sure both JRuby and MRI has the latest Cucumber installed (from source) otherwise the jruby gem might not get the jar inside it.
|
35
|
-
** Install cucumber without gherkin dep: gem install --ignore-dependencies pkg/cucumber
|
36
34
|
* rake gems:prepare && ./build_native_gems.sh && rake release:ALL
|
37
35
|
* Announce on Cucumber list, IRC and Twitter.
|
38
36
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.2.
|
1
|
+
2.2.3
|
data/gherkin.gemspec
CHANGED
@@ -50,8 +50,11 @@ Gem::Specification.new do |s|
|
|
50
50
|
end
|
51
51
|
|
52
52
|
s.add_dependency('trollop', '~> 1.16.2')
|
53
|
+
s.add_dependency('json', '~> 1.4.6')
|
54
|
+
s.add_dependency('term-ansicolor','~> 1.0.5')
|
55
|
+
|
53
56
|
s.add_development_dependency('rake', '~> 0.8.7')
|
54
57
|
s.add_development_dependency('awesome_print', '~> 0.2.1')
|
55
|
-
s.add_development_dependency('rspec', '~> 2.0.0.beta.
|
56
|
-
s.add_development_dependency('cucumber', '~> 0.9.0')
|
58
|
+
s.add_development_dependency('rspec', '~> 2.0.0.beta.22')
|
59
|
+
s.add_development_dependency('cucumber', '~> 0.9.0')
|
57
60
|
end
|
@@ -1,5 +1,4 @@
|
|
1
1
|
require 'json'
|
2
|
-
require 'json/pure' # Needed to make JSON.generate work.
|
3
2
|
require 'gherkin/formatter/model'
|
4
3
|
require 'gherkin/native'
|
5
4
|
|
@@ -8,15 +7,22 @@ module Gherkin
|
|
8
7
|
class JSONFormatter
|
9
8
|
native_impl('gherkin')
|
10
9
|
|
10
|
+
attr_reader :gherkin_object
|
11
|
+
|
12
|
+
# Creates a new instance that writes the resulting JSON to +io+.
|
13
|
+
# If +io+ is nil, the JSON will not be written, but instead a Ruby
|
14
|
+
# object can be retrieved with #gherkin_object
|
11
15
|
def initialize(io)
|
12
16
|
@io = io
|
13
17
|
end
|
14
18
|
|
15
19
|
def uri(uri)
|
20
|
+
# We're ignoring the uri - we don't want it as part of the JSON
|
21
|
+
# (The pretty formatter uses it just for visual niceness - comments)
|
16
22
|
end
|
17
23
|
|
18
24
|
def feature(feature)
|
19
|
-
@
|
25
|
+
@gherkin_object = feature.to_hash
|
20
26
|
end
|
21
27
|
|
22
28
|
def background(background)
|
@@ -40,13 +46,13 @@ module Gherkin
|
|
40
46
|
end
|
41
47
|
|
42
48
|
def eof
|
43
|
-
@io.write(@
|
49
|
+
@io.write(@gherkin_object.to_json) if @io
|
44
50
|
end
|
45
51
|
|
46
52
|
private
|
47
53
|
|
48
54
|
def feature_elements
|
49
|
-
@
|
55
|
+
@gherkin_object['elements'] ||= []
|
50
56
|
end
|
51
57
|
|
52
58
|
def feature_element
|
data/lib/gherkin/json_parser.rb
CHANGED
@@ -10,9 +10,11 @@ module Gherkin
|
|
10
10
|
@formatter = formatter
|
11
11
|
end
|
12
12
|
|
13
|
-
|
13
|
+
# Parse a gherkin object +o+, which can either be a JSON String,
|
14
|
+
# or a Hash (from a parser JSON String).
|
15
|
+
def parse(o, feature_uri='unknown.json', line_offset=0)
|
16
|
+
o = JSON.parse(o) if String === o
|
14
17
|
@formatter.uri(feature_uri)
|
15
|
-
o = JSON.parse(src)
|
16
18
|
|
17
19
|
Formatter::Model::Feature.new(comments(o), tags(o), keyword(o), name(o), description(o), line(o)).replay(@formatter)
|
18
20
|
(o["elements"] || []).each do |feature_element|
|
@@ -3,11 +3,13 @@ require 'spec_helper'
|
|
3
3
|
module Gherkin
|
4
4
|
module Parser
|
5
5
|
describe Parser do
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
6
|
+
unless defined?(JRUBY_VERSION)
|
7
|
+
it "should raise when feature doesn't parse" do
|
8
|
+
p = Parser.new(mock('formatter').as_null_object)
|
9
|
+
lambda do
|
10
|
+
p.parse("Feature: f\nFeature: f", __FILE__, __LINE__-1)
|
11
|
+
end.should raise_error(/Parse error at/)
|
12
|
+
end
|
11
13
|
end
|
12
14
|
end
|
13
15
|
end
|
data/spec/spec_helper.rb
CHANGED
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:
|
4
|
+
hash: 1
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 2
|
8
8
|
- 2
|
9
|
-
-
|
10
|
-
version: 2.2.
|
9
|
+
- 3
|
10
|
+
version: 2.2.3
|
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-09-
|
20
|
+
date: 2010-09-21 00:00:00 +02:00
|
21
21
|
default_executable: gherkin
|
22
22
|
dependencies:
|
23
23
|
- !ruby/object:Gem::Dependency
|
@@ -54,6 +54,38 @@ dependencies:
|
|
54
54
|
prerelease: false
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
version_requirements: &id003 !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
58
|
+
requirements:
|
59
|
+
- - ~>
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
hash: 11
|
62
|
+
segments:
|
63
|
+
- 1
|
64
|
+
- 4
|
65
|
+
- 6
|
66
|
+
version: 1.4.6
|
67
|
+
requirement: *id003
|
68
|
+
type: :runtime
|
69
|
+
name: json
|
70
|
+
prerelease: false
|
71
|
+
- !ruby/object:Gem::Dependency
|
72
|
+
version_requirements: &id004 !ruby/object:Gem::Requirement
|
73
|
+
none: false
|
74
|
+
requirements:
|
75
|
+
- - ~>
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
hash: 29
|
78
|
+
segments:
|
79
|
+
- 1
|
80
|
+
- 0
|
81
|
+
- 5
|
82
|
+
version: 1.0.5
|
83
|
+
requirement: *id004
|
84
|
+
type: :runtime
|
85
|
+
name: term-ansicolor
|
86
|
+
prerelease: false
|
87
|
+
- !ruby/object:Gem::Dependency
|
88
|
+
version_requirements: &id005 !ruby/object:Gem::Requirement
|
57
89
|
none: false
|
58
90
|
requirements:
|
59
91
|
- - ~>
|
@@ -64,12 +96,12 @@ dependencies:
|
|
64
96
|
- 8
|
65
97
|
- 7
|
66
98
|
version: 0.8.7
|
67
|
-
requirement: *
|
99
|
+
requirement: *id005
|
68
100
|
type: :development
|
69
101
|
name: rake
|
70
102
|
prerelease: false
|
71
103
|
- !ruby/object:Gem::Dependency
|
72
|
-
version_requirements: &
|
104
|
+
version_requirements: &id006 !ruby/object:Gem::Requirement
|
73
105
|
none: false
|
74
106
|
requirements:
|
75
107
|
- - ~>
|
@@ -80,28 +112,44 @@ dependencies:
|
|
80
112
|
- 2
|
81
113
|
- 1
|
82
114
|
version: 0.2.1
|
83
|
-
requirement: *
|
115
|
+
requirement: *id006
|
84
116
|
type: :development
|
85
117
|
name: awesome_print
|
86
118
|
prerelease: false
|
87
119
|
- !ruby/object:Gem::Dependency
|
88
|
-
version_requirements: &
|
120
|
+
version_requirements: &id007 !ruby/object:Gem::Requirement
|
89
121
|
none: false
|
90
122
|
requirements:
|
91
123
|
- - ~>
|
92
124
|
- !ruby/object:Gem::Version
|
93
|
-
hash:
|
125
|
+
hash: 62196431
|
94
126
|
segments:
|
95
127
|
- 2
|
96
128
|
- 0
|
97
129
|
- 0
|
98
130
|
- beta
|
99
|
-
-
|
100
|
-
version: 2.0.0.beta.
|
101
|
-
requirement: *
|
131
|
+
- 22
|
132
|
+
version: 2.0.0.beta.22
|
133
|
+
requirement: *id007
|
102
134
|
type: :development
|
103
135
|
name: rspec
|
104
136
|
prerelease: false
|
137
|
+
- !ruby/object:Gem::Dependency
|
138
|
+
version_requirements: &id008 !ruby/object:Gem::Requirement
|
139
|
+
none: false
|
140
|
+
requirements:
|
141
|
+
- - ~>
|
142
|
+
- !ruby/object:Gem::Version
|
143
|
+
hash: 59
|
144
|
+
segments:
|
145
|
+
- 0
|
146
|
+
- 9
|
147
|
+
- 0
|
148
|
+
version: 0.9.0
|
149
|
+
requirement: *id008
|
150
|
+
type: :development
|
151
|
+
name: cucumber
|
152
|
+
prerelease: false
|
105
153
|
description: A fast Gherkin lexer/parser based on the Ragel State Machine Compiler.
|
106
154
|
email: cukes@googlegroups.com
|
107
155
|
executables:
|
@@ -163,7 +211,6 @@ files:
|
|
163
211
|
- .rspec
|
164
212
|
- .rvmrc
|
165
213
|
- Gemfile
|
166
|
-
- Gemfile.lock
|
167
214
|
- History.txt
|
168
215
|
- LICENSE
|
169
216
|
- README.rdoc
|
@@ -457,7 +504,7 @@ rubyforge_project:
|
|
457
504
|
rubygems_version: 1.3.7
|
458
505
|
signing_key:
|
459
506
|
specification_version: 3
|
460
|
-
summary: gherkin-2.2.
|
507
|
+
summary: gherkin-2.2.3
|
461
508
|
test_files:
|
462
509
|
- features/escaped_pipes.feature
|
463
510
|
- features/feature_parser.feature
|
data/Gemfile.lock
DELETED
@@ -1,49 +0,0 @@
|
|
1
|
-
PATH
|
2
|
-
remote: /Users/aslakhellesoy/scm/cucumber
|
3
|
-
specs:
|
4
|
-
cucumber (0.9.0)
|
5
|
-
builder (~> 2.1.2)
|
6
|
-
diff-lcs (~> 1.1.2)
|
7
|
-
json_pure (~> 1.4.6)
|
8
|
-
term-ansicolor (~> 1.0.5)
|
9
|
-
|
10
|
-
PATH
|
11
|
-
remote: .
|
12
|
-
specs:
|
13
|
-
gherkin (2.2.1)
|
14
|
-
trollop (~> 1.16.2)
|
15
|
-
|
16
|
-
GEM
|
17
|
-
remote: http://rubygems.org/
|
18
|
-
specs:
|
19
|
-
awesome_print (0.2.1)
|
20
|
-
builder (2.1.2)
|
21
|
-
diff-lcs (1.1.2)
|
22
|
-
json_pure (1.4.6)
|
23
|
-
rake (0.8.7)
|
24
|
-
rake-compiler (0.7.1)
|
25
|
-
rake (>= 0.8.3, < 0.9)
|
26
|
-
rspec (2.0.0.beta.20)
|
27
|
-
rspec-core (= 2.0.0.beta.20)
|
28
|
-
rspec-expectations (= 2.0.0.beta.20)
|
29
|
-
rspec-mocks (= 2.0.0.beta.20)
|
30
|
-
rspec-core (2.0.0.beta.20)
|
31
|
-
rspec-expectations (2.0.0.beta.20)
|
32
|
-
diff-lcs (>= 1.1.2)
|
33
|
-
rspec-mocks (2.0.0.beta.20)
|
34
|
-
term-ansicolor (1.0.5)
|
35
|
-
trollop (1.16.2)
|
36
|
-
|
37
|
-
PLATFORMS
|
38
|
-
java
|
39
|
-
ruby
|
40
|
-
x86-mingw32
|
41
|
-
|
42
|
-
DEPENDENCIES
|
43
|
-
awesome_print (~> 0.2.1)
|
44
|
-
cucumber!
|
45
|
-
gherkin!
|
46
|
-
rake (~> 0.8.7)
|
47
|
-
rake-compiler (~> 0.7.1)
|
48
|
-
rspec (~> 2.0.0.beta.20)
|
49
|
-
trollop (~> 1.16.2)
|