belly 0.5.0 → 0.5.1
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/.belly +4 -1
- data/VERSION +1 -1
- data/belly.gemspec +2 -3
- data/features/support/belly.rb +1 -1
- data/lib/belly.rb +0 -2
- data/lib/belly/cli/init.rb +52 -21
- data/lib/belly/cli/rerun.rb +15 -1
- data/lib/belly/for/cucumber.rb +1 -0
- metadata +3 -4
- data/lib/belly/rerun.rb +0 -13
data/.belly
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.5.
|
1
|
+
0.5.1
|
data/belly.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{belly}
|
8
|
-
s.version = "0.5.
|
8
|
+
s.version = "0.5.1"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Matt Wynne"]
|
12
|
-
s.date = %q{2010-08-
|
12
|
+
s.date = %q{2010-08-23}
|
13
13
|
s.default_executable = %q{belly}
|
14
14
|
s.description = %q{Client app for the incredible new belly web service, coming soon.}
|
15
15
|
s.email = %q{matt@mattwynne.net}
|
@@ -51,7 +51,6 @@ Gem::Specification.new do |s|
|
|
51
51
|
"lib/belly/client/hub_proxy.rb",
|
52
52
|
"lib/belly/for/cucumber.rb",
|
53
53
|
"lib/belly/messages/cucumber_scenario_result_message.rb",
|
54
|
-
"lib/belly/rerun.rb",
|
55
54
|
"spec/belly/project_initializer_spec.rb",
|
56
55
|
"spec/spec_helper.rb"
|
57
56
|
]
|
data/features/support/belly.rb
CHANGED
@@ -1 +1 @@
|
|
1
|
-
require
|
1
|
+
require 'belly/for/cucumber'
|
data/lib/belly.rb
CHANGED
data/lib/belly/cli/init.rb
CHANGED
@@ -7,29 +7,60 @@ Usage: belly init
|
|
7
7
|
Initialize your project for use with the belly service
|
8
8
|
|
9
9
|
EOF
|
10
|
+
opt :force, 'Overwite files even if they already exist', :default => false
|
10
11
|
end
|
11
12
|
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
You can configure Belly's settings by creating a .belly file in root of your project.
|
26
|
-
If you don't create one, I'll just use some defaults.
|
27
|
-
|
28
|
-
Here's an example:
|
13
|
+
require 'belly/client/default_config'
|
14
|
+
module Belly
|
15
|
+
class Init
|
16
|
+
|
17
|
+
def initialize(options)
|
18
|
+
@options = options
|
19
|
+
end
|
20
|
+
|
21
|
+
def run(ui)
|
22
|
+
unless File.exists?('features/support')
|
23
|
+
ui.die("It doesn't look like you are in a project with Cucumber features")
|
24
|
+
end
|
29
25
|
|
30
|
-
|
26
|
+
create_file('features/support/belly.rb') do
|
27
|
+
<<-EOF
|
28
|
+
require 'belly/for/cucumber'
|
29
|
+
EOF
|
30
|
+
end
|
31
|
+
|
32
|
+
create_file('.belly') do
|
33
|
+
<<-EOF
|
34
|
+
hub: #{default_config.host}:#{default_config.port}
|
35
|
+
project: #{default_config.project}
|
31
36
|
user:
|
32
|
-
name: #{
|
33
|
-
email: #{
|
37
|
+
name: #{default_config.user[:name]}
|
38
|
+
email: #{default_config.user[:email]}
|
34
39
|
EOF
|
35
|
-
end
|
40
|
+
end
|
41
|
+
|
42
|
+
puts
|
43
|
+
puts "Lovely. Your project is now initialized for use with Belly."
|
44
|
+
puts "You can edit your project's settings by editing the .belly file in this folder."
|
45
|
+
end
|
46
|
+
|
47
|
+
private
|
48
|
+
|
49
|
+
def default_config
|
50
|
+
@default_config ||= Belly::Client::DefaultConfig.new
|
51
|
+
end
|
52
|
+
|
53
|
+
def create_file(target)
|
54
|
+
FileUtils.rm_rf(target) if @options[:force]
|
55
|
+
if File.exists?(target)
|
56
|
+
Trollop.die("#{target} already exists. Use --force to make me overwrite it")
|
57
|
+
end
|
58
|
+
File.open(target, 'w') do |f|
|
59
|
+
f.puts yield
|
60
|
+
end
|
61
|
+
puts "Created #{target}"
|
62
|
+
end
|
63
|
+
end
|
64
|
+
end
|
65
|
+
|
66
|
+
Belly::Init.new(options).run(Trollop)
|
data/lib/belly/cli/rerun.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
require 'belly/
|
1
|
+
require 'belly/client'
|
2
2
|
|
3
3
|
options = Trollop::options do
|
4
4
|
banner <<-EOF
|
@@ -12,4 +12,18 @@ EOF
|
|
12
12
|
opt :name, "Name of the project", :default => File.basename(Dir.pwd)
|
13
13
|
end
|
14
14
|
|
15
|
+
module Belly
|
16
|
+
class Rerun
|
17
|
+
def initialize(options)
|
18
|
+
|
19
|
+
end
|
20
|
+
|
21
|
+
def run(ui)
|
22
|
+
Belly.hub.get_failing_scenarios_for_project_named(Belly.config.project).each do |scenario|
|
23
|
+
puts "#{scenario["file_name"]}:#{scenario["line_number"]}"
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
15
29
|
Belly::Rerun.new(options).run(Trollop)
|
data/lib/belly/for/cucumber.rb
CHANGED
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 5
|
8
|
-
-
|
9
|
-
version: 0.5.
|
8
|
+
- 1
|
9
|
+
version: 0.5.1
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Matt Wynne
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2010-08-
|
17
|
+
date: 2010-08-23 00:00:00 +01:00
|
18
18
|
default_executable: belly
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
@@ -83,7 +83,6 @@ files:
|
|
83
83
|
- lib/belly/client/hub_proxy.rb
|
84
84
|
- lib/belly/for/cucumber.rb
|
85
85
|
- lib/belly/messages/cucumber_scenario_result_message.rb
|
86
|
-
- lib/belly/rerun.rb
|
87
86
|
- spec/belly/project_initializer_spec.rb
|
88
87
|
- spec/spec_helper.rb
|
89
88
|
has_rdoc: true
|
data/lib/belly/rerun.rb
DELETED
@@ -1,13 +0,0 @@
|
|
1
|
-
module Belly
|
2
|
-
class Rerun
|
3
|
-
def initialize(options)
|
4
|
-
|
5
|
-
end
|
6
|
-
|
7
|
-
def run(ui)
|
8
|
-
Belly.hub.get_failing_scenarios_for_project_named(Belly.config.project).each do |scenario|
|
9
|
-
puts "#{scenario["file_name"]}:#{scenario["line_number"]}"
|
10
|
-
end
|
11
|
-
end
|
12
|
-
end
|
13
|
-
end
|