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
@@ -1,9 +1,11 @@
|
|
1
1
|
require 'flat_hash/serialiser'
|
2
2
|
require 'flat_hash/repository'
|
3
3
|
|
4
|
+
module Cardigan; end
|
5
|
+
|
4
6
|
class Cardigan::WorkflowRepository
|
5
|
-
def initialize
|
6
|
-
@directory =
|
7
|
+
def initialize directory
|
8
|
+
@directory = directory
|
7
9
|
@key = '.card_workflow'
|
8
10
|
end
|
9
11
|
|
@@ -15,7 +17,7 @@ class Cardigan::WorkflowRepository
|
|
15
17
|
end
|
16
18
|
|
17
19
|
def load
|
18
|
-
workflow = @directory[@key]
|
20
|
+
workflow = @directory.exist?(@key) ? @directory[@key] : {}
|
19
21
|
workflow.keys.each do |key|
|
20
22
|
workflow[key] = workflow[key].split("\n") unless workflow[key].instance_of?(Array)
|
21
23
|
end
|
@@ -57,6 +57,7 @@ describe Cardigan::Command::TotalCards do
|
|
57
57
|
' -------------------',
|
58
58
|
'| 1 | 4 |',
|
59
59
|
'| 2 | 2 |',
|
60
|
+
'| | 6 |',
|
60
61
|
' -------------------'
|
61
62
|
]
|
62
63
|
end
|
@@ -76,6 +77,7 @@ describe Cardigan::Command::TotalCards do
|
|
76
77
|
'| 1 | 1 | 3 |',
|
77
78
|
'| 1 | 2 | 1 |',
|
78
79
|
'| 2 | 2 | 2 |',
|
80
|
+
'| | | 6 |',
|
79
81
|
' --------------------------------'
|
80
82
|
]
|
81
83
|
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
require File.dirname(__FILE__)+'/spec_helper'
|
2
|
+
require 'cardigan/workflow_repository'
|
3
|
+
|
4
|
+
describe Cardigan::WorkflowRepository do
|
5
|
+
before do
|
6
|
+
@directory = stub 'directory'
|
7
|
+
end
|
8
|
+
|
9
|
+
describe '#load' do
|
10
|
+
before do
|
11
|
+
@repository = Cardigan::WorkflowRepository.new @directory
|
12
|
+
end
|
13
|
+
|
14
|
+
it 'should return empty hash when repository does not contain an entry with the workflow key' do
|
15
|
+
@directory.should_receive(:exist?).with('.card_workflow').and_return false
|
16
|
+
@repository.load.should == {}
|
17
|
+
end
|
18
|
+
|
19
|
+
it 'should return populated hash when repository contains an entry with the workflow key' do
|
20
|
+
@directory.should_receive(:exist?).with('.card_workflow').and_return true
|
21
|
+
@directory.should_receive(:[]).with('.card_workflow').and_return 'first' => [], 'second' => []
|
22
|
+
@repository.load.should == {'first' => [], 'second' => []}
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
data/tools/zsh/_cardigan
ADDED
@@ -0,0 +1,35 @@
|
|
1
|
+
#compdef cardigan
|
2
|
+
#autoload
|
3
|
+
|
4
|
+
local -a _1st_arguments
|
5
|
+
_1st_arguments=(
|
6
|
+
'cd:enter shell to edit specific card'
|
7
|
+
'claim:claim the specified cards by index'
|
8
|
+
'columns:specify the columns to display in list view'
|
9
|
+
'commit:commit all current changes'
|
10
|
+
'count:display card counts grouped by specified attributes'
|
11
|
+
'export:export cards to a csv file'
|
12
|
+
'filter:apply filter (a ruby block) to current cards'
|
13
|
+
'import:import cards from a csv file'
|
14
|
+
'ls:list all cards (subject to current filter)'
|
15
|
+
'rm:remove the specified cards by index'
|
16
|
+
'set:prompt for a new value for the specified attribute for specified cards by index'
|
17
|
+
'sort:specify sort columns for list view'
|
18
|
+
'total:display total for numeric attribute grouped by specified attributes'
|
19
|
+
'touch:create a new card with the specified description'
|
20
|
+
'unclaim:remove owner from the specified cards'
|
21
|
+
'unfilter:remove current filter'
|
22
|
+
'workflow:enter shell to edit workflow'
|
23
|
+
)
|
24
|
+
|
25
|
+
local expl
|
26
|
+
|
27
|
+
_arguments \
|
28
|
+
'(-v --version)'{-v,--version}'[show version]' \
|
29
|
+
'(-h --help)'{-h,--help}'[show help]' \
|
30
|
+
'*:: :->subcmds' && return 0
|
31
|
+
|
32
|
+
if (( CURRENT == 1 )); then
|
33
|
+
_describe -t commands "cardigan subcommand" _1st_arguments
|
34
|
+
return
|
35
|
+
fi
|
metadata
CHANGED
@@ -1,117 +1,153 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: cardigan
|
3
|
-
version: !ruby/object:Gem::Version
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.1
|
4
5
|
prerelease:
|
5
|
-
version: 0.1.0
|
6
6
|
platform: ruby
|
7
|
-
authors:
|
7
|
+
authors:
|
8
8
|
- Mark Ryall
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
dependencies:
|
16
|
-
- !ruby/object:Gem::Dependency
|
12
|
+
date: 2011-09-27 00:00:00.000000000Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
17
15
|
name: flat_hash
|
18
|
-
|
19
|
-
requirement: &id001 !ruby/object:Gem::Requirement
|
16
|
+
requirement: &70306892255660 !ruby/object:Gem::Requirement
|
20
17
|
none: false
|
21
|
-
requirements:
|
18
|
+
requirements:
|
22
19
|
- - ~>
|
23
|
-
- !ruby/object:Gem::Version
|
24
|
-
version:
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '0'
|
25
22
|
type: :runtime
|
26
|
-
version_requirements: *id001
|
27
|
-
- !ruby/object:Gem::Dependency
|
28
|
-
name: splat
|
29
23
|
prerelease: false
|
30
|
-
|
24
|
+
version_requirements: *70306892255660
|
25
|
+
- !ruby/object:Gem::Dependency
|
26
|
+
name: splat
|
27
|
+
requirement: &70306892254960 !ruby/object:Gem::Requirement
|
31
28
|
none: false
|
32
|
-
requirements:
|
29
|
+
requirements:
|
33
30
|
- - ~>
|
34
|
-
- !ruby/object:Gem::Version
|
35
|
-
version:
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '0'
|
36
33
|
type: :runtime
|
37
|
-
version_requirements: *id002
|
38
|
-
- !ruby/object:Gem::Dependency
|
39
|
-
name: shell_shock
|
40
34
|
prerelease: false
|
41
|
-
|
35
|
+
version_requirements: *70306892254960
|
36
|
+
- !ruby/object:Gem::Dependency
|
37
|
+
name: shell_shock
|
38
|
+
requirement: &70306892253840 !ruby/object:Gem::Requirement
|
42
39
|
none: false
|
43
|
-
requirements:
|
40
|
+
requirements:
|
44
41
|
- - ~>
|
45
|
-
- !ruby/object:Gem::Version
|
46
|
-
version:
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
version: '0'
|
47
44
|
type: :runtime
|
48
|
-
version_requirements: *id003
|
49
|
-
- !ruby/object:Gem::Dependency
|
50
|
-
name: uuidtools
|
51
45
|
prerelease: false
|
52
|
-
|
46
|
+
version_requirements: *70306892253840
|
47
|
+
- !ruby/object:Gem::Dependency
|
48
|
+
name: uuidtools
|
49
|
+
requirement: &70306892252760 !ruby/object:Gem::Requirement
|
53
50
|
none: false
|
54
|
-
requirements:
|
51
|
+
requirements:
|
55
52
|
- - ~>
|
56
|
-
- !ruby/object:Gem::Version
|
57
|
-
version:
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '2'
|
58
55
|
type: :runtime
|
59
|
-
version_requirements: *id004
|
60
|
-
- !ruby/object:Gem::Dependency
|
61
|
-
name: activesupport
|
62
56
|
prerelease: false
|
63
|
-
|
57
|
+
version_requirements: *70306892252760
|
58
|
+
- !ruby/object:Gem::Dependency
|
59
|
+
name: activesupport
|
60
|
+
requirement: &70306892251780 !ruby/object:Gem::Requirement
|
64
61
|
none: false
|
65
|
-
requirements:
|
62
|
+
requirements:
|
66
63
|
- - ~>
|
67
|
-
- !ruby/object:Gem::Version
|
68
|
-
version:
|
64
|
+
- !ruby/object:Gem::Version
|
65
|
+
version: '3'
|
69
66
|
type: :runtime
|
70
|
-
version_requirements: *id005
|
71
|
-
- !ruby/object:Gem::Dependency
|
72
|
-
name: i18n
|
73
67
|
prerelease: false
|
74
|
-
|
68
|
+
version_requirements: *70306892251780
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: i18n
|
71
|
+
requirement: &70306892250580 !ruby/object:Gem::Requirement
|
75
72
|
none: false
|
76
|
-
requirements:
|
73
|
+
requirements:
|
77
74
|
- - ~>
|
78
|
-
- !ruby/object:Gem::Version
|
79
|
-
version:
|
75
|
+
- !ruby/object:Gem::Version
|
76
|
+
version: '0'
|
80
77
|
type: :runtime
|
81
|
-
|
82
|
-
|
78
|
+
prerelease: false
|
79
|
+
version_requirements: *70306892250580
|
80
|
+
- !ruby/object:Gem::Dependency
|
83
81
|
name: rake
|
82
|
+
requirement: &70306892249820 !ruby/object:Gem::Requirement
|
83
|
+
none: false
|
84
|
+
requirements:
|
85
|
+
- - ~>
|
86
|
+
- !ruby/object:Gem::Version
|
87
|
+
version: '0.8'
|
88
|
+
type: :development
|
84
89
|
prerelease: false
|
85
|
-
|
90
|
+
version_requirements: *70306892249820
|
91
|
+
- !ruby/object:Gem::Dependency
|
92
|
+
name: relish
|
93
|
+
requirement: &70306892248460 !ruby/object:Gem::Requirement
|
86
94
|
none: false
|
87
|
-
requirements:
|
95
|
+
requirements:
|
88
96
|
- - ~>
|
89
|
-
- !ruby/object:Gem::Version
|
90
|
-
version:
|
97
|
+
- !ruby/object:Gem::Version
|
98
|
+
version: '0.5'
|
91
99
|
type: :development
|
92
|
-
|
93
|
-
|
100
|
+
prerelease: false
|
101
|
+
version_requirements: *70306892248460
|
102
|
+
- !ruby/object:Gem::Dependency
|
94
103
|
name: rspec
|
104
|
+
requirement: &70306892247320 !ruby/object:Gem::Requirement
|
105
|
+
none: false
|
106
|
+
requirements:
|
107
|
+
- - ~>
|
108
|
+
- !ruby/object:Gem::Version
|
109
|
+
version: '2'
|
110
|
+
type: :development
|
95
111
|
prerelease: false
|
96
|
-
|
112
|
+
version_requirements: *70306892247320
|
113
|
+
- !ruby/object:Gem::Dependency
|
114
|
+
name: aruba
|
115
|
+
requirement: &70306892246100 !ruby/object:Gem::Requirement
|
97
116
|
none: false
|
98
|
-
requirements:
|
117
|
+
requirements:
|
99
118
|
- - ~>
|
100
|
-
- !ruby/object:Gem::Version
|
101
|
-
version:
|
119
|
+
- !ruby/object:Gem::Version
|
120
|
+
version: '0'
|
102
121
|
type: :development
|
103
|
-
|
104
|
-
|
105
|
-
|
122
|
+
prerelease: false
|
123
|
+
version_requirements: *70306892246100
|
124
|
+
description: ! 'A command line utility that manages cards as individual files so that
|
125
|
+
they can be added to a version control system
|
106
126
|
|
127
|
+
'
|
107
128
|
email: mark@ryall.name
|
108
|
-
executables:
|
129
|
+
executables:
|
109
130
|
- cardigan
|
110
131
|
extensions: []
|
111
|
-
|
112
132
|
extra_rdoc_files: []
|
113
|
-
|
114
|
-
|
133
|
+
files:
|
134
|
+
- bin/cardigan
|
135
|
+
- features/commands/cd.feature
|
136
|
+
- features/commands/claim.feature
|
137
|
+
- features/commands/columns.feature
|
138
|
+
- features/commands/count.feature
|
139
|
+
- features/commands/export.feature
|
140
|
+
- features/commands/filter.feature
|
141
|
+
- features/commands/import.feature
|
142
|
+
- features/commands/ls.feature
|
143
|
+
- features/commands/rm.feature
|
144
|
+
- features/commands/set.feature
|
145
|
+
- features/commands/total.feature
|
146
|
+
- features/commands/touch.feature
|
147
|
+
- features/commands/unclaim.feature
|
148
|
+
- features/commands/unfilter.feature
|
149
|
+
- features/step_definitions/cardigan_steps.rb
|
150
|
+
- features/support/env.rb
|
115
151
|
- lib/cardigan/card_editor.rb
|
116
152
|
- lib/cardigan/cli.rb
|
117
153
|
- lib/cardigan/command/add_transitions.rb
|
@@ -138,6 +174,7 @@ files:
|
|
138
174
|
- lib/cardigan/command/unclaim_cards.rb
|
139
175
|
- lib/cardigan/command/unfilter_cards.rb
|
140
176
|
- lib/cardigan/commands.rb
|
177
|
+
- lib/cardigan/configuration.rb
|
141
178
|
- lib/cardigan/entry_context.rb
|
142
179
|
- lib/cardigan/filtered_repository.rb
|
143
180
|
- lib/cardigan/io.rb
|
@@ -145,7 +182,6 @@ files:
|
|
145
182
|
- lib/cardigan/text_report_formatter.rb
|
146
183
|
- lib/cardigan/workflow_context.rb
|
147
184
|
- lib/cardigan/workflow_repository.rb
|
148
|
-
- bin/cardigan
|
149
185
|
- spec/command/add_transitions_spec.rb
|
150
186
|
- spec/command/batch_update_cards_spec.rb
|
151
187
|
- spec/command/change_status_spec.rb
|
@@ -170,37 +206,38 @@ files:
|
|
170
206
|
- spec/command/unfilter_cards_spec.rb
|
171
207
|
- spec/spec_helper.rb
|
172
208
|
- spec/text_report_formatter_spec.rb
|
173
|
-
-
|
209
|
+
- spec/workflow_repository_spec.rb
|
210
|
+
- tools/zsh/_cardigan
|
211
|
+
- HISTORY.md
|
212
|
+
- README.md
|
174
213
|
- MIT-LICENSE
|
175
214
|
- .gemtest
|
176
215
|
- Rakefile
|
177
|
-
has_rdoc: true
|
178
216
|
homepage: http://github.com/markryall/cardigan
|
179
217
|
licenses: []
|
180
|
-
|
181
218
|
post_install_message:
|
182
219
|
rdoc_options: []
|
183
|
-
|
184
|
-
require_paths:
|
220
|
+
require_paths:
|
185
221
|
- lib
|
186
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
222
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
187
223
|
none: false
|
188
|
-
requirements:
|
189
|
-
- -
|
190
|
-
- !ruby/object:Gem::Version
|
191
|
-
version:
|
192
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
224
|
+
requirements:
|
225
|
+
- - ! '>='
|
226
|
+
- !ruby/object:Gem::Version
|
227
|
+
version: '1.9'
|
228
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
193
229
|
none: false
|
194
|
-
requirements:
|
195
|
-
- -
|
196
|
-
- !ruby/object:Gem::Version
|
197
|
-
version:
|
230
|
+
requirements:
|
231
|
+
- - ! '>='
|
232
|
+
- !ruby/object:Gem::Version
|
233
|
+
version: '0'
|
234
|
+
segments:
|
235
|
+
- 0
|
236
|
+
hash: -238542185425892369
|
198
237
|
requirements: []
|
199
|
-
|
200
238
|
rubyforge_project:
|
201
|
-
rubygems_version: 1.
|
239
|
+
rubygems_version: 1.8.10
|
202
240
|
signing_key:
|
203
241
|
specification_version: 3
|
204
242
|
summary: command line utility for managing cards (tasks, bugs, stories or whatever)
|
205
243
|
test_files: []
|
206
|
-
|
data/README.rdoc
DELETED
@@ -1,73 +0,0 @@
|
|
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
|
-
The commands available are (with the awesome power of tab completion):
|
30
|
-
|
31
|
-
* quit or exit or ctrl-d - exit
|
32
|
-
* list - shows all cards with an index
|
33
|
-
* filter <filter> - sets the filter for cards - this is ruby code such as card[:name].start_with?('a')
|
34
|
-
* claim <numbers> - sets the owner of the specified cards (by index from the list)
|
35
|
-
* unclaim <numbers> - removes the owner from the specified cards (by index from the list)
|
36
|
-
* create <name> - creates a card with the specified name
|
37
|
-
* open <name> - creates or opens the card and enters edit mode
|
38
|
-
* display <columns> - lists or changes the columns to be displayed by the list command
|
39
|
-
* sort <columns> - lists or changes the columns to be used for sorting by the list command
|
40
|
-
* destroy <numbers> - deletes the specified cards (by index from the list)
|
41
|
-
* set <key> <numbers> - prompts for a field value and sets it on all specified cards (by index from the list)
|
42
|
-
* workflow - enters workflow editing mode
|
43
|
-
* count <grouping fields> - counts the number of cards for each combination of the grouping fields
|
44
|
-
* total <numeric field> <grouping fields> - calculates the total of the specified numeric field for each combination of the grouping fields
|
45
|
-
* export <filename> - writes all columns for current filtered cards to <filename>.csv
|
46
|
-
* import <filename> - imports all cards from <filename>.csv - cards will be updated with a matching id, otherwise new cards will be created.
|
47
|
-
|
48
|
-
== Editing mode
|
49
|
-
|
50
|
-
* quit or exit or ctrl-d - exit
|
51
|
-
* list - dumps the values of all card field values
|
52
|
-
* set <key> - creates a new field and prompts for the new value
|
53
|
-
* 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)
|
54
|
-
|
55
|
-
== Workflow mode
|
56
|
-
|
57
|
-
Workflow is pretty simple - it is just for convenience in specifiying the set of valid transitions for cards with a specific status.
|
58
|
-
|
59
|
-
The only purpose is to populate tab completion for the 'now' command in edit mode for a card.
|
60
|
-
|
61
|
-
* quit or exit or ctrl-d - exit
|
62
|
-
* list - dumps the current workflow (statuses with their valid subsequent statuses)
|
63
|
-
* create <status> - creates a new status
|
64
|
-
* add <status> <statuses> - add the specified statuses as valid transitions from status
|
65
|
-
* remove <status> <statuses> - remove the specified statuses as valid transitions from status
|
66
|
-
|
67
|
-
== Walkthroughs
|
68
|
-
|
69
|
-
In case this documentation makes no sense at all, a few usage scenarios can be found here: http://gist.github.com/331647
|
70
|
-
|
71
|
-
== Future plans
|
72
|
-
|
73
|
-
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.
|