crab 0.2.7 → 0.2.8
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +0 -1
- data/bin/crab +27 -14
- data/bin/crab-help +10 -2
- data/bin/crab-it +25 -11
- data/bin/crab-it-help +11 -2
- data/bin/crab-it-list +25 -15
- data/bin/crab-iteration +25 -11
- data/bin/crab-iteration-help +11 -2
- data/bin/crab-iteration-list +25 -15
- data/bin/crab-login +24 -13
- data/bin/crab-logout +22 -9
- data/bin/crab-project +42 -32
- data/bin/crab-rel +25 -11
- data/bin/crab-rel-help +12 -3
- data/bin/crab-rel-list +23 -15
- data/bin/crab-release +25 -11
- data/bin/crab-release-help +12 -3
- data/bin/crab-release-list +23 -15
- data/bin/crab-st +24 -11
- data/bin/crab-st-add +18 -10
- data/bin/crab-st-change +53 -39
- data/bin/crab-st-create +18 -10
- data/bin/crab-st-del +19 -11
- data/bin/crab-st-delete +19 -11
- data/bin/crab-st-find +32 -21
- data/bin/crab-st-help +11 -2
- data/bin/crab-st-list +32 -21
- data/bin/crab-st-ls +32 -21
- data/bin/crab-st-move +26 -14
- data/bin/crab-st-mv +26 -14
- data/bin/crab-st-new +18 -10
- data/bin/crab-st-pull +28 -20
- data/bin/crab-st-ren +26 -14
- data/bin/crab-st-rename +26 -14
- data/bin/crab-st-rm +19 -11
- data/bin/crab-st-show +19 -11
- data/bin/crab-st-up +53 -39
- data/bin/crab-st-update +53 -39
- data/bin/crab-story +24 -11
- data/bin/crab-story-add +18 -10
- data/bin/crab-story-change +53 -39
- data/bin/crab-story-create +18 -10
- data/bin/crab-story-del +19 -11
- data/bin/crab-story-delete +19 -11
- data/bin/crab-story-diff +54 -0
- data/bin/crab-story-find +32 -21
- data/bin/crab-story-help +11 -2
- data/bin/crab-story-list +32 -21
- data/bin/crab-story-ls +32 -21
- data/bin/crab-story-move +26 -14
- data/bin/crab-story-mv +26 -14
- data/bin/crab-story-new +18 -10
- data/bin/crab-story-pull +28 -20
- data/bin/crab-story-ren +26 -14
- data/bin/crab-story-rename +26 -14
- data/bin/crab-story-rm +19 -11
- data/bin/crab-story-show +19 -11
- data/bin/crab-story-up +53 -39
- data/bin/crab-story-update +53 -39
- data/bin/crab-tc +24 -11
- data/bin/crab-tc-add +32 -20
- data/bin/crab-tc-change +18 -8
- data/bin/crab-tc-create +32 -20
- data/bin/crab-tc-del +18 -10
- data/bin/crab-tc-delete +18 -10
- data/bin/crab-tc-find +32 -21
- data/bin/crab-tc-help +11 -2
- data/bin/crab-tc-list +32 -21
- data/bin/crab-tc-ls +32 -21
- data/bin/crab-tc-new +32 -20
- data/bin/crab-tc-rm +18 -10
- data/bin/crab-tc-show +28 -15
- data/bin/crab-tc-up +18 -8
- data/bin/crab-tc-update +18 -8
- data/bin/crab-testcase +24 -11
- data/bin/crab-testcase-add +32 -20
- data/bin/crab-testcase-change +18 -8
- data/bin/crab-testcase-create +32 -20
- data/bin/crab-testcase-del +18 -10
- data/bin/crab-testcase-delete +18 -10
- data/bin/crab-testcase-find +32 -21
- data/bin/crab-testcase-help +11 -2
- data/bin/crab-testcase-list +32 -21
- data/bin/crab-testcase-ls +32 -21
- data/bin/crab-testcase-new +32 -20
- data/bin/crab-testcase-rm +18 -10
- data/bin/crab-testcase-show +28 -15
- data/bin/crab-testcase-up +18 -8
- data/bin/crab-testcase-update +18 -8
- data/bin/crab-truncate +1 -0
- data/bin/crab-version +2 -1
- data/features/subcommand-help.feature +1 -0
- data/lib/crab.rb +2 -0
- data/lib/crab/cucumber_to_rally_adapter.rb +48 -0
- data/lib/crab/rally.rb +21 -1
- data/lib/crab/utilities.rb +10 -2
- data/lib/crab/version.rb +1 -1
- metadata +7 -4
data/README.md
CHANGED
@@ -146,7 +146,6 @@ To do / Roadmap
|
|
146
146
|
|
147
147
|
- `pull` is not very smart and could detect feature files being moved from one dir to another
|
148
148
|
- Recursively look for a `.crab` directory like Git does with `.git`
|
149
|
-
- Verbose logging (especially before any change or destructive operations in Rally)
|
150
149
|
- Figure out how to stub or simulate Rally (tests are taking way too long already)
|
151
150
|
|
152
151
|
### 0.3.0
|
data/bin/crab
CHANGED
@@ -1,21 +1,34 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
# vim: set ft=ruby:
|
3
|
+
require 'crab'
|
3
4
|
|
4
|
-
|
5
|
+
class Crab::Main
|
5
6
|
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
exit 0
|
13
|
-
end
|
7
|
+
class << self
|
8
|
+
|
9
|
+
include Crab::Utilities
|
10
|
+
|
11
|
+
def run(args=ARGV)
|
12
|
+
cmd = args.shift # get the subcommand
|
14
13
|
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
14
|
+
case cmd
|
15
|
+
when "-h", "--help", NilClass
|
16
|
+
system "crab-help"
|
17
|
+
exit 0
|
18
|
+
when "-v", "--version"
|
19
|
+
system "crab-version"
|
20
|
+
exit 0
|
21
|
+
end
|
22
|
+
|
23
|
+
unless system("crab-#{cmd}", *args)
|
24
|
+
if $?.exitstatus == 127 # bash 'command not found'
|
25
|
+
logger.error "Unknown subcommand #{cmd.inspect}"
|
26
|
+
system "crab-help"
|
27
|
+
exit 127
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
20
31
|
end
|
21
32
|
end
|
33
|
+
|
34
|
+
Crab::Main.run
|
data/bin/crab-help
CHANGED
@@ -1,7 +1,11 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
1
2
|
# vim: set ft=ruby :
|
2
3
|
require 'crab/version'
|
3
4
|
|
4
|
-
|
5
|
+
class Crab::Help
|
6
|
+
|
7
|
+
def self.run
|
8
|
+
puts <<-HELP
|
5
9
|
Usage: crab <command> [options*]
|
6
10
|
|
7
11
|
crab version #{Crab::VERSION}: A Cucumber-Rally bridge
|
@@ -19,4 +23,8 @@ crab version #{Crab::VERSION}: A Cucumber-Rally bridge
|
|
19
23
|
|
20
24
|
--version, -v: Print version and exit
|
21
25
|
--help, -h: Show this message
|
22
|
-
HELP
|
26
|
+
HELP
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
Crab::Help.run
|
data/bin/crab-it
CHANGED
@@ -1,18 +1,32 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
# vim: set ft=ruby:
|
3
|
+
require 'crab'
|
3
4
|
|
4
|
-
|
5
|
+
class Crab::IterationMain
|
5
6
|
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
7
|
+
class << self
|
8
|
+
|
9
|
+
include Crab::Utilities
|
10
|
+
|
11
|
+
def run(args=ARGV)
|
11
12
|
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
13
|
+
cmd = args.shift # get the subcommand
|
14
|
+
|
15
|
+
case cmd
|
16
|
+
when "-h", "--help", NilClass
|
17
|
+
system "crab-iteration-help"
|
18
|
+
exit 0
|
19
|
+
end
|
20
|
+
|
21
|
+
unless system("crab-iteration-#{cmd}", *args)
|
22
|
+
if $?.exitstatus == 127 # bash 'command not found'
|
23
|
+
logger.error "Unknown subcommand \"iteration #{cmd}\""
|
24
|
+
system "crab-iteration-help"
|
25
|
+
exit 1
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
17
29
|
end
|
18
30
|
end
|
31
|
+
|
32
|
+
Crab::IterationMain.run
|
data/bin/crab-it-help
CHANGED
@@ -1,6 +1,11 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
1
2
|
# vim: set ft=ruby :
|
3
|
+
require 'crab'
|
2
4
|
|
3
|
-
|
5
|
+
class Crab::IterationHelp
|
6
|
+
|
7
|
+
def self.run
|
8
|
+
puts <<-HELP
|
4
9
|
Usage: crab iteration <command> [options*]
|
5
10
|
|
6
11
|
Available commands:
|
@@ -9,4 +14,8 @@ Usage: crab iteration <command> [options*]
|
|
9
14
|
help Show this help text
|
10
15
|
|
11
16
|
--help, -h: Show this message
|
12
|
-
HELP
|
17
|
+
HELP
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
Crab::IterationHelp.run
|
data/bin/crab-it-list
CHANGED
@@ -1,28 +1,38 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
# vim: set ft=ruby:
|
3
|
-
|
4
3
|
require 'crab'
|
5
4
|
|
6
|
-
|
5
|
+
class Crab::IterationList
|
6
|
+
|
7
|
+
class << self
|
8
|
+
|
9
|
+
include Crab::Utilities
|
7
10
|
|
8
|
-
|
9
|
-
|
11
|
+
def run(args=ARGV)
|
12
|
+
|
13
|
+
opts = Trollop::options(args) do
|
14
|
+
banner <<-BANNER
|
10
15
|
crab iteration list: list iterations available in the current project
|
11
16
|
|
12
17
|
Usage: crab iteration list [options*]
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
end
|
18
|
+
BANNER
|
19
|
+
opt :project, "Project to use (required unless set by 'crab project')", :short => "-p", :type => String
|
20
|
+
opt :dry, "Dry-run (don't change anything)", :short => "-D", :default => false
|
21
|
+
end
|
17
22
|
|
18
|
-
pattern =
|
19
|
-
project_name = valid_project_name(opts)
|
23
|
+
pattern = args.map(&:strip).reject(&:empty?)
|
24
|
+
project_name = valid_project_name(opts)
|
20
25
|
|
21
|
-
Crab::Rally.new(opts[:dry]) do |rally|
|
22
|
-
|
23
|
-
|
26
|
+
Crab::Rally.new(opts[:dry]) do |rally|
|
27
|
+
project = rally.find_project(project_name)
|
28
|
+
Trollop::die "Project #{opts[:project].inspect} not found" if project.nil?
|
24
29
|
|
25
|
-
|
26
|
-
|
30
|
+
rally.find_iterations(project).each do |iteration|
|
31
|
+
puts iteration.name
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
27
35
|
end
|
28
36
|
end
|
37
|
+
|
38
|
+
Crab::IterationList.run
|
data/bin/crab-iteration
CHANGED
@@ -1,18 +1,32 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
# vim: set ft=ruby:
|
3
|
+
require 'crab'
|
3
4
|
|
4
|
-
|
5
|
+
class Crab::IterationMain
|
5
6
|
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
7
|
+
class << self
|
8
|
+
|
9
|
+
include Crab::Utilities
|
10
|
+
|
11
|
+
def run(args=ARGV)
|
11
12
|
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
13
|
+
cmd = args.shift # get the subcommand
|
14
|
+
|
15
|
+
case cmd
|
16
|
+
when "-h", "--help", NilClass
|
17
|
+
system "crab-iteration-help"
|
18
|
+
exit 0
|
19
|
+
end
|
20
|
+
|
21
|
+
unless system("crab-iteration-#{cmd}", *args)
|
22
|
+
if $?.exitstatus == 127 # bash 'command not found'
|
23
|
+
logger.error "Unknown subcommand \"iteration #{cmd}\""
|
24
|
+
system "crab-iteration-help"
|
25
|
+
exit 1
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
17
29
|
end
|
18
30
|
end
|
31
|
+
|
32
|
+
Crab::IterationMain.run
|
data/bin/crab-iteration-help
CHANGED
@@ -1,6 +1,11 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
1
2
|
# vim: set ft=ruby :
|
3
|
+
require 'crab'
|
2
4
|
|
3
|
-
|
5
|
+
class Crab::IterationHelp
|
6
|
+
|
7
|
+
def self.run
|
8
|
+
puts <<-HELP
|
4
9
|
Usage: crab iteration <command> [options*]
|
5
10
|
|
6
11
|
Available commands:
|
@@ -9,4 +14,8 @@ Usage: crab iteration <command> [options*]
|
|
9
14
|
help Show this help text
|
10
15
|
|
11
16
|
--help, -h: Show this message
|
12
|
-
HELP
|
17
|
+
HELP
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
Crab::IterationHelp.run
|
data/bin/crab-iteration-list
CHANGED
@@ -1,28 +1,38 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
# vim: set ft=ruby:
|
3
|
-
|
4
3
|
require 'crab'
|
5
4
|
|
6
|
-
|
5
|
+
class Crab::IterationList
|
6
|
+
|
7
|
+
class << self
|
8
|
+
|
9
|
+
include Crab::Utilities
|
7
10
|
|
8
|
-
|
9
|
-
|
11
|
+
def run(args=ARGV)
|
12
|
+
|
13
|
+
opts = Trollop::options(args) do
|
14
|
+
banner <<-BANNER
|
10
15
|
crab iteration list: list iterations available in the current project
|
11
16
|
|
12
17
|
Usage: crab iteration list [options*]
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
end
|
18
|
+
BANNER
|
19
|
+
opt :project, "Project to use (required unless set by 'crab project')", :short => "-p", :type => String
|
20
|
+
opt :dry, "Dry-run (don't change anything)", :short => "-D", :default => false
|
21
|
+
end
|
17
22
|
|
18
|
-
pattern =
|
19
|
-
project_name = valid_project_name(opts)
|
23
|
+
pattern = args.map(&:strip).reject(&:empty?)
|
24
|
+
project_name = valid_project_name(opts)
|
20
25
|
|
21
|
-
Crab::Rally.new(opts[:dry]) do |rally|
|
22
|
-
|
23
|
-
|
26
|
+
Crab::Rally.new(opts[:dry]) do |rally|
|
27
|
+
project = rally.find_project(project_name)
|
28
|
+
Trollop::die "Project #{opts[:project].inspect} not found" if project.nil?
|
24
29
|
|
25
|
-
|
26
|
-
|
30
|
+
rally.find_iterations(project).each do |iteration|
|
31
|
+
puts iteration.name
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
27
35
|
end
|
28
36
|
end
|
37
|
+
|
38
|
+
Crab::IterationList.run
|
data/bin/crab-login
CHANGED
@@ -1,25 +1,36 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
1
2
|
# vim: set ft=ruby :
|
2
3
|
require 'crab'
|
3
4
|
|
4
|
-
|
5
|
+
class Crab::Login
|
5
6
|
|
6
|
-
|
7
|
-
|
7
|
+
class << self
|
8
|
+
|
9
|
+
include Crab::Utilities
|
10
|
+
|
11
|
+
def run(args=ARGV)
|
12
|
+
opts = Trollop::options(args) do
|
13
|
+
banner <<-BANNER
|
8
14
|
Usage: crab login [options*]
|
9
15
|
|
10
16
|
Log into Rally. Your credentials will be written to ~/.crab/credentials.
|
11
|
-
|
17
|
+
BANNER
|
12
18
|
|
13
|
-
|
14
|
-
|
15
|
-
end
|
19
|
+
opt :username, "Username", :type => String, :short => "-u"
|
20
|
+
opt :password, "Password", :type => String, :short => "-p"
|
21
|
+
end
|
22
|
+
|
23
|
+
username = opts[:username_given] ? opts[:username] : ask("Username: ")
|
24
|
+
password = opts[:password_given] ? opts[:password] : ask("Password: ") {|q| q.echo = false }
|
16
25
|
|
17
|
-
|
18
|
-
|
26
|
+
File.open(credentials_file, 'w') do |file|
|
27
|
+
file.puts username
|
28
|
+
file.puts password
|
29
|
+
end
|
19
30
|
|
20
|
-
|
21
|
-
|
22
|
-
|
31
|
+
puts "Credentials stored for #{username}"
|
32
|
+
end
|
33
|
+
end
|
23
34
|
end
|
24
35
|
|
25
|
-
|
36
|
+
Crab::Login.run
|
data/bin/crab-logout
CHANGED
@@ -1,18 +1,31 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
1
2
|
# vim: set ft=ruby :
|
2
3
|
require 'crab'
|
3
4
|
|
4
|
-
|
5
|
+
class Crab::Logout
|
5
6
|
|
6
|
-
|
7
|
-
|
7
|
+
class << self
|
8
|
+
|
9
|
+
include Crab::Utilities
|
10
|
+
|
11
|
+
def run(args=ARGV)
|
12
|
+
|
13
|
+
opts = Trollop::options(args) do
|
14
|
+
banner <<-BANNER
|
8
15
|
Usage: crab logout [options*]
|
9
16
|
|
10
17
|
Log out of Rally. Your credentials will be removed from ~/.crab/credentials.
|
11
|
-
|
12
|
-
|
13
|
-
end
|
18
|
+
BANNER
|
19
|
+
opt :dry, "Dry-run (don't change anything)", :short => "-D", :default => false
|
20
|
+
end
|
14
21
|
|
15
|
-
fileutils_opts = opts[:dry] ? {:noop => true, :verbose => true} : {}
|
16
|
-
FileUtils.rm_rf(credentials_file, fileutils_opts)
|
22
|
+
fileutils_opts = opts[:dry] ? {:noop => true, :verbose => true} : {}
|
23
|
+
FileUtils.rm_rf(credentials_file, fileutils_opts)
|
24
|
+
|
25
|
+
puts "Credentials removed for #{username}"
|
26
|
+
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
17
30
|
|
18
|
-
|
31
|
+
Crab::Logout.run
|
data/bin/crab-project
CHANGED
@@ -1,42 +1,52 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
1
2
|
# vim: set ft=ruby :
|
2
3
|
require 'crab'
|
3
4
|
|
4
|
-
|
5
|
+
class Crab::ProjectMain
|
5
6
|
|
6
|
-
|
7
|
-
banner <<-BANNER
|
8
|
-
crab project: show or persistently select project to work with in Rally
|
9
|
-
|
10
|
-
Usage: crab project [name] [options*]
|
11
|
-
BANNER
|
12
|
-
opt :dry, "Dry-run (don't change anything)", :short => "-D", :default => false
|
13
|
-
end
|
14
|
-
|
15
|
-
current_project_name = self.class.current_project_name
|
16
|
-
if current_project_name.present?
|
17
|
-
puts current_project_name
|
18
|
-
exit 0
|
7
|
+
class << self
|
19
8
|
|
20
|
-
|
21
|
-
puts "No project currently selected."
|
22
|
-
exit 1
|
23
|
-
end
|
9
|
+
include Crab::Utilities
|
24
10
|
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
Trollop::die "#{name.inspect} is not a valid project" if project.nil?
|
30
|
-
|
31
|
-
FileUtils.mkdir_p ".crab", opts[:dry] ? { :noop => true, :verbose => true } : {}
|
32
|
-
file = ".crab/project"
|
33
|
-
output = project.name
|
11
|
+
def run(args=ARGV)
|
12
|
+
opts = Trollop::options(args) do
|
13
|
+
banner <<-BANNER
|
14
|
+
crab project: show or persistently select project to work with in Rally
|
34
15
|
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
16
|
+
Usage: crab project [name] [options*]
|
17
|
+
BANNER
|
18
|
+
opt :dry, "Dry-run (don't change anything)", :short => "-D", :default => false
|
19
|
+
end
|
20
|
+
|
21
|
+
if current_project_name.present?
|
22
|
+
puts current_project_name
|
23
|
+
exit 0
|
24
|
+
|
25
|
+
elsif args.reject {|arg| arg.blank? }.empty?
|
26
|
+
puts "No project currently selected."
|
27
|
+
exit 1
|
28
|
+
end
|
29
|
+
|
30
|
+
name = args.join(" ").strip
|
31
|
+
|
32
|
+
Crab::Rally.new(opts[:dry]) do |rally|
|
33
|
+
project = rally.find_project name
|
34
|
+
Trollop::die "#{name.inspect} is not a valid project" if project.nil?
|
35
|
+
|
36
|
+
FileUtils.mkdir_p ".crab", opts[:dry] ? { :noop => true, :verbose => true } : {}
|
37
|
+
file = ".crab/project"
|
38
|
+
output = project.name
|
39
|
+
|
40
|
+
if opts[:dry]
|
41
|
+
puts "Would write to #{file}:\n\n#{output}"
|
42
|
+
else
|
43
|
+
File.open(file, "w") do |file|
|
44
|
+
file.puts project.name
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
40
48
|
end
|
41
49
|
end
|
42
50
|
end
|
51
|
+
|
52
|
+
Crab::ProjectMain.run
|