wally 0.0.28 → 0.0.29
Sign up to get free protection for your applications and to get access to all the features.
- data/bin/wally +3 -1
- data/features/counts.feature +2 -2
- data/features/step_definitions/browse_features_steps.rb +0 -5
- data/features/step_definitions/push_features_steps.rb +2 -1
- data/features/support/env.rb +1 -1
- data/lib/wally.rb +1 -0
- data/lib/wally/application.rb +1 -1
- data/lib/wally/feature.rb +1 -1
- data/lib/wally/lists_features.rb +3 -14
- data/lib/wally/parses_features.rb +23 -0
- data/lib/wally/version.rb +1 -1
- data/spec/wally/counts_tags_spec.rb +1 -2
- data/spec/wally/feature_spec.rb +9 -10
- data/spec/wally/lists_features_spec.rb +1 -1
- data/spec/wally/parses_features_spec.rb +17 -0
- data/spec/wally/search_features_spec.rb +1 -1
- metadata +26 -23
data/bin/wally
CHANGED
@@ -7,9 +7,11 @@ if ARGV.first == "server"
|
|
7
7
|
elsif ARGV[0] == "push"
|
8
8
|
require "restclient"
|
9
9
|
require "json"
|
10
|
+
require "wally"
|
10
11
|
features = []
|
11
12
|
Dir.glob(File.join("#{ARGV[2]}", "**/*.feature")).each do |feature_path|
|
12
|
-
|
13
|
+
gherkin = Wally::ParsesFeatures.new.parse(File.read(feature_path))
|
14
|
+
features << {:path => feature_path, :gherkin => gherkin}
|
13
15
|
end
|
14
16
|
RestClient.put "#{ARGV[1]}/features/?authentication_code=#{File.read(".wally")}", features.to_json, {:content_type => :json, :accept => :json}
|
15
17
|
end
|
data/features/counts.feature
CHANGED
@@ -13,7 +13,8 @@ Given /^I have a \.wally authentication file$/ do
|
|
13
13
|
end
|
14
14
|
|
15
15
|
When /^I put data to \/features with the authentication code$/ do
|
16
|
-
|
16
|
+
gherkin = Wally::ParsesFeatures.new.parse("Feature: Feature Name")
|
17
|
+
data = [{:path => "feature-name.feature", :gherkin => gherkin}].to_json
|
17
18
|
page.driver.put "/features?authentication_code=#{@authentication_code}", data
|
18
19
|
end
|
19
20
|
|
data/features/support/env.rb
CHANGED
data/lib/wally.rb
CHANGED
data/lib/wally/application.rb
CHANGED
data/lib/wally/feature.rb
CHANGED
data/lib/wally/lists_features.rb
CHANGED
@@ -14,22 +14,11 @@ module Wally
|
|
14
14
|
def features
|
15
15
|
features = []
|
16
16
|
Feature.all.each do |feature|
|
17
|
-
|
18
|
-
|
19
|
-
features <<
|
17
|
+
gherkin = feature.gherkin
|
18
|
+
gherkin["path"] = feature.path
|
19
|
+
features << gherkin
|
20
20
|
end
|
21
21
|
features.sort {|a,b| a["name"] <=> b["name"]}
|
22
22
|
end
|
23
|
-
|
24
|
-
private
|
25
|
-
|
26
|
-
def parse_gherkin(text)
|
27
|
-
io = StringIO.new
|
28
|
-
formatter = Gherkin::Formatter::JSONFormatter.new(io)
|
29
|
-
parser = Gherkin::Parser::Parser.new(formatter, false, 'root')
|
30
|
-
parser.parse(text, nil, 0)
|
31
|
-
hash = formatter.to_hash
|
32
|
-
hash
|
33
|
-
end
|
34
23
|
end
|
35
24
|
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
require 'gherkin/formatter/json_formatter'
|
2
|
+
require 'gherkin/parser/parser'
|
3
|
+
|
4
|
+
module Gherkin::Formatter
|
5
|
+
class JSONFormatter
|
6
|
+
def to_hash
|
7
|
+
@feature_hash
|
8
|
+
end
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
module Wally
|
13
|
+
class ParsesFeatures
|
14
|
+
def parse text
|
15
|
+
io = StringIO.new
|
16
|
+
formatter = Gherkin::Formatter::JSONFormatter.new(io)
|
17
|
+
parser = Gherkin::Parser::Parser.new(formatter, false, 'root')
|
18
|
+
parser.parse(text, nil, 0)
|
19
|
+
hash = formatter.to_hash
|
20
|
+
hash
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
data/lib/wally/version.rb
CHANGED
@@ -1,6 +1,5 @@
|
|
1
1
|
require File.join(File.dirname(__FILE__), "..", "spec_helper")
|
2
2
|
require 'fileutils'
|
3
|
-
require "wally/counts_tags"
|
4
3
|
|
5
4
|
module Wally
|
6
5
|
describe CountsTags do
|
@@ -11,7 +10,7 @@ module Wally
|
|
11
10
|
def create_feature path, content
|
12
11
|
feature = Feature.new
|
13
12
|
feature.path = path
|
14
|
-
feature.
|
13
|
+
feature.gherkin = ParsesFeatures.new.parse(content)
|
15
14
|
feature.save
|
16
15
|
end
|
17
16
|
|
data/spec/wally/feature_spec.rb
CHANGED
@@ -6,19 +6,18 @@ module Wally
|
|
6
6
|
Feature.delete_all
|
7
7
|
end
|
8
8
|
|
9
|
-
|
10
|
-
feature = Feature.new
|
11
|
-
feature.content = "Feature: Bla"
|
12
|
-
feature.save
|
13
|
-
|
14
|
-
Feature.all.first.content.should == "Feature: Bla"
|
15
|
-
end
|
9
|
+
subject { Feature.new }
|
16
10
|
|
17
11
|
it "stores a feature path" do
|
18
|
-
|
19
|
-
|
20
|
-
feature.save
|
12
|
+
subject.path = "hello.feature"
|
13
|
+
subject.save
|
21
14
|
Feature.all.first.path.should == "hello.feature"
|
22
15
|
end
|
16
|
+
|
17
|
+
it "stores the feature content" do
|
18
|
+
subject.gherkin = {"meh" => "ble"}
|
19
|
+
subject.save
|
20
|
+
Feature.all.first.gherkin.should == {"meh" => "ble"}
|
21
|
+
end
|
23
22
|
end
|
24
23
|
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
require File.join(File.dirname(__FILE__), "..", "spec_helper")
|
2
|
+
|
3
|
+
module Wally
|
4
|
+
describe ParsesFeatures do
|
5
|
+
it "parses feature files" do
|
6
|
+
feature = "Feature: Do stuff!"
|
7
|
+
ParsesFeatures.new.parse(feature).should == {
|
8
|
+
"keyword" => "Feature",
|
9
|
+
"name" => "Do stuff!",
|
10
|
+
"line" => 1,
|
11
|
+
"description" => "",
|
12
|
+
"id" => "do-stuff!",
|
13
|
+
"uri" => nil
|
14
|
+
}
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: wally
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.29
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -13,7 +13,7 @@ date: 2011-12-05 00:00:00.000000000Z
|
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rest-client
|
16
|
-
requirement: &
|
16
|
+
requirement: &70100057374200 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: '0'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70100057374200
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: sinatra
|
27
|
-
requirement: &
|
27
|
+
requirement: &70100057373740 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ! '>='
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: '0'
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *70100057373740
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: haml
|
38
|
-
requirement: &
|
38
|
+
requirement: &70100057373320 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ! '>='
|
@@ -43,10 +43,10 @@ dependencies:
|
|
43
43
|
version: '0'
|
44
44
|
type: :runtime
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *70100057373320
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: rdiscount
|
49
|
-
requirement: &
|
49
|
+
requirement: &70100057372900 !ruby/object:Gem::Requirement
|
50
50
|
none: false
|
51
51
|
requirements:
|
52
52
|
- - ! '>='
|
@@ -54,10 +54,10 @@ dependencies:
|
|
54
54
|
version: '0'
|
55
55
|
type: :runtime
|
56
56
|
prerelease: false
|
57
|
-
version_requirements: *
|
57
|
+
version_requirements: *70100057372900
|
58
58
|
- !ruby/object:Gem::Dependency
|
59
59
|
name: gherkin
|
60
|
-
requirement: &
|
60
|
+
requirement: &70100057372480 !ruby/object:Gem::Requirement
|
61
61
|
none: false
|
62
62
|
requirements:
|
63
63
|
- - ! '>='
|
@@ -65,10 +65,10 @@ dependencies:
|
|
65
65
|
version: '0'
|
66
66
|
type: :runtime
|
67
67
|
prerelease: false
|
68
|
-
version_requirements: *
|
68
|
+
version_requirements: *70100057372480
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: komainu
|
71
|
-
requirement: &
|
71
|
+
requirement: &70100057372060 !ruby/object:Gem::Requirement
|
72
72
|
none: false
|
73
73
|
requirements:
|
74
74
|
- - ! '>='
|
@@ -76,10 +76,10 @@ dependencies:
|
|
76
76
|
version: '0'
|
77
77
|
type: :runtime
|
78
78
|
prerelease: false
|
79
|
-
version_requirements: *
|
79
|
+
version_requirements: *70100057372060
|
80
80
|
- !ruby/object:Gem::Dependency
|
81
81
|
name: cucumber
|
82
|
-
requirement: &
|
82
|
+
requirement: &70100057371600 !ruby/object:Gem::Requirement
|
83
83
|
none: false
|
84
84
|
requirements:
|
85
85
|
- - ! '>='
|
@@ -87,10 +87,10 @@ dependencies:
|
|
87
87
|
version: '0'
|
88
88
|
type: :development
|
89
89
|
prerelease: false
|
90
|
-
version_requirements: *
|
90
|
+
version_requirements: *70100057371600
|
91
91
|
- !ruby/object:Gem::Dependency
|
92
92
|
name: capybara
|
93
|
-
requirement: &
|
93
|
+
requirement: &70100057371180 !ruby/object:Gem::Requirement
|
94
94
|
none: false
|
95
95
|
requirements:
|
96
96
|
- - ! '>='
|
@@ -98,10 +98,10 @@ dependencies:
|
|
98
98
|
version: '0'
|
99
99
|
type: :development
|
100
100
|
prerelease: false
|
101
|
-
version_requirements: *
|
101
|
+
version_requirements: *70100057371180
|
102
102
|
- !ruby/object:Gem::Dependency
|
103
103
|
name: rspec
|
104
|
-
requirement: &
|
104
|
+
requirement: &70100057370760 !ruby/object:Gem::Requirement
|
105
105
|
none: false
|
106
106
|
requirements:
|
107
107
|
- - ! '>='
|
@@ -109,10 +109,10 @@ dependencies:
|
|
109
109
|
version: '0'
|
110
110
|
type: :development
|
111
111
|
prerelease: false
|
112
|
-
version_requirements: *
|
112
|
+
version_requirements: *70100057370760
|
113
113
|
- !ruby/object:Gem::Dependency
|
114
114
|
name: fakefs
|
115
|
-
requirement: &
|
115
|
+
requirement: &70100057370340 !ruby/object:Gem::Requirement
|
116
116
|
none: false
|
117
117
|
requirements:
|
118
118
|
- - ! '>='
|
@@ -120,10 +120,10 @@ dependencies:
|
|
120
120
|
version: '0'
|
121
121
|
type: :development
|
122
122
|
prerelease: false
|
123
|
-
version_requirements: *
|
123
|
+
version_requirements: *70100057370340
|
124
124
|
- !ruby/object:Gem::Dependency
|
125
125
|
name: launchy
|
126
|
-
requirement: &
|
126
|
+
requirement: &70100057369880 !ruby/object:Gem::Requirement
|
127
127
|
none: false
|
128
128
|
requirements:
|
129
129
|
- - ! '>='
|
@@ -131,7 +131,7 @@ dependencies:
|
|
131
131
|
version: '0'
|
132
132
|
type: :development
|
133
133
|
prerelease: false
|
134
|
-
version_requirements: *
|
134
|
+
version_requirements: *70100057369880
|
135
135
|
description: ''
|
136
136
|
email:
|
137
137
|
- andrew.vos@gmail.com
|
@@ -172,6 +172,7 @@ files:
|
|
172
172
|
- lib/wally/counts_tags.rb
|
173
173
|
- lib/wally/feature.rb
|
174
174
|
- lib/wally/lists_features.rb
|
175
|
+
- lib/wally/parses_features.rb
|
175
176
|
- lib/wally/public/bootstrap.min.css
|
176
177
|
- lib/wally/public/skin.css
|
177
178
|
- lib/wally/public/wally-logo.png
|
@@ -189,6 +190,7 @@ files:
|
|
189
190
|
- spec/wally/counts_tags_spec.rb
|
190
191
|
- spec/wally/feature_spec.rb
|
191
192
|
- spec/wally/lists_features_spec.rb
|
193
|
+
- spec/wally/parses_features_spec.rb
|
192
194
|
- spec/wally/search_features_spec.rb
|
193
195
|
- wally.gemspec
|
194
196
|
homepage: ''
|
@@ -234,4 +236,5 @@ test_files:
|
|
234
236
|
- spec/wally/counts_tags_spec.rb
|
235
237
|
- spec/wally/feature_spec.rb
|
236
238
|
- spec/wally/lists_features_spec.rb
|
239
|
+
- spec/wally/parses_features_spec.rb
|
237
240
|
- spec/wally/search_features_spec.rb
|