crab 0.2.11 → 0.2.12

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/.rvmrc CHANGED
@@ -1 +1,2 @@
1
1
  rvm use --create ree@crab
2
+ . "`bundle show crab`/scripts/crab_bash_completion"
data/README.md CHANGED
@@ -190,6 +190,15 @@ Hopefully this will be enough for your case, but if not please let us know!
190
190
 
191
191
  [3]: https://github.com/cucumber/gherkin
192
192
 
193
+ Bash Completion
194
+ ---------------
195
+
196
+ Rudimentary bash completion support is here. Enable it by running:
197
+
198
+ $ . "`bundle show crab`/scripts/crab_bash_completion"
199
+
200
+ Tip: add it to your `.rvmrc` for effortless joy.
201
+
193
202
  Developing
194
203
  ----------
195
204
 
data/bin/crab-tc-add CHANGED
@@ -10,9 +10,9 @@ class Crab::TestCaseCreate
10
10
 
11
11
  def run(args=ARGV)
12
12
  opts = add_or_update_options <<-BANNER, args
13
- crab testcase create: add a test case to a story in Rally
13
+ crab testcase create: add a test case to a story in Rally
14
14
 
15
- Usage: crab testcase create <story> <name> [options*]
15
+ Usage: crab testcase create <story> <name> [options*]
16
16
  BANNER
17
17
 
18
18
  story_id = args.shift
@@ -22,8 +22,7 @@ class Crab::TestCaseCreate
22
22
  exit 1
23
23
  end
24
24
 
25
- name = args.join(" ")
26
- unless name
25
+ unless opts[:name_given]
27
26
  logger.error "Error: Test case name not provided."
28
27
  system "crab-testcase-help"
29
28
  exit 1
data/bin/crab-tc-create CHANGED
@@ -10,9 +10,9 @@ class Crab::TestCaseCreate
10
10
 
11
11
  def run(args=ARGV)
12
12
  opts = add_or_update_options <<-BANNER, args
13
- crab testcase create: add a test case to a story in Rally
13
+ crab testcase create: add a test case to a story in Rally
14
14
 
15
- Usage: crab testcase create <story> <name> [options*]
15
+ Usage: crab testcase create <story> <name> [options*]
16
16
  BANNER
17
17
 
18
18
  story_id = args.shift
@@ -22,8 +22,7 @@ class Crab::TestCaseCreate
22
22
  exit 1
23
23
  end
24
24
 
25
- name = args.join(" ")
26
- unless name
25
+ unless opts[:name_given]
27
26
  logger.error "Error: Test case name not provided."
28
27
  system "crab-testcase-help"
29
28
  exit 1
data/bin/crab-tc-new CHANGED
@@ -10,9 +10,9 @@ class Crab::TestCaseCreate
10
10
 
11
11
  def run(args=ARGV)
12
12
  opts = add_or_update_options <<-BANNER, args
13
- crab testcase create: add a test case to a story in Rally
13
+ crab testcase create: add a test case to a story in Rally
14
14
 
15
- Usage: crab testcase create <story> <name> [options*]
15
+ Usage: crab testcase create <story> <name> [options*]
16
16
  BANNER
17
17
 
18
18
  story_id = args.shift
@@ -22,8 +22,7 @@ class Crab::TestCaseCreate
22
22
  exit 1
23
23
  end
24
24
 
25
- name = args.join(" ")
26
- unless name
25
+ unless opts[:name_given]
27
26
  logger.error "Error: Test case name not provided."
28
27
  system "crab-testcase-help"
29
28
  exit 1
@@ -10,9 +10,9 @@ class Crab::TestCaseCreate
10
10
 
11
11
  def run(args=ARGV)
12
12
  opts = add_or_update_options <<-BANNER, args
13
- crab testcase create: add a test case to a story in Rally
13
+ crab testcase create: add a test case to a story in Rally
14
14
 
15
- Usage: crab testcase create <story> <name> [options*]
15
+ Usage: crab testcase create <story> <name> [options*]
16
16
  BANNER
17
17
 
18
18
  story_id = args.shift
@@ -22,8 +22,7 @@ class Crab::TestCaseCreate
22
22
  exit 1
23
23
  end
24
24
 
25
- name = args.join(" ")
26
- unless name
25
+ unless opts[:name_given]
27
26
  logger.error "Error: Test case name not provided."
28
27
  system "crab-testcase-help"
29
28
  exit 1
@@ -10,9 +10,9 @@ class Crab::TestCaseCreate
10
10
 
11
11
  def run(args=ARGV)
12
12
  opts = add_or_update_options <<-BANNER, args
13
- crab testcase create: add a test case to a story in Rally
13
+ crab testcase create: add a test case to a story in Rally
14
14
 
15
- Usage: crab testcase create <story> <name> [options*]
15
+ Usage: crab testcase create <story> <name> [options*]
16
16
  BANNER
17
17
 
18
18
  story_id = args.shift
@@ -22,8 +22,7 @@ class Crab::TestCaseCreate
22
22
  exit 1
23
23
  end
24
24
 
25
- name = args.join(" ")
26
- unless name
25
+ unless opts[:name_given]
27
26
  logger.error "Error: Test case name not provided."
28
27
  system "crab-testcase-help"
29
28
  exit 1
@@ -10,9 +10,9 @@ class Crab::TestCaseCreate
10
10
 
11
11
  def run(args=ARGV)
12
12
  opts = add_or_update_options <<-BANNER, args
13
- crab testcase create: add a test case to a story in Rally
13
+ crab testcase create: add a test case to a story in Rally
14
14
 
15
- Usage: crab testcase create <story> <name> [options*]
15
+ Usage: crab testcase create <story> <name> [options*]
16
16
  BANNER
17
17
 
18
18
  story_id = args.shift
@@ -22,8 +22,7 @@ class Crab::TestCaseCreate
22
22
  exit 1
23
23
  end
24
24
 
25
- name = args.join(" ")
26
- unless name
25
+ unless opts[:name_given]
27
26
  logger.error "Error: Test case name not provided."
28
27
  system "crab-testcase-help"
29
28
  exit 1
@@ -46,13 +46,14 @@ module Crab
46
46
  def add_or_update_options(banner, args)
47
47
  Trollop::options(args) do
48
48
  banner banner
49
- opt :priority, "Priority (one of: #{Crab::TestCase::PRIORITIES.join(" ")}", :default => "important", :short => '-p'
50
- opt :risk, "Risk (one of: #{Crab::TestCase::RISKS.join(" ")})", :default => "medium", :short => '-r'
51
- opt :method, "Method (one of: #{Crab::TestCase::METHODS.join(" ")})", :default => "manual", :short => '-m'
52
- opt :type, "Type (one of: #{Crab::TestCase::TYPES.join(" ")})", :default => "acceptance", :short => '-t'
53
- opt :pre, "Pre-conditions", :default => "N/A"
54
- opt :post, "Post-conditions", :default => "N/A"
55
- opt :desc, "Description", :default => "N/A", :short => '-d'
49
+ opt :name, "Name of this test case", :type => String, :short => '-n'
50
+ opt :priority, "Priority (one of: #{Crab::TestCase::PRIORITIES.join(" ")}", :type => String, :default => "important", :short => '-p'
51
+ opt :risk, "Risk (one of: #{Crab::TestCase::RISKS.join(" ")})", :type => String, :default => "medium", :short => '-r'
52
+ opt :method, "Method (one of: #{Crab::TestCase::METHODS.join(" ")})", :type => String, :default => "manual", :short => '-m'
53
+ opt :type, "Type (one of: #{Crab::TestCase::TYPES.join(" ")})", :type => String, :default => "acceptance", :short => '-t'
54
+ opt :pre, "Pre-conditions", :default => "N/A", :type => String
55
+ opt :post, "Post-conditions", :default => "N/A", :type => String
56
+ opt :desc, "Description", :default => "N/A", :short => '-d', :type => String
56
57
 
57
58
  opt :dry, "Dry-run (don't change anything)", :short => "-D", :default => false
58
59
  end
data/lib/crab/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Crab
2
- VERSION = "0.2.11"
2
+ VERSION = "0.2.12"
3
3
  end
@@ -0,0 +1,46 @@
1
+ #!/bin/bash
2
+ # vim: set ft=sh:
3
+ _crab_path=$(readlink -f "$(dirname "$BASH_SOURCE")/..")
4
+
5
+ _crab ()
6
+ {
7
+ local cur prev
8
+ COMPREPLY=()
9
+ cur="${COMP_WORDS[COMP_CWORD]}"
10
+ prev="${COMP_WORDS[COMP_CWORD-1]}"
11
+
12
+ local clist curcommand
13
+ clist=""
14
+
15
+ case "${cur}" in
16
+ -*)
17
+ curcommand=${COMP_WORDS[@]:0:COMP_CWORD}
18
+ clist=$($curcommand -h | cut -f 1 -d : | grep -oP '\-+[a-zA-Z]+' | sort)
19
+ ;;
20
+ *)
21
+ if [[ $prev == "crab" ]] ; then
22
+ clist=$(find "$_crab_path/bin/" -name crab-* | grep -Pv 'crab-...?(-.*)?$' | grep -Pv -- '-..$' | grep -Pv 'ren$' | cut -f 2 -d - | sort)
23
+ else
24
+ clist=$(find "$_crab_path/bin/" -name *-$prev-* | grep -Pv 'crab-...?(-.*)?$' | grep -Pv -- '-..$' | grep -Pv 'ren$' | cut -f 3 -d - | sort)
25
+ fi
26
+ ;;
27
+ esac
28
+
29
+ COMPREPLY=($(compgen -W "${clist}" -- "${cur}"))
30
+ return 0
31
+ }
32
+
33
+ _crab_bundler ()
34
+ {
35
+ local many
36
+ many=${#COMP_WORDS[@]}
37
+
38
+ if [[ ${COMP_WORDS[1]} == "exec" && ${COMP_WORDS[2]} == "crab" ]] ; then
39
+ _crab
40
+ return 0
41
+ fi
42
+ }
43
+
44
+ complete -F _crab crab
45
+ complete -F _crab_bundler bundle
46
+
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: crab
3
3
  version: !ruby/object:Gem::Version
4
- hash: 1
4
+ hash: 15
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 2
9
- - 11
10
- version: 0.2.11
9
+ - 12
10
+ version: 0.2.12
11
11
  platform: ruby
12
12
  authors:
13
13
  - Carlos Villela
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-10-04 00:00:00 -03:00
18
+ date: 2011-10-05 00:00:00 -03:00
19
19
  default_executable: crab
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -361,6 +361,7 @@ files:
361
361
  - lib/crab/testcase.rb
362
362
  - lib/crab/utilities.rb
363
363
  - lib/crab/version.rb
364
+ - scripts/crab_bash_completion
364
365
  has_rdoc: true
365
366
  homepage: http://github.com/cv/crab
366
367
  licenses: []