cardigan 0.1.0 → 0.1.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/HISTORY.md +12 -0
- data/README.md +126 -0
- data/Rakefile +14 -1
- data/features/commands/cd.feature +24 -0
- data/features/commands/claim.feature +20 -0
- data/features/commands/columns.feature +24 -0
- data/features/commands/count.feature +66 -0
- data/features/commands/export.feature +20 -0
- data/features/commands/filter.feature +42 -0
- data/features/commands/import.feature +32 -0
- data/features/commands/ls.feature +29 -0
- data/features/commands/rm.feature +27 -0
- data/features/commands/set.feature +31 -0
- data/features/commands/total.feature +70 -0
- data/features/commands/touch.feature +33 -0
- data/features/commands/unclaim.feature +20 -0
- data/features/commands/unfilter.feature +26 -0
- data/features/step_definitions/cardigan_steps.rb +10 -0
- data/features/support/env.rb +32 -0
- data/lib/cardigan/cli.rb +19 -11
- data/lib/cardigan/command/count_cards.rb +1 -1
- data/lib/cardigan/command/import_cards.rb +21 -19
- data/lib/cardigan/command/open_card.rb +1 -1
- data/lib/cardigan/command/total_cards.rb +4 -0
- data/lib/cardigan/configuration.rb +19 -0
- data/lib/cardigan/filtered_repository.rb +26 -3
- data/lib/cardigan/root_context.rb +7 -3
- data/lib/cardigan/workflow_repository.rb +5 -3
- data/spec/command/total_cards_spec.rb +2 -0
- data/spec/workflow_repository_spec.rb +25 -0
- data/tools/zsh/_cardigan +35 -0
- metadata +124 -87
- data/README.rdoc +0 -73
data/HISTORY.md
ADDED
@@ -0,0 +1,12 @@
|
|
1
|
+
# 0.1.1 (unreleased)
|
2
|
+
|
3
|
+
* fixed bug - cardigan would crash when entering workflow shell if no workflow existed yet
|
4
|
+
* fixed bug - csv import didn't use correct 1.9 csv api
|
5
|
+
* fixed bug - import was ignoring id when a card with that id did not already exist
|
6
|
+
* fixed bug - cards were not saved after cd unless an attribute other than name was set
|
7
|
+
* added .cardigan file to store display and sort columns and filter
|
8
|
+
* added direct execution of commands (to bypass entering the shell)
|
9
|
+
* added zsh completion
|
10
|
+
* removed support for 1.9
|
11
|
+
* added heaps of testing
|
12
|
+
* documentation now published to relishapp/cardigan
|
data/README.md
ADDED
@@ -0,0 +1,126 @@
|
|
1
|
+
# Cardigan
|
2
|
+
|
3
|
+
A simple command line project task tracking tool.
|
4
|
+
|
5
|
+
## Rationale
|
6
|
+
|
7
|
+
* command line tools are faster and cooler than any gui or web interface
|
8
|
+
* it makes sense to store work items in your source repository
|
9
|
+
* tab completion is awesome
|
10
|
+
|
11
|
+
## Installation
|
12
|
+
|
13
|
+
gem install cardigan
|
14
|
+
|
15
|
+
## Usage
|
16
|
+
|
17
|
+
cardigan
|
18
|
+
|
19
|
+
This will prompt for your name and email address (and store them in ~/.cardigan), create a folder called .cards in the current directory and enter a shell. The idea is that you will run this at the root of a git/hg/svn/whatever repository and manage the cards in the same way you manage your source code.
|
20
|
+
|
21
|
+
cardigan >
|
22
|
+
|
23
|
+
So what now?
|
24
|
+
|
25
|
+
## Listing mode
|
26
|
+
|
27
|
+
You start in listing mode.
|
28
|
+
|
29
|
+
To get the list of available commands:
|
30
|
+
|
31
|
+
?
|
32
|
+
|
33
|
+
To get help for a specific command:
|
34
|
+
|
35
|
+
? filter
|
36
|
+
|
37
|
+
Here are a few of the commands:
|
38
|
+
|
39
|
+
touch write some documentation
|
40
|
+
|
41
|
+
... will create a new card called 'write some documentation'
|
42
|
+
|
43
|
+
cd write some documentation
|
44
|
+
|
45
|
+
... enters edit mode for the 'write some documentation' card (note that tab completion is provided for the card name)
|
46
|
+
|
47
|
+
ls
|
48
|
+
|
49
|
+
... will present a list of the current set of cards
|
50
|
+
|
51
|
+
columns name estimate
|
52
|
+
|
53
|
+
... will change the display columns to 'name' and 'estimate'
|
54
|
+
|
55
|
+
filter card['owner'] == me
|
56
|
+
|
57
|
+
... will filter the list of cards to show only the ones owned by you
|
58
|
+
|
59
|
+
claim 2 4 5
|
60
|
+
|
61
|
+
... assigns cards 2, 4 and 5 to you (by setting the 'owner'). Note that these numbers are the indexes presented by the 'ls' command
|
62
|
+
|
63
|
+
unclaim 4 5
|
64
|
+
|
65
|
+
... unsets the owner of cards 4 and 5
|
66
|
+
|
67
|
+
destroy 4
|
68
|
+
|
69
|
+
... destroys card 4
|
70
|
+
|
71
|
+
set priority 4 6 7
|
72
|
+
|
73
|
+
... prompts for a new value for the priority field on cards 4, 6 and 7
|
74
|
+
|
75
|
+
workflow
|
76
|
+
|
77
|
+
... enters the workflow editing mode
|
78
|
+
|
79
|
+
count priority complexity
|
80
|
+
|
81
|
+
... counts the number of cards with each value of the available combinations of priority and complexity
|
82
|
+
|
83
|
+
count estimate priority
|
84
|
+
|
85
|
+
... presents the total of estimate for cards group in each value of priority
|
86
|
+
|
87
|
+
export foo
|
88
|
+
|
89
|
+
... exports all cards (according to the current filter) to a csv file called foo.csv
|
90
|
+
|
91
|
+
import foo
|
92
|
+
|
93
|
+
... imports the contents of foo.csv - cards will be updated with a matching id, otherwise new cards will be created.
|
94
|
+
|
95
|
+
## Editing mode
|
96
|
+
|
97
|
+
* quit or exit or ctrl-d - exit
|
98
|
+
* list - dumps the values of all card field values
|
99
|
+
* set <key> - creates a new field and prompts for the new value
|
100
|
+
* now <status> - changes the status of the card to the given status (the tab completion will be populated with the valid subsequent statuses from the current status)
|
101
|
+
|
102
|
+
## Workflow mode
|
103
|
+
|
104
|
+
Workflow is pretty simple - it is just for convenience in specifiying the set of valid transitions for cards with a specific status.
|
105
|
+
|
106
|
+
The only purpose is to populate tab completion for the 'now' command in edit mode for a card.
|
107
|
+
|
108
|
+
* quit or exit or ctrl-d - exit
|
109
|
+
* list - dumps the current workflow (statuses with their valid subsequent statuses)
|
110
|
+
* create <status> - creates a new status
|
111
|
+
* add <status> <statuses> - add the specified statuses as valid transitions from status
|
112
|
+
* remove <status> <statuses> - remove the specified statuses as valid transitions from status
|
113
|
+
|
114
|
+
## Other tools
|
115
|
+
|
116
|
+
All cardigan commands can be executed directly without entering a shell:
|
117
|
+
|
118
|
+
cardigan touch create the first card
|
119
|
+
cardigan touch create the second card
|
120
|
+
cardigan ls
|
121
|
+
|
122
|
+
zsh command line completion for this can be configured by creating a symlink to the gem tools/zsh/_cardigan from one of the directories in $fpath.
|
123
|
+
|
124
|
+
## Future plans
|
125
|
+
|
126
|
+
Refer to the .cards for detailed story breakdown but automatic vcs interaction and generating pretty html reports/charts seem to be the most important missing features.
|
data/Rakefile
CHANGED
@@ -1,6 +1,19 @@
|
|
1
1
|
require 'bundler/gem_tasks'
|
2
2
|
|
3
|
+
task :default => :test
|
4
|
+
|
3
5
|
desc 'execute specifications'
|
4
6
|
task :test do
|
5
|
-
sh '
|
7
|
+
sh 'rspec spec'
|
8
|
+
sh 'cucumber'
|
9
|
+
end
|
10
|
+
|
11
|
+
SHARED_DOCS=%w{README HISTORY}
|
12
|
+
|
13
|
+
desc "Push feature documentation to relishapp using the relish-client-gem"
|
14
|
+
task :relish, :version do |t, args|
|
15
|
+
raise "rake relish[VERSION]" unless args[:version]
|
16
|
+
SHARED_DOCS.each {|doc| sh "cp #{doc}.md features/" }
|
17
|
+
sh "relish push cardigan/cardigan:#{args[:version]}"
|
18
|
+
SHARED_DOCS.each {|doc| sh "rm features/#{doc}.md" }
|
6
19
|
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
Feature: cd
|
2
|
+
|
3
|
+
In order to manage my ideas
|
4
|
+
As a command line junkie
|
5
|
+
I want to be able to edit individual attributes of a card
|
6
|
+
|
7
|
+
The cd command is so named because within the shell, you are 'changing directory' to
|
8
|
+
edit a card.
|
9
|
+
|
10
|
+
Within the cardigan shell, note that 'cd' enters a nested shell (so you need to exit or
|
11
|
+
ctrl-d twice).
|
12
|
+
|
13
|
+
Scenario: open a card for editing
|
14
|
+
When I run `cardigan cd a very interesting card` interactively
|
15
|
+
And I type "set estimate"
|
16
|
+
And I type "10"
|
17
|
+
And I type "ls"
|
18
|
+
And I type "exit"
|
19
|
+
Then the exit status should be 0
|
20
|
+
And the stdout should contain:
|
21
|
+
"""
|
22
|
+
estimate: "10"
|
23
|
+
name: "a very interesting card"
|
24
|
+
"""
|
@@ -0,0 +1,20 @@
|
|
1
|
+
Feature: claim
|
2
|
+
|
3
|
+
In order to indicate to others I am allocated to a card
|
4
|
+
As a command line junkie
|
5
|
+
I want to claim cards
|
6
|
+
|
7
|
+
Scenario: claim cards
|
8
|
+
When I run `cardigan touch a very interesting card`
|
9
|
+
And I run `cardigan claim 1`
|
10
|
+
And I run `cardigan columns name owner`
|
11
|
+
And I run `cardigan ls`
|
12
|
+
Then the exit status should be 0
|
13
|
+
And the stdout should contain:
|
14
|
+
"""
|
15
|
+
---------------------------------------------------------------------
|
16
|
+
| index | name | owner |
|
17
|
+
---------------------------------------------------------------------
|
18
|
+
| 1 | a very interesting card | "Ms Crazy Person" <you@there.com> |
|
19
|
+
---------------------------------------------------------------------
|
20
|
+
"""
|
@@ -0,0 +1,24 @@
|
|
1
|
+
Feature: columns
|
2
|
+
|
3
|
+
In order to see relevant information
|
4
|
+
As a command line junkie
|
5
|
+
I want to control the attributes that are displayed
|
6
|
+
|
7
|
+
Scenario: claim cards
|
8
|
+
When I run `cardigan` interactively
|
9
|
+
And I type "touch another interesting card"
|
10
|
+
And I type "set release 1"
|
11
|
+
And I type "ocelot"
|
12
|
+
And I type "set iteration 1"
|
13
|
+
And I type "3"
|
14
|
+
And I type "columns name release"
|
15
|
+
And I type "exit"
|
16
|
+
Then the exit status should be 0
|
17
|
+
And the stdout should contain:
|
18
|
+
"""
|
19
|
+
--------------------------------------------
|
20
|
+
| index | name | release |
|
21
|
+
--------------------------------------------
|
22
|
+
| 1 | another interesting card | ocelot |
|
23
|
+
--------------------------------------------
|
24
|
+
"""
|
@@ -0,0 +1,66 @@
|
|
1
|
+
Feature: count
|
2
|
+
|
3
|
+
In order to see relevant information
|
4
|
+
As a command line junkie
|
5
|
+
I want to count the cards that are displayed
|
6
|
+
|
7
|
+
Scenario: count total cards
|
8
|
+
When I run `cardigan` interactively
|
9
|
+
And I create the following cards:
|
10
|
+
| name |
|
11
|
+
| card 1 |
|
12
|
+
| card 2 |
|
13
|
+
And I type "count"
|
14
|
+
And I type "exit"
|
15
|
+
Then the exit status should be 0
|
16
|
+
And the stdout should contain:
|
17
|
+
"""
|
18
|
+
-------
|
19
|
+
| count |
|
20
|
+
-------
|
21
|
+
| 2 |
|
22
|
+
-------
|
23
|
+
"""
|
24
|
+
|
25
|
+
Scenario: count total cards grouped by an attribute
|
26
|
+
When I run `cardigan` interactively
|
27
|
+
And I create the following cards:
|
28
|
+
| name | release |
|
29
|
+
| card 1 | ocelot |
|
30
|
+
| card 2 | ocelot |
|
31
|
+
| card 3 | margay |
|
32
|
+
And I type "count release"
|
33
|
+
And I type "exit"
|
34
|
+
Then the exit status should be 0
|
35
|
+
And the stdout should contain:
|
36
|
+
"""
|
37
|
+
-----------------
|
38
|
+
| release | count |
|
39
|
+
-----------------
|
40
|
+
| margay | 1 |
|
41
|
+
| ocelot | 2 |
|
42
|
+
| | 3 |
|
43
|
+
-----------------
|
44
|
+
"""
|
45
|
+
|
46
|
+
Scenario: count total cards grouped by an attribute
|
47
|
+
When I run `cardigan` interactively
|
48
|
+
And I create the following cards:
|
49
|
+
| name | release |
|
50
|
+
| card 1 | ocelot |
|
51
|
+
| card 2 | margay |
|
52
|
+
| card 3 | |
|
53
|
+
And I type "count release"
|
54
|
+
And I type "exit"
|
55
|
+
Then the exit status should be 0
|
56
|
+
And the stdout should contain:
|
57
|
+
"""
|
58
|
+
-----------------
|
59
|
+
| release | count |
|
60
|
+
-----------------
|
61
|
+
| | 1 |
|
62
|
+
| margay | 1 |
|
63
|
+
| ocelot | 1 |
|
64
|
+
| | 3 |
|
65
|
+
-----------------
|
66
|
+
"""
|
@@ -0,0 +1,20 @@
|
|
1
|
+
Feature: export
|
2
|
+
|
3
|
+
In order to interoperate with other tracking systems
|
4
|
+
As a command line junkie
|
5
|
+
I want to export my cards to csv
|
6
|
+
|
7
|
+
Scenario: export cards to csv
|
8
|
+
When I run `cardigan` interactively
|
9
|
+
And I create the following cards:
|
10
|
+
| name |
|
11
|
+
| qwer |
|
12
|
+
| asdf |
|
13
|
+
| zxcv |
|
14
|
+
And I type "export cards"
|
15
|
+
And I type "exit"
|
16
|
+
Then the exit status should be 0
|
17
|
+
And the file "cards.csv" should match /^id,name$/
|
18
|
+
And the file "cards.csv" should match /^\w{8}-\w{4}-\w{4}-\w{4}-\w{12},qwer$/
|
19
|
+
And the file "cards.csv" should match /^\w{8}-\w{4}-\w{4}-\w{4}-\w{12},asdf$/
|
20
|
+
And the file "cards.csv" should match /^\w{8}-\w{4}-\w{4}-\w{4}-\w{12},zxcv$/
|
@@ -0,0 +1,42 @@
|
|
1
|
+
Feature: filter
|
2
|
+
|
3
|
+
In order to see relevant information
|
4
|
+
As a command line junkie
|
5
|
+
I want to filter the cards that are displayed
|
6
|
+
|
7
|
+
Scenario: filter cards
|
8
|
+
When I run `cardigan` interactively
|
9
|
+
And I create the following cards:
|
10
|
+
| name | release |
|
11
|
+
| another interesting card | margay |
|
12
|
+
| a seriously interesting card | ocelot |
|
13
|
+
And I type "filter card['release'] == 'ocelot'"
|
14
|
+
And I type "ls"
|
15
|
+
And I type "exit"
|
16
|
+
Then the exit status should be 0
|
17
|
+
And the stdout should contain:
|
18
|
+
"""
|
19
|
+
--------------------------------------
|
20
|
+
| index | name |
|
21
|
+
--------------------------------------
|
22
|
+
| 1 | a seriously interesting card |
|
23
|
+
--------------------------------------
|
24
|
+
"""
|
25
|
+
|
26
|
+
Scenario: filter cards by owner
|
27
|
+
When I run `cardigan` interactively
|
28
|
+
And I type "touch another interesting card"
|
29
|
+
And I type "touch a seriously interesting card"
|
30
|
+
And I type "claim 2"
|
31
|
+
And I type "filter card['owner'] == me"
|
32
|
+
And I type "ls"
|
33
|
+
And I type "exit"
|
34
|
+
Then the exit status should be 0
|
35
|
+
And the stdout should contain:
|
36
|
+
"""
|
37
|
+
----------------------------------
|
38
|
+
| index | name |
|
39
|
+
----------------------------------
|
40
|
+
| 1 | another interesting card |
|
41
|
+
----------------------------------
|
42
|
+
"""
|
@@ -0,0 +1,32 @@
|
|
1
|
+
Feature: import
|
2
|
+
|
3
|
+
In order to interoperate with other tracking systems
|
4
|
+
As a command line junkie
|
5
|
+
I want to import cards from csv
|
6
|
+
|
7
|
+
Scenario: import cards containing ids from csv
|
8
|
+
Given a file named "cards1.csv" with:
|
9
|
+
"""
|
10
|
+
id,name,estimate
|
11
|
+
10,qwer,1
|
12
|
+
11,adsf,2
|
13
|
+
12,zxcv,3
|
14
|
+
"""
|
15
|
+
When I run `cardigan import cards1`
|
16
|
+
And I run `cardigan ls`
|
17
|
+
And I run `cardigan export cards2`
|
18
|
+
Then the exit status should be 0
|
19
|
+
And the stdout should contain:
|
20
|
+
"""
|
21
|
+
--------------
|
22
|
+
| index | name |
|
23
|
+
--------------
|
24
|
+
| 1 | adsf |
|
25
|
+
| 2 | qwer |
|
26
|
+
| 3 | zxcv |
|
27
|
+
--------------
|
28
|
+
"""
|
29
|
+
And the file "cards2.csv" should contain "id,estimate,name"
|
30
|
+
And the file "cards2.csv" should contain "10,1,qwer"
|
31
|
+
And the file "cards2.csv" should contain "11,2,adsf"
|
32
|
+
And the file "cards2.csv" should contain "12,3,zxcv"
|
@@ -0,0 +1,29 @@
|
|
1
|
+
Feature: ls
|
2
|
+
|
3
|
+
In order to manage my ideas
|
4
|
+
As a command line junkie
|
5
|
+
I want to list my cards
|
6
|
+
|
7
|
+
Scenario: empty card repository
|
8
|
+
When I run `cardigan ls`
|
9
|
+
Then the exit status should be 0
|
10
|
+
And the stdout should contain "There are no cards to display"
|
11
|
+
|
12
|
+
Scenario: a single card is added in shell
|
13
|
+
When I run `cardigan` interactively
|
14
|
+
And I create the following cards:
|
15
|
+
| name |
|
16
|
+
| card 1 |
|
17
|
+
| card 2 |
|
18
|
+
And I type "ls"
|
19
|
+
And I type "exit"
|
20
|
+
Then the exit status should be 0
|
21
|
+
And the stdout should contain:
|
22
|
+
"""
|
23
|
+
----------------
|
24
|
+
| index | name |
|
25
|
+
----------------
|
26
|
+
| 1 | card 1 |
|
27
|
+
| 2 | card 2 |
|
28
|
+
----------------
|
29
|
+
"""
|
@@ -0,0 +1,27 @@
|
|
1
|
+
Feature: rm
|
2
|
+
|
3
|
+
In order to manage my ideas
|
4
|
+
As a command line junkie
|
5
|
+
I want to be able to remove cards that are no longer required
|
6
|
+
|
7
|
+
Scenario: remove a card
|
8
|
+
When I run `cardigan` interactively
|
9
|
+
And I create the following cards:
|
10
|
+
| name |
|
11
|
+
| card 1 |
|
12
|
+
| card 2 |
|
13
|
+
| card 3 |
|
14
|
+
| card 4 |
|
15
|
+
And I type "rm 2 3"
|
16
|
+
And I type "ls"
|
17
|
+
And I type "exit"
|
18
|
+
Then the exit status should be 0
|
19
|
+
And the stdout should contain:
|
20
|
+
"""
|
21
|
+
----------------
|
22
|
+
| index | name |
|
23
|
+
----------------
|
24
|
+
| 1 | card 1 |
|
25
|
+
| 2 | card 4 |
|
26
|
+
----------------
|
27
|
+
"""
|