cardigan 0.0.6 → 0.0.7
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +1 -1
- data/lib/cardigan/command/filter_cards.rb +9 -15
- data/lib/cardigan/command/list_cards.rb +10 -4
- data/lib/cardigan/command/specify_display_columns.rb +3 -9
- data/lib/cardigan/command/specify_sort_columns.rb +3 -9
- data/lib/cardigan/command/unfilter_cards.rb +5 -10
- data/lib/cardigan/entry_context.rb +2 -1
- data/lib/cardigan/root_context.rb +1 -1
- metadata +1 -2
- data/lib/cardigan/command/display_cards.rb +0 -14
data/README.rdoc
CHANGED
@@ -70,4 +70,4 @@ In case this documentation makes no sense at all, a few usage scenarios can be f
|
|
70
70
|
|
71
71
|
== Future plans
|
72
72
|
|
73
|
-
Refer to the .cards for detailed story breakdown but
|
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.
|
@@ -1,19 +1,13 @@
|
|
1
|
-
|
2
|
-
module Command
|
3
|
-
class FilterCards
|
4
|
-
def initialize repository, io
|
5
|
-
@repository, @io = repository, io
|
6
|
-
end
|
1
|
+
require 'cardigan/command/list_cards'
|
7
2
|
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
end
|
3
|
+
class Cardigan::Command::FilterCards < Cardigan::Command::ListCards
|
4
|
+
def execute filter
|
5
|
+
@repository.filter = filter
|
6
|
+
begin
|
7
|
+
super
|
8
|
+
rescue Exception => e
|
9
|
+
@io.say "Invalid expression:\n#{e.message}"
|
10
|
+
@repository.filter = nil
|
17
11
|
end
|
18
12
|
end
|
19
13
|
end
|
@@ -1,14 +1,20 @@
|
|
1
1
|
require 'cardigan/text_report_formatter'
|
2
|
-
require 'cardigan/command/display_cards'
|
3
2
|
|
4
3
|
class Cardigan::Command::ListCards
|
5
|
-
include Cardigan::Command::DisplayCards
|
6
|
-
|
7
4
|
def initialize repository, io
|
8
5
|
@repository, @io = repository, io
|
9
6
|
end
|
10
7
|
|
11
8
|
def execute text
|
12
|
-
|
9
|
+
cards = @repository.cards
|
10
|
+
if cards.empty?
|
11
|
+
@io.say "There are no cards to display"
|
12
|
+
return
|
13
|
+
end
|
14
|
+
formatter = Cardigan::TextReportFormatter.new @io
|
15
|
+
@repository.display_columns.each do |column|
|
16
|
+
formatter.add_column(column, @repository.max_field_length(column))
|
17
|
+
end
|
18
|
+
formatter.output cards
|
13
19
|
end
|
14
20
|
end
|
@@ -1,16 +1,10 @@
|
|
1
|
-
require 'cardigan/command/
|
2
|
-
|
3
|
-
class Cardigan::Command::SpecifyDisplayColumns
|
4
|
-
include Cardigan::Command::DisplayCards
|
5
|
-
|
6
|
-
def initialize repository, io
|
7
|
-
@repository, @io = repository, io
|
8
|
-
end
|
1
|
+
require 'cardigan/command/list_cards'
|
9
2
|
|
3
|
+
class Cardigan::Command::SpecifyDisplayColumns < Cardigan::Command::ListCards
|
10
4
|
def execute text
|
11
5
|
if text
|
12
6
|
@repository.display_columns = text.scan(/\w+/)
|
13
|
-
|
7
|
+
super
|
14
8
|
else
|
15
9
|
@io.say "current columns: #{@repository.display_columns.join(',')}"
|
16
10
|
@io.say "available columns: #{@repository.columns.sort.join(',')}"
|
@@ -1,16 +1,10 @@
|
|
1
|
-
require 'cardigan/command/
|
2
|
-
|
3
|
-
class Cardigan::Command::SpecifySortColumns
|
4
|
-
include Cardigan::Command::DisplayCards
|
5
|
-
|
6
|
-
def initialize repository, io
|
7
|
-
@repository, @io = repository, io
|
8
|
-
end
|
1
|
+
require 'cardigan/command/list_cards'
|
9
2
|
|
3
|
+
class Cardigan::Command::SpecifySortColumns < Cardigan::Command::ListCards
|
10
4
|
def execute text
|
11
5
|
if text
|
12
6
|
@repository.sort_columns = text.scan(/\w+/)
|
13
|
-
|
7
|
+
super
|
14
8
|
else
|
15
9
|
@io.say "current columns: #{@repository.sort_columns.join(',')}"
|
16
10
|
@io.say "available columns: #{@repository.columns.sort.join(',')}"
|
@@ -1,13 +1,8 @@
|
|
1
|
-
|
2
|
-
module Command
|
3
|
-
class UnfilterCards
|
4
|
-
def initialize repository
|
5
|
-
@repository = repository
|
6
|
-
end
|
1
|
+
require 'cardigan/command/list_cards'
|
7
2
|
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
3
|
+
class Cardigan::Command::UnfilterCards < Cardigan::Command::ListCards
|
4
|
+
def execute filter
|
5
|
+
@repository.filter = nil
|
6
|
+
super
|
12
7
|
end
|
13
8
|
end
|
@@ -16,7 +16,8 @@ module Cardigan
|
|
16
16
|
|
17
17
|
def refresh_commands
|
18
18
|
status = @entry['status'] || 'none'
|
19
|
-
@workflow_repository.load[status]
|
19
|
+
next_statuses = @workflow_repository.load[status]
|
20
|
+
next_statuses ? next_statuses.map { |s| "now #{s}" } : []
|
20
21
|
end
|
21
22
|
end
|
22
23
|
end
|
@@ -19,7 +19,7 @@ module Cardigan
|
|
19
19
|
'set' => command(:batch_update_cards, @repository, @io),
|
20
20
|
'sort' => command(:specify_sort_columns, @repository, @io),
|
21
21
|
'unclaim' => command(:unclaim_cards, @repository, @io),
|
22
|
-
'unfilter' => command(:unfilter_cards, @repository),
|
22
|
+
'unfilter' => command(:unfilter_cards, @repository, @io),
|
23
23
|
'workflow' => command(:open_workflow, @workflow_repository, @io),
|
24
24
|
'count' => command(:count_cards, @repository, @io),
|
25
25
|
'total' => command(:total_cards, @repository, @io),
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cardigan
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mark Ryall
|
@@ -52,7 +52,6 @@ files:
|
|
52
52
|
- lib/cardigan/command/count_cards.rb
|
53
53
|
- lib/cardigan/command/create_card.rb
|
54
54
|
- lib/cardigan/command/destroy_cards.rb
|
55
|
-
- lib/cardigan/command/display_cards.rb
|
56
55
|
- lib/cardigan/command/export_cards.rb
|
57
56
|
- lib/cardigan/command/filter_cards.rb
|
58
57
|
- lib/cardigan/command/import_cards.rb
|
@@ -1,14 +0,0 @@
|
|
1
|
-
module Cardigan::Command::DisplayCards
|
2
|
-
def display_cards
|
3
|
-
cards = @repository.cards
|
4
|
-
if cards.empty?
|
5
|
-
@io.say "There are no cards to display"
|
6
|
-
return
|
7
|
-
end
|
8
|
-
formatter = Cardigan::TextReportFormatter.new @io
|
9
|
-
@repository.display_columns.each do |column|
|
10
|
-
formatter.add_column(column, @repository.max_field_length(column))
|
11
|
-
end
|
12
|
-
formatter.output cards
|
13
|
-
end
|
14
|
-
end
|