crab 0.2.2 → 0.2.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (56) hide show
  1. data/README.md +12 -12
  2. data/bin/crab-help +9 -13
  3. data/bin/crab-iteration +18 -0
  4. data/bin/crab-iteration-help +11 -0
  5. data/bin/crab-login +2 -2
  6. data/bin/crab-logout +18 -0
  7. data/bin/crab-project +1 -1
  8. data/bin/{crab-tc → crab-release} +4 -4
  9. data/bin/crab-release-help +11 -0
  10. data/bin/crab-story +18 -0
  11. data/bin/{crab-add → crab-story-add} +2 -2
  12. data/bin/{crab-change → crab-story-change} +4 -4
  13. data/bin/{crab-new → crab-story-create} +2 -2
  14. data/bin/{crab-remove → crab-story-del} +3 -3
  15. data/bin/{crab-delete → crab-story-delete} +3 -3
  16. data/bin/{crab-find → crab-story-find} +2 -2
  17. data/bin/crab-story-help +11 -0
  18. data/bin/{crab-ls → crab-story-list} +2 -2
  19. data/bin/{crab-list → crab-story-ls} +2 -2
  20. data/bin/{crab-move → crab-story-move} +2 -2
  21. data/bin/{crab-mv → crab-story-mv} +2 -2
  22. data/bin/{crab-create → crab-story-new} +2 -2
  23. data/bin/{crab-pull → crab-story-pull} +2 -2
  24. data/bin/{crab-rename → crab-story-ren} +2 -2
  25. data/bin/crab-story-rename +27 -0
  26. data/bin/{crab-rm → crab-story-rm} +3 -3
  27. data/bin/{crab-show → crab-story-show} +2 -2
  28. data/bin/{crab-up → crab-story-up} +4 -4
  29. data/bin/{crab-update → crab-story-update} +4 -4
  30. data/bin/crab-testcase +1 -1
  31. data/bin/crab-testcase-add +5 -1
  32. data/bin/crab-testcase-change +18 -0
  33. data/bin/crab-testcase-create +5 -1
  34. data/bin/crab-testcase-del +18 -0
  35. data/bin/crab-testcase-delete +5 -1
  36. data/bin/crab-testcase-find +10 -0
  37. data/bin/crab-testcase-help +11 -5
  38. data/bin/crab-testcase-list +1 -1
  39. data/bin/crab-testcase-ls +6 -21
  40. data/bin/crab-testcase-new +5 -1
  41. data/bin/crab-testcase-rm +5 -1
  42. data/bin/crab-testcase-show +1 -1
  43. data/bin/crab-testcase-up +18 -0
  44. data/bin/crab-testcase-update +5 -1
  45. data/features/find-text-in-stories.feature +3 -3
  46. data/features/login-and-out-of-rally.feature +1 -2
  47. data/features/move-in-rally.feature +2 -2
  48. data/features/pull-from-rally-into-cucumber.feature +4 -4
  49. data/features/show-from-rally.feature +3 -3
  50. data/features/steps/rally_steps.rb +45 -59
  51. data/features/subcommand-help.feature +28 -89
  52. data/features/update-story-in-rally.feature +8 -8
  53. data/lib/crab/rally.rb +4 -4
  54. data/lib/crab/version.rb +1 -1
  55. metadata +62 -42
  56. data/bin/crab-del +0 -21
data/README.md CHANGED
@@ -38,20 +38,20 @@ Initially, there were concerns around migration of the existing data.
38
38
  Thankfully, that part is easy:
39
39
 
40
40
  $ crab login -u cv@lixo.org -p secr3t
41
- Logged in as cv@lixo.org.
41
+ Credentials stored for cv@lixo.org.
42
42
 
43
43
  $ crab project "World Domination 3000"
44
- $ crab find
44
+ $ crab story find
45
45
  US1001: Arms Rockets Upon Successful Boot
46
46
  US1002: Launches Rockets Upon Command from Evil Mastermind
47
47
  US1003: Transfers $0.01 From All Bank Accounts
48
48
  ...
49
49
 
50
- $ crab find Rockets
50
+ $ crab story find Rockets
51
51
  US1001: Arms Rockets After Boot
52
52
  US1002: Launches Rockets Upon Command from Evil Mastermind
53
53
 
54
- $ crab show US1001
54
+ $ crab story show US1001
55
55
  Feature: [US1001] Arms Rockets After Boot
56
56
 
57
57
  In order to gain bargaining power with Super Hero
@@ -63,9 +63,9 @@ Thankfully, that part is easy:
63
63
  If there are any test cases, their steps get converted into Cucumber
64
64
  steps:
65
65
 
66
- $ crab show US1001
66
+ $ crab story show US1001
67
67
  ...
68
-
68
+ @critical @automated @high
69
69
  Scenario: [TC10001] Rocket Silo Is Unlocked
70
70
  Given a silo where the rockets are stored
71
71
  When I boot the system
@@ -78,19 +78,19 @@ In that sense, `crab` acts more like a command-line interface to Rally than a
78
78
  bridge between Rally and Cucumber, but the team thought these were *very*
79
79
  convenient features to have:
80
80
 
81
- $ crab create "Secure Access to Flying Fortress Controls"
81
+ $ crab story create "Secure Access to Flying Fortress Controls"
82
82
  US1004: Secure Access to Flying Fortress Controls (grooming)
83
83
 
84
- $ crab update US1001 --name "Arms Rockets Upon Successful Boot" --state completed
84
+ $ crab story update US1001 --name "Arms Rockets Upon Successful Boot" --state completed
85
85
  US1001: Arms Rockets Upon Successful Boot (completed)
86
86
 
87
- $ crab delete US1004 # not in this movie :(
87
+ $ crab story delete US1004 # not in this movie :(
88
88
  Story US1004 deleted.
89
89
 
90
- It is also possible to add, update and delete test cases inside Rally straight
90
+ It is also possible to create, update and delete test cases inside Rally straight
91
91
  from the command line:
92
92
 
93
- $ crab testcase add US1001 "Rocket Silo Is Unlocked"
93
+ $ crab testcase create US1001 "Rocket Silo Is Unlocked"
94
94
  US1001/TC1501: Rocket Silo Is Unlocked (important medium automated acceptance)
95
95
 
96
96
  $ crab testcase update TC1501 --priority critical --risk low
@@ -107,7 +107,7 @@ i18n Support
107
107
  `crab` uses [Gherkin][3] internally, so all languages supported by Cucumber are also
108
108
  included:
109
109
 
110
- $ crab show US1001 -l ja
110
+ $ crab story show US1001 -l ja
111
111
  機能: [US1001] Arms Rockets Upon Successful Boot
112
112
  ...
113
113
  シナリオ: [TC1501] Rocket Silo Is Unlocked
@@ -1,5 +1,5 @@
1
1
  # vim: set ft=ruby :
2
- require 'crab'
2
+ require 'crab/version'
3
3
 
4
4
  puts <<-HELP
5
5
  Usage: crab <command> [options*]
@@ -8,18 +8,14 @@ crab version #{Crab::VERSION}: A Cucumber-Rally bridge
8
8
 
9
9
  Available commands:
10
10
 
11
- create Create a new story in Rally
12
- delete Delete an existing story in Rally
13
- find Find stories by text in name, description or notes
14
- login Persistently authenticate user with Rally
15
- move Move a story from one status to the next (or previous)
16
- project Persistently select project to work with in Rally
17
- pull Downloads stories (and its test cases) as Cucumber feature files
18
- rename Rename a story
19
- show Show a story (and its test cases) as a Cucumber feature
20
- testcase Manage test cases in a story (add, update, delete)
21
- update Update a story (name, estimate, etc)
22
-
11
+ help Show this help text
12
+ iteration Manipulate iterations
13
+ login Persistently authenticate user with Rally
14
+ logout Remove stored Rally credentials
15
+ project Persistently select project to work with in Rally
16
+ release Manipulate releases
17
+ story Manipulate stories
18
+ testcase Manipulate test cases
23
19
 
24
20
  --version, -v: Print version and exit
25
21
  --help, -h: Show this message
@@ -0,0 +1,18 @@
1
+ #!/usr/bin/env ruby
2
+ # vim: set ft=ruby:
3
+
4
+ cmd = ARGV.shift # get the subcommand
5
+
6
+ case cmd
7
+ when "-h", "--help", NilClass
8
+ system "crab-iteration-help"
9
+ exit 0
10
+ end
11
+
12
+ unless system("crab-iteration-#{cmd}", *ARGV)
13
+ if $?.exitstatus == 127 # bash 'command not found'
14
+ $stderr.puts "Unknown subcommand \"iteration #{cmd}\""
15
+ system "crab-iteration-help"
16
+ exit 127
17
+ end
18
+ end
@@ -0,0 +1,11 @@
1
+ # vim: set ft=ruby :
2
+
3
+ puts <<-HELP
4
+ Usage: crab iteration <command> [options*]
5
+
6
+ Available commands:
7
+
8
+ help Show this help text
9
+
10
+ --help, -h: Show this message
11
+ HELP
@@ -5,7 +5,7 @@ include Crab::Utilities
5
5
 
6
6
  opts = Trollop::options do
7
7
  banner <<-BANNER
8
- Usage: crab login [options]
8
+ Usage: crab login [options*]
9
9
 
10
10
  Log into Rally. Your credentials will be written to ~/.crab/credentials.
11
11
  BANNER
@@ -22,4 +22,4 @@ File.open(credentials_file, 'w') do |file|
22
22
  file.puts password
23
23
  end
24
24
 
25
- puts "Logged in as #{username}"
25
+ puts "Credentials stored for #{username}"
@@ -0,0 +1,18 @@
1
+ # vim: set ft=ruby :
2
+ require 'crab'
3
+
4
+ include Crab::Utilities
5
+
6
+ opts = Trollop::options do
7
+ banner <<-BANNER
8
+ Usage: crab logout [options*]
9
+
10
+ Log out of Rally. Your credentials will be removed from ~/.crab/credentials.
11
+ BANNER
12
+ opt :dry, "Dry-run (don't change anything)", :short => "-D", :default => false
13
+ end
14
+
15
+ fileutils_opts = opts[:dry] ? {:noop => true, :verbose => true} : {}
16
+ FileUtils.rm_rf(credentials_file, fileutils_opts)
17
+
18
+ puts "Credentials removed for #{username}"
@@ -7,7 +7,7 @@ opts = Trollop::options do
7
7
  banner <<-BANNER
8
8
  crab project: show or persistently select project to work with in Rally
9
9
 
10
- Usage: crab project [name]
10
+ Usage: crab project [name] [options*]
11
11
  BANNER
12
12
  opt :dry, "Dry-run (don't change anything)", :short => "-D", :default => false
13
13
  end
@@ -5,14 +5,14 @@ cmd = ARGV.shift # get the subcommand
5
5
 
6
6
  case cmd
7
7
  when "-h", "--help", NilClass
8
- system "crab-testcase-help"
8
+ system "crab-release-help"
9
9
  exit 0
10
10
  end
11
11
 
12
- unless system("crab-testcase-#{cmd}", *ARGV)
12
+ unless system("crab-release-#{cmd}", *ARGV)
13
13
  if $?.exitstatus == 127 # bash 'command not found'
14
- $stderr.puts "Unknown subcommand \"template #{cmd}\""
15
- system "crab-testcase-help"
14
+ $stderr.puts "Unknown subcommand \"release #{cmd}\""
15
+ system "crab-release-help"
16
16
  exit 127
17
17
  end
18
18
  end
@@ -0,0 +1,11 @@
1
+ # vim: set ft=ruby :
2
+
3
+ puts <<-HELP
4
+ Usage: crab release <command> [options*]
5
+
6
+ Available commands:
7
+
8
+ help Show this help text
9
+
10
+ --help, -h: Show this message
11
+ HELP
@@ -0,0 +1,18 @@
1
+ #!/usr/bin/env ruby
2
+ # vim: set ft=ruby:
3
+
4
+ cmd = ARGV.shift # get the subcommand
5
+
6
+ case cmd
7
+ when "-h", "--help", NilClass
8
+ system "crab-story-help"
9
+ exit 0
10
+ end
11
+
12
+ unless system("crab-story-#{cmd}", *ARGV)
13
+ if $?.exitstatus == 127 # bash 'command not found'
14
+ $stderr.puts "Unknown subcommand \"story #{cmd}\""
15
+ system "crab-story-help"
16
+ exit 127
17
+ end
18
+ end
@@ -3,9 +3,9 @@ require 'crab'
3
3
 
4
4
  opts = Trollop::options do
5
5
  banner <<-BANNER
6
- crab create: create a new story in Rally
6
+ crab story create: create a new story in Rally
7
7
 
8
- Usage: crab create name [options]
8
+ Usage: crab story create <name> [options*]
9
9
  BANNER
10
10
  opt :dry, "Dry-run (don't change anything)", :short => "-D", :default => false
11
11
  end
@@ -5,9 +5,9 @@ include Crab::Utilities
5
5
 
6
6
  cmd_opts = Trollop::options do
7
7
  banner <<-BANNER
8
- crab update: update a story in Rally
8
+ crab story update: update a story in Rally
9
9
 
10
- Usage: crab update story [options]
10
+ Usage: crab story update <id> [options*]
11
11
  BANNER
12
12
  opt :name, "Name (title)", :type => String, :short => "-n"
13
13
  opt :state, "State (one of: #{Crab::Story::VALID_STATES.join(" ")})", :type => String, :short => "-t"
@@ -40,12 +40,12 @@ Crab::Rally.new(opts[:dry]) do |rally|
40
40
  story = rally.find_story_with_id ARGV.first
41
41
 
42
42
  if cmd_opts[:iteration_given]
43
- opts[:iteration] = rally.find_iteration_by_name cmd_opts[:iteration]
43
+ opts[:iteration] = rally.find_iteration_by_name cmd_opts[:iteration], story.project
44
44
  Trollop::die "Unknown iteration \"#{cmd_opts[:iteration]}\"" if opts[:iteration].nil?
45
45
  end
46
46
 
47
47
  if cmd_opts[:release_given]
48
- opts[:release] = rally.find_release_by_name cmd_opts[:release]
48
+ opts[:release] = rally.find_release_by_name cmd_opts[:release], story.project
49
49
  Trollop::die "Unknown release \"#{cmd_opts[:release]}\"" if opts[:release].nil?
50
50
  end
51
51
 
@@ -3,9 +3,9 @@ require 'crab'
3
3
 
4
4
  opts = Trollop::options do
5
5
  banner <<-BANNER
6
- crab create: create a new story in Rally
6
+ crab story create: create a new story in Rally
7
7
 
8
- Usage: crab create name [options]
8
+ Usage: crab story create <name> [options*]
9
9
  BANNER
10
10
  opt :dry, "Dry-run (don't change anything)", :short => "-D", :default => false
11
11
  end
@@ -3,15 +3,15 @@ require 'crab'
3
3
 
4
4
  opts = Trollop::options do
5
5
  banner <<-BANNER
6
- crab delete: delete an existing story in Rally
6
+ crab story delete: delete an existing story in Rally
7
7
 
8
- Usage: crab delete story [options]
8
+ Usage: crab story delete <id> [options*]
9
9
  BANNER
10
10
  opt :dry, "Dry-run (don't change anything)", :short => "-D", :default => false
11
11
  end
12
12
 
13
13
  id = ARGV.join(" ")
14
- Trollop::die "Story ID must be specified" if story_id.blank?
14
+ Trollop::die "Story ID must be specified" if id.blank?
15
15
 
16
16
  Crab::Rally.new(opts[:dry]) do |rally|
17
17
  story = rally.find_story_with_id id
@@ -3,15 +3,15 @@ require 'crab'
3
3
 
4
4
  opts = Trollop::options do
5
5
  banner <<-BANNER
6
- crab delete: delete an existing story in Rally
6
+ crab story delete: delete an existing story in Rally
7
7
 
8
- Usage: crab delete story [options]
8
+ Usage: crab story delete <id> [options*]
9
9
  BANNER
10
10
  opt :dry, "Dry-run (don't change anything)", :short => "-D", :default => false
11
11
  end
12
12
 
13
13
  id = ARGV.join(" ")
14
- Trollop::die "Story ID must be specified" if story_id.blank?
14
+ Trollop::die "Story ID must be specified" if id.blank?
15
15
 
16
16
  Crab::Rally.new(opts[:dry]) do |rally|
17
17
  story = rally.find_story_with_id id
@@ -5,9 +5,9 @@ include Crab::Utilities
5
5
 
6
6
  opts = Trollop::options do
7
7
  banner <<-BANNER
8
- crab find: find a story in Rally
8
+ crab story find: find a story in Rally
9
9
 
10
- Usage: crab find [options] [text]
10
+ Usage: crab story find [options*] [text]
11
11
  BANNER
12
12
  opt :project, "Project to use (required unless set by 'crab project')", :short => "-p", :type => String
13
13
  opt :dry, "Dry-run (don't change anything)", :short => "-D", :default => false
@@ -0,0 +1,11 @@
1
+ # vim: set ft=ruby :
2
+
3
+ puts <<-HELP
4
+ Usage: crab story <command> [options*]
5
+
6
+ Available commands:
7
+
8
+ help Show this help text
9
+
10
+ --help, -h: Show this message
11
+ HELP
@@ -5,9 +5,9 @@ include Crab::Utilities
5
5
 
6
6
  opts = Trollop::options do
7
7
  banner <<-BANNER
8
- crab find: find a story in Rally
8
+ crab story find: find a story in Rally
9
9
 
10
- Usage: crab find [options] [text]
10
+ Usage: crab story find [options*] [text]
11
11
  BANNER
12
12
  opt :project, "Project to use (required unless set by 'crab project')", :short => "-p", :type => String
13
13
  opt :dry, "Dry-run (don't change anything)", :short => "-D", :default => false
@@ -5,9 +5,9 @@ include Crab::Utilities
5
5
 
6
6
  opts = Trollop::options do
7
7
  banner <<-BANNER
8
- crab find: find a story in Rally
8
+ crab story find: find a story in Rally
9
9
 
10
- Usage: crab find [options] [text]
10
+ Usage: crab story find [options*] [text]
11
11
  BANNER
12
12
  opt :project, "Project to use (required unless set by 'crab project')", :short => "-p", :type => String
13
13
  opt :dry, "Dry-run (don't change anything)", :short => "-D", :default => false
@@ -5,9 +5,9 @@ include Crab::Utilities
5
5
 
6
6
  opts = Trollop::options do
7
7
  banner <<-BANNER
8
- crab move: move a story from one status to the next (or previous)
8
+ crab story move: move a story from one status to the next (or previous)
9
9
 
10
- Usage: crab move story [options]
10
+ Usage: crab story move <id> [options*]
11
11
  BANNER
12
12
  opt :back, "Move story backwards (from accepted to completed, for example)"
13
13
  opt :dry, "Dry-run (don't change anything)", :short => "-D", :default => false
@@ -5,9 +5,9 @@ include Crab::Utilities
5
5
 
6
6
  opts = Trollop::options do
7
7
  banner <<-BANNER
8
- crab move: move a story from one status to the next (or previous)
8
+ crab story move: move a story from one status to the next (or previous)
9
9
 
10
- Usage: crab move story [options]
10
+ Usage: crab story move <id> [options*]
11
11
  BANNER
12
12
  opt :back, "Move story backwards (from accepted to completed, for example)"
13
13
  opt :dry, "Dry-run (don't change anything)", :short => "-D", :default => false
@@ -3,9 +3,9 @@ require 'crab'
3
3
 
4
4
  opts = Trollop::options do
5
5
  banner <<-BANNER
6
- crab create: create a new story in Rally
6
+ crab story create: create a new story in Rally
7
7
 
8
- Usage: crab create name [options]
8
+ Usage: crab story create <name> [options*]
9
9
  BANNER
10
10
  opt :dry, "Dry-run (don't change anything)", :short => "-D", :default => false
11
11
  end
@@ -3,9 +3,9 @@ require 'crab'
3
3
 
4
4
  opts = Trollop::options do
5
5
  banner <<-BANNER
6
- crab pull: pulls stories from Rally and writes them out as Cucumber features
6
+ crab story pull: pulls stories from Rally and writes them out as Cucumber features
7
7
 
8
- Usage: crab pull [options] story1 [story2 ...]
8
+ Usage: crab story pull <id> [id*] [options*]
9
9
  BANNER
10
10
  opt :language, "Language to generate Cucumber features in (ISO code)", :default => "en", :short => "-l"
11
11
  opt :dry, "Dry-run (don't change anything)", :short => "-D", :default => false
@@ -5,9 +5,9 @@ include Crab::Utilities
5
5
 
6
6
  opts = Trollop::options do
7
7
  banner <<-BANNER
8
- crab rename: rename a story
8
+ crab story rename: rename a story
9
9
 
10
- Usage: crab rename <story> <new name> [options]
10
+ Usage: crab story rename <id> <name> [options*]
11
11
  BANNER
12
12
  opt :dry, "Dry-run (don't change anything)", :short => "-D", :default => false
13
13
  end
@@ -0,0 +1,27 @@
1
+ # vim: set ft=ruby :
2
+ require 'crab'
3
+
4
+ include Crab::Utilities
5
+
6
+ opts = Trollop::options do
7
+ banner <<-BANNER
8
+ crab story rename: rename a story
9
+
10
+ Usage: crab story rename <id> <name> [options*]
11
+ BANNER
12
+ opt :dry, "Dry-run (don't change anything)", :short => "-D", :default => false
13
+ end
14
+
15
+ id = ARGV.shift
16
+ Trollop::die "No story given" if id.empty?
17
+
18
+ name = ARGV.join(" ").squish
19
+ Trollop::die "No name given" if name.empty?
20
+
21
+ Crab::Rally.new(opts[:dry]) do |rally|
22
+ story = rally.find_story_with_id id
23
+
24
+ story.update :name => name
25
+
26
+ puts "#{story.formatted_id}: #{story.name} (#{story.state})"
27
+ end