gherkin 2.2.1-i386-mswin32 → 2.2.2-i386-mswin32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.gitignore +2 -1
- data/History.txt +7 -1
- data/README.rdoc +2 -3
- data/VERSION +1 -1
- data/gherkin.gemspec +4 -1
- 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 +46 -15
- data/Gemfile.lock +0 -49
data/.gitignore
CHANGED
data/History.txt
CHANGED
@@ -1,4 +1,10 @@
|
|
1
|
-
== 2.2.
|
1
|
+
== 2.2.2 (2010-09-21)
|
2
|
+
|
3
|
+
=== New Features
|
4
|
+
* Use json instead of json_pure (Aslak Hellesøy)
|
5
|
+
* JSON formatter and parser can now omit JSON serialization (for speed) and work directly on objects (Aslak Hellesøy)
|
6
|
+
|
7
|
+
== 2.2.1 (2010-09-12)
|
2
8
|
|
3
9
|
=== New Features
|
4
10
|
* 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,14 +28,13 @@ 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
|
|
37
|
+
|
39
38
|
== Configuring Rake-Compiler for cross compilation
|
40
39
|
In order to build Windows binaries (so we can release Windows gems from OS X/Linux) we need to set up rake-compiler.
|
41
40
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.2.
|
1
|
+
2.2.2
|
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.
|
58
|
+
s.add_development_dependency('rspec', '~> 2.0.0.beta.22')
|
56
59
|
s.add_development_dependency('cucumber', '~> 0.9.0') unless File.directory?(File.join(gherkin_dir, '../cucumber'))
|
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: 3
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 2
|
8
8
|
- 2
|
9
|
-
-
|
10
|
-
version: 2.2.
|
9
|
+
- 2
|
10
|
+
version: 2.2.2
|
11
11
|
platform: i386-mswin32
|
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
|
@@ -37,9 +37,41 @@ dependencies:
|
|
37
37
|
type: :runtime
|
38
38
|
version_requirements: *id001
|
39
39
|
- !ruby/object:Gem::Dependency
|
40
|
-
name:
|
40
|
+
name: json
|
41
41
|
prerelease: false
|
42
42
|
requirement: &id002 !ruby/object:Gem::Requirement
|
43
|
+
none: false
|
44
|
+
requirements:
|
45
|
+
- - ~>
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
hash: 11
|
48
|
+
segments:
|
49
|
+
- 1
|
50
|
+
- 4
|
51
|
+
- 6
|
52
|
+
version: 1.4.6
|
53
|
+
type: :runtime
|
54
|
+
version_requirements: *id002
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: term-ansicolor
|
57
|
+
prerelease: false
|
58
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
59
|
+
none: false
|
60
|
+
requirements:
|
61
|
+
- - ~>
|
62
|
+
- !ruby/object:Gem::Version
|
63
|
+
hash: 29
|
64
|
+
segments:
|
65
|
+
- 1
|
66
|
+
- 0
|
67
|
+
- 5
|
68
|
+
version: 1.0.5
|
69
|
+
type: :runtime
|
70
|
+
version_requirements: *id003
|
71
|
+
- !ruby/object:Gem::Dependency
|
72
|
+
name: rake
|
73
|
+
prerelease: false
|
74
|
+
requirement: &id004 !ruby/object:Gem::Requirement
|
43
75
|
none: false
|
44
76
|
requirements:
|
45
77
|
- - ~>
|
@@ -51,11 +83,11 @@ dependencies:
|
|
51
83
|
- 7
|
52
84
|
version: 0.8.7
|
53
85
|
type: :development
|
54
|
-
version_requirements: *
|
86
|
+
version_requirements: *id004
|
55
87
|
- !ruby/object:Gem::Dependency
|
56
88
|
name: awesome_print
|
57
89
|
prerelease: false
|
58
|
-
requirement: &
|
90
|
+
requirement: &id005 !ruby/object:Gem::Requirement
|
59
91
|
none: false
|
60
92
|
requirements:
|
61
93
|
- - ~>
|
@@ -67,25 +99,25 @@ dependencies:
|
|
67
99
|
- 1
|
68
100
|
version: 0.2.1
|
69
101
|
type: :development
|
70
|
-
version_requirements: *
|
102
|
+
version_requirements: *id005
|
71
103
|
- !ruby/object:Gem::Dependency
|
72
104
|
name: rspec
|
73
105
|
prerelease: false
|
74
|
-
requirement: &
|
106
|
+
requirement: &id006 !ruby/object:Gem::Requirement
|
75
107
|
none: false
|
76
108
|
requirements:
|
77
109
|
- - ~>
|
78
110
|
- !ruby/object:Gem::Version
|
79
|
-
hash:
|
111
|
+
hash: 62196431
|
80
112
|
segments:
|
81
113
|
- 2
|
82
114
|
- 0
|
83
115
|
- 0
|
84
116
|
- beta
|
85
|
-
-
|
86
|
-
version: 2.0.0.beta.
|
117
|
+
- 22
|
118
|
+
version: 2.0.0.beta.22
|
87
119
|
type: :development
|
88
|
-
version_requirements: *
|
120
|
+
version_requirements: *id006
|
89
121
|
description: A fast Gherkin lexer/parser based on the Ragel State Machine Compiler.
|
90
122
|
email: cukes@googlegroups.com
|
91
123
|
executables:
|
@@ -103,7 +135,6 @@ files:
|
|
103
135
|
- .rspec
|
104
136
|
- .rvmrc
|
105
137
|
- Gemfile
|
106
|
-
- Gemfile.lock
|
107
138
|
- History.txt
|
108
139
|
- LICENSE
|
109
140
|
- README.rdoc
|
@@ -352,7 +383,7 @@ rubyforge_project:
|
|
352
383
|
rubygems_version: 1.3.7
|
353
384
|
signing_key:
|
354
385
|
specification_version: 3
|
355
|
-
summary: gherkin-2.2.
|
386
|
+
summary: gherkin-2.2.2
|
356
387
|
test_files:
|
357
388
|
- features/escaped_pipes.feature
|
358
389
|
- 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)
|