trollolo 0.0.9 → 0.0.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +14 -0
- data/Gemfile +1 -1
- data/README.md +97 -0
- data/lib/card.rb +0 -14
- data/lib/cli.rb +66 -27
- data/lib/empty_column.rb +5 -0
- data/lib/scrum/backlog_mover.rb +47 -0
- data/lib/scrum/card_type_detection.rb +23 -0
- data/lib/scrum/creator.rb +30 -0
- data/lib/scrum/prioritizer.rb +24 -0
- data/lib/scrum/priority_name.rb +15 -0
- data/lib/scrum/scrum_boards.rb +11 -0
- data/lib/scrum/sprint_board.rb +82 -0
- data/lib/scrum/sprint_cleaner.rb +41 -0
- data/lib/scrum/sprint_planning_board.rb +26 -0
- data/lib/scrum.rb +13 -0
- data/lib/scrum_board.rb +17 -7
- data/lib/settings.rb +36 -12
- data/lib/trello_service.rb +22 -0
- data/lib/trello_wrapper.rb +9 -23
- data/lib/trollolo.rb +3 -2
- data/lib/version.rb +1 -1
- data/man/trollolo.1.md +22 -1
- data/spec/data/board.json +3 -4
- data/spec/data/full-board-with-accepted.json +1817 -0
- data/spec/data/full-board.json +3 -27
- data/spec/data/trollolorc +13 -0
- data/spec/data/trollolorc_with_board_aliases +9 -0
- data/spec/data/vcr/creator_custom_config.yml +824 -0
- data/spec/data/vcr/creator_default_config.yml +824 -0
- data/spec/data/vcr/move_backlog.yml +2375 -0
- data/spec/data/vcr/move_backlog_missing_backlog.yml +155 -0
- data/spec/data/vcr/move_backlog_missing_waterbed.yml +364 -0
- data/spec/data/vcr/prioritize_backlog_list.yml +2335 -0
- data/spec/data/vcr/prioritize_no_backlog_list.yml +190 -0
- data/spec/data/vcr/sprint_board.yml +624 -0
- data/spec/data/vcr/sprint_board_no_waterline.yml +556 -0
- data/spec/data/vcr/sprint_cleanup.yml +1239 -7500
- data/spec/data/vcr/sprint_planning_board.yml +239 -0
- data/spec/integration/create_burndown_spec.rb +1 -1
- data/spec/unit/card_spec.rb +0 -41
- data/spec/unit/cli_spec.rb +74 -1
- data/spec/unit/empty_column_spec.rb +9 -0
- data/spec/unit/scrum/backlog_mover_spec.rb +26 -0
- data/spec/unit/scrum/card_type_detection_spec.rb +35 -0
- data/spec/unit/scrum/creator_spec.rb +23 -0
- data/spec/unit/scrum/prioritizer_spec.rb +45 -0
- data/spec/unit/scrum/priority_name_spec.rb +35 -0
- data/spec/unit/scrum/sprint_board_spec.rb +22 -0
- data/spec/unit/scrum/sprint_cleaner_spec.rb +26 -0
- data/spec/unit/scrum/sprint_planning_board_spec.rb +14 -0
- data/spec/unit/scrum_board_spec.rb +90 -0
- data/spec/unit/settings_spec.rb +42 -6
- data/spec/unit/spec_helper.rb +3 -2
- data/spec/unit/support/update_webmock_data +3 -1
- data/spec/unit/support/vcr.rb +8 -8
- data/spec/unit/support/webmocks.rb +9 -0
- data/spec/unit/trello_wrapper_spec.rb +20 -0
- data/trollolo.gemspec +2 -1
- metadata +52 -9
- data/lib/prioritizer.rb +0 -34
- data/lib/sprint_cleanup.rb +0 -54
- data/spec/unit/prioritizer_spec.rb +0 -47
- data/spec/unit/sprint_cleanup_spec.rb +0 -18
@@ -83,4 +83,94 @@ describe ScrumBoard do
|
|
83
83
|
expect(scrum_board.done_column.name).to eq("Done (July 20th - August 3rd)")
|
84
84
|
end
|
85
85
|
end
|
86
|
+
|
87
|
+
describe "card counts" do
|
88
|
+
context "full board" do
|
89
|
+
let(:board) { ScrumBoard.new(JSON.parse(load_test_file("full-board.json")), dummy_settings) }
|
90
|
+
|
91
|
+
it "#done_cards" do
|
92
|
+
expect(board.done_cards.count).to eq(3)
|
93
|
+
expect(board.done_cards[0].name).to eq("Burndown chart")
|
94
|
+
expect(board.done_cards[1].name).to eq("Sprint 10")
|
95
|
+
expect(board.done_cards[2].name).to eq("(3) P3: Fill Done columns")
|
96
|
+
end
|
97
|
+
|
98
|
+
it "#extra_cards" do
|
99
|
+
expect(board.extra_cards.count).to eq(1)
|
100
|
+
expect(board.extra_cards[0].name).to eq("(8) P6: Celebrate testing board")
|
101
|
+
end
|
102
|
+
|
103
|
+
it "#extra_done_cards" do
|
104
|
+
expect(board.extra_done_cards.count).to eq(0)
|
105
|
+
end
|
106
|
+
|
107
|
+
it "#unplanned_cards" do
|
108
|
+
expect(board.unplanned_cards.count).to eq(2)
|
109
|
+
expect(board.unplanned_cards[0].name).to eq("(2) Some unplanned work")
|
110
|
+
expect(board.unplanned_cards[1].name).to eq("(1) Fix emergency")
|
111
|
+
end
|
112
|
+
|
113
|
+
it "#unplanned_done_cards" do
|
114
|
+
expect(board.unplanned_done_cards.count).to eq(1)
|
115
|
+
expect(board.unplanned_done_cards[0].name).to eq("(2) Some unplanned work")
|
116
|
+
end
|
117
|
+
|
118
|
+
it "#done_fast_lane_cards_count" do
|
119
|
+
expect(board.done_fast_lane_cards_count).to eq(0)
|
120
|
+
end
|
121
|
+
|
122
|
+
it "#scrum_cards" do
|
123
|
+
expect(board.scrum_cards.count).to eq(4)
|
124
|
+
expect(board.scrum_cards[0].name).to eq("Burndown chart")
|
125
|
+
expect(board.scrum_cards[1].name).to eq("Sprint 10")
|
126
|
+
expect(board.scrum_cards[2].name).to eq("(3) P3: Fill Done columns")
|
127
|
+
expect(board.scrum_cards[3].name).to eq("(2) Some unplanned work")
|
128
|
+
end
|
129
|
+
end
|
130
|
+
|
131
|
+
context "full board with 'Accepted' column" do
|
132
|
+
let(:board) { ScrumBoard.new(JSON.parse(load_test_file("full-board-with-accepted.json")), dummy_settings) }
|
133
|
+
|
134
|
+
it "#done_cards" do
|
135
|
+
expect(board.done_cards.count).to eq(4)
|
136
|
+
expect(board.done_cards[0].name).to eq("Burndown chart")
|
137
|
+
expect(board.done_cards[1].name).to eq("Sprint 10")
|
138
|
+
expect(board.done_cards[2].name).to eq("(2) P7: Add Accepted column")
|
139
|
+
expect(board.done_cards[3].name).to eq("(3) P3: Fill Done columns")
|
140
|
+
end
|
141
|
+
|
142
|
+
it "#extra_cards" do
|
143
|
+
expect(board.extra_cards.count).to eq(1)
|
144
|
+
expect(board.extra_cards[0].name).to eq("(8) P6: Celebrate testing board")
|
145
|
+
end
|
146
|
+
|
147
|
+
it "#extra_done_cards" do
|
148
|
+
expect(board.extra_done_cards.count).to eq(0)
|
149
|
+
end
|
150
|
+
|
151
|
+
it "#unplanned_cards" do
|
152
|
+
expect(board.unplanned_cards.count).to eq(2)
|
153
|
+
expect(board.unplanned_cards[0].name).to eq("(2) Some unplanned work")
|
154
|
+
expect(board.unplanned_cards[1].name).to eq("(1) Fix emergency")
|
155
|
+
end
|
156
|
+
|
157
|
+
it "#unplanned_done_cards" do
|
158
|
+
expect(board.unplanned_done_cards.count).to eq(1)
|
159
|
+
expect(board.unplanned_done_cards[0].name).to eq("(2) Some unplanned work")
|
160
|
+
end
|
161
|
+
|
162
|
+
it "#done_fast_lane_cards_count" do
|
163
|
+
expect(board.done_fast_lane_cards_count).to eq(0)
|
164
|
+
end
|
165
|
+
|
166
|
+
it "#scrum_cards" do
|
167
|
+
expect(board.scrum_cards.count).to eq(5)
|
168
|
+
expect(board.scrum_cards[0].name).to eq("Burndown chart")
|
169
|
+
expect(board.scrum_cards[1].name).to eq("Sprint 10")
|
170
|
+
expect(board.scrum_cards[2].name).to eq("(2) Some unplanned work")
|
171
|
+
expect(board.scrum_cards[3].name).to eq("(2) P7: Add Accepted column")
|
172
|
+
expect(board.scrum_cards[4].name).to eq("(3) P3: Fill Done columns")
|
173
|
+
end
|
174
|
+
end
|
175
|
+
end
|
86
176
|
end
|
data/spec/unit/settings_spec.rb
CHANGED
@@ -3,25 +3,61 @@ require_relative 'spec_helper'
|
|
3
3
|
describe Settings do
|
4
4
|
|
5
5
|
include GivenFilesystemSpecHelpers
|
6
|
-
|
6
|
+
|
7
7
|
context "given config file" do
|
8
8
|
before(:each) do
|
9
9
|
@settings = Settings.new( File.expand_path('../../data/trollolorc',__FILE__) )
|
10
10
|
end
|
11
|
-
|
11
|
+
|
12
12
|
it "is not verbose by default" do
|
13
13
|
expect(@settings.verbose).to be false
|
14
14
|
end
|
15
|
-
|
15
|
+
|
16
16
|
it "reads config file" do
|
17
17
|
expect(@settings.developer_public_key).to eq "mykey"
|
18
18
|
expect(@settings.member_token).to eq "mytoken"
|
19
19
|
end
|
20
|
+
|
21
|
+
context "#scrum" do
|
22
|
+
context "when setting is missing" do
|
23
|
+
before do
|
24
|
+
@settings = Settings.new( File.expand_path('../../data/trollolorc_with_board_aliases',__FILE__) )
|
25
|
+
end
|
26
|
+
it "returns default settings" do
|
27
|
+
expect(@settings.scrum["board_names"]).to eq({"planning"=>"Planning Board", "sprint"=>"Sprint Board"})
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
context "when setting does exist" do
|
32
|
+
it "returns name" do
|
33
|
+
expect(@settings.scrum["board_names"]["sprint"]).to eq("Sprint Board")
|
34
|
+
expect(@settings.scrum.board_names["planning"]).to eq("Planning Board")
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
context "#board_aliases" do
|
40
|
+
context "when aliases do not exist" do
|
41
|
+
it "returns an empty Hash" do
|
42
|
+
expect(@settings.board_aliases).to eq({})
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
context "when mapping exists" do
|
47
|
+
before do
|
48
|
+
@settings = Settings.new( File.expand_path('../../data/trollolorc_with_board_aliases',__FILE__) )
|
49
|
+
end
|
50
|
+
|
51
|
+
it "returns the mapping" do
|
52
|
+
expect(@settings.board_aliases).to eq({"MyTrelloBoard" => "53186e8391ef8671265eba9d"})
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
20
56
|
end
|
21
|
-
|
57
|
+
|
22
58
|
context "non-existent config file" do
|
23
59
|
use_given_filesystem
|
24
|
-
|
60
|
+
|
25
61
|
before(:each) do
|
26
62
|
@config_file = given_dummy_file
|
27
63
|
@settings = Settings.new(@config_file)
|
@@ -31,7 +67,7 @@ describe Settings do
|
|
31
67
|
@settings.developer_public_key = "mypublickey"
|
32
68
|
@settings.member_token = "mymembertoken"
|
33
69
|
@settings.save_config
|
34
|
-
|
70
|
+
|
35
71
|
expect(File.read(@config_file)).to eq "---\ndeveloper_public_key: mypublickey\nmember_token: mymembertoken\n"
|
36
72
|
end
|
37
73
|
end
|
data/spec/unit/spec_helper.rb
CHANGED
@@ -1,9 +1,10 @@
|
|
1
|
-
require "
|
2
|
-
|
1
|
+
require "simplecov"
|
2
|
+
SimpleCov.start
|
3
3
|
require_relative '../../lib/trollolo'
|
4
4
|
require 'given_filesystem/spec_helpers'
|
5
5
|
require 'webmock/rspec'
|
6
6
|
require 'byebug'
|
7
|
+
require 'pry'
|
7
8
|
WebMock.disable_net_connect!(:allow => "codeclimate.com")
|
8
9
|
|
9
10
|
bin_path = File.expand_path( "../../../bin/", __FILE__ )
|
@@ -13,7 +13,9 @@ def scrub_file(file)
|
|
13
13
|
json = JSON.parse(File.read(file))
|
14
14
|
if json.is_a?(Hash) and json.has_key?("cards")
|
15
15
|
json["cards"].each do |card|
|
16
|
-
card
|
16
|
+
if card.has_key?("email")
|
17
|
+
card["email"] = "trello@example.com"
|
18
|
+
end
|
17
19
|
end
|
18
20
|
end
|
19
21
|
File.open(file, "w") do |f|
|
data/spec/unit/support/vcr.rb
CHANGED
@@ -4,26 +4,26 @@ VCR.configure do |config|
|
|
4
4
|
config.hook_into :webmock
|
5
5
|
end
|
6
6
|
|
7
|
-
# example needs to use real_settings if
|
7
|
+
# example needs to use real_settings if vcr_record: true is used
|
8
8
|
def real_settings
|
9
9
|
config_path = ENV["TROLLOLO_CONFIG_PATH"] || File.expand_path("~/.trollolorc")
|
10
10
|
Settings.new(config_path)
|
11
11
|
end
|
12
12
|
|
13
|
-
def real_settings_needed?(example
|
14
|
-
example.metadata[:
|
13
|
+
def real_settings_needed?(example)
|
14
|
+
example.metadata[:vcr_record] && Trello.configuration.developer_public_key == 'mykey'
|
15
15
|
end
|
16
16
|
|
17
17
|
def cassette_path(cassette)
|
18
18
|
File.join(VCR.configuration.cassette_library_dir, cassette + '.yml')
|
19
19
|
end
|
20
20
|
|
21
|
-
def
|
22
|
-
example.metadata[:
|
21
|
+
def vcr_record?(example)
|
22
|
+
example.metadata[:vcr_record]
|
23
23
|
end
|
24
24
|
|
25
25
|
def vcr_record_mode(example)
|
26
|
-
return :all if
|
26
|
+
return :all if vcr_record?(example)
|
27
27
|
:none
|
28
28
|
end
|
29
29
|
|
@@ -40,11 +40,11 @@ end
|
|
40
40
|
RSpec.configure do |c|
|
41
41
|
c.around do |example|
|
42
42
|
if cassette = example.metadata[:vcr]
|
43
|
-
fail "you need to use real_settings to re-record vcr data" if real_settings_needed?(example
|
43
|
+
fail "you need to use real_settings to re-record vcr data" if real_settings_needed?(example)
|
44
44
|
VCR.use_cassette(cassette, record: vcr_record_mode(example)) do
|
45
45
|
example.run
|
46
46
|
end
|
47
|
-
vcr_replace_tokens(cassette_path(cassette)) if
|
47
|
+
vcr_replace_tokens(cassette_path(cassette)) if vcr_record?(example)
|
48
48
|
else
|
49
49
|
example.run
|
50
50
|
end
|
@@ -19,6 +19,15 @@ def webmock_mapping
|
|
19
19
|
"card_checklists" => "all"
|
20
20
|
},
|
21
21
|
file: 'full-board.json'
|
22
|
+
},
|
23
|
+
{
|
24
|
+
path: 'boards/P4kJA4bE',
|
25
|
+
parameters: {
|
26
|
+
"cards" => "open",
|
27
|
+
"lists" => "open",
|
28
|
+
"card_checklists" => "all"
|
29
|
+
},
|
30
|
+
file: 'full-board-with-accepted.json'
|
22
31
|
}
|
23
32
|
]
|
24
33
|
end
|
@@ -47,6 +47,26 @@ describe TrelloWrapper do
|
|
47
47
|
end
|
48
48
|
end
|
49
49
|
|
50
|
+
describe '#backup' do
|
51
|
+
it 'raises an error for empty board id' do
|
52
|
+
expect { subject.backup("") }.to raise_error(TrolloloError)
|
53
|
+
end
|
54
|
+
|
55
|
+
it 'raises an error for nil board id' do
|
56
|
+
expect { subject.backup(nil) }.to raise_error(TrolloloError)
|
57
|
+
end
|
58
|
+
end
|
59
|
+
|
60
|
+
describe '#retrieve_board_data' do
|
61
|
+
it 'raises error when board id is empty' do
|
62
|
+
expect { subject.retrieve_board_data('') }.to raise_error(TrolloloError)
|
63
|
+
end
|
64
|
+
|
65
|
+
it 'raises error when board id is nil' do
|
66
|
+
expect { subject.retrieve_board_data(nil) }.to raise_error(TrolloloError)
|
67
|
+
end
|
68
|
+
end
|
69
|
+
|
50
70
|
describe '#add_attachment' do
|
51
71
|
use_given_filesystem
|
52
72
|
|
data/trollolo.gemspec
CHANGED
@@ -17,7 +17,8 @@ Gem::Specification.new do |s|
|
|
17
17
|
s.rubyforge_project = 'trollolo'
|
18
18
|
|
19
19
|
s.add_dependency 'thor', '~> 0.19'
|
20
|
-
s.add_dependency 'ruby-trello', '~> 1.
|
20
|
+
s.add_dependency 'ruby-trello', '~> 1.5.0'
|
21
|
+
s.add_dependency 'activesupport', '~> 4'
|
21
22
|
|
22
23
|
s.files = `git ls-files`.split("\n")
|
23
24
|
s.executables = `git ls-files`.split("\n").map{|f| f =~ /^bin\/(.*)/ ? $1 : nil}.compact
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: trollolo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Cornelius Schumacher
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-05-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|
@@ -30,14 +30,28 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version:
|
33
|
+
version: 1.5.0
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version:
|
40
|
+
version: 1.5.0
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: activesupport
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '4'
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '4'
|
41
55
|
description: Trollolo is a command line tool to access Trello and support tasks like
|
42
56
|
generation of burndown charts.
|
43
57
|
email:
|
@@ -66,10 +80,20 @@ files:
|
|
66
80
|
- lib/checklist.rb
|
67
81
|
- lib/cli.rb
|
68
82
|
- lib/column.rb
|
69
|
-
- lib/
|
83
|
+
- lib/empty_column.rb
|
84
|
+
- lib/scrum.rb
|
85
|
+
- lib/scrum/backlog_mover.rb
|
86
|
+
- lib/scrum/card_type_detection.rb
|
87
|
+
- lib/scrum/creator.rb
|
88
|
+
- lib/scrum/prioritizer.rb
|
89
|
+
- lib/scrum/priority_name.rb
|
90
|
+
- lib/scrum/scrum_boards.rb
|
91
|
+
- lib/scrum/sprint_board.rb
|
92
|
+
- lib/scrum/sprint_cleaner.rb
|
93
|
+
- lib/scrum/sprint_planning_board.rb
|
70
94
|
- lib/scrum_board.rb
|
71
95
|
- lib/settings.rb
|
72
|
-
- lib/
|
96
|
+
- lib/trello_service.rb
|
73
97
|
- lib/trello_wrapper.rb
|
74
98
|
- lib/trollolo.rb
|
75
99
|
- lib/version.rb
|
@@ -107,10 +131,22 @@ files:
|
|
107
131
|
- spec/data/create_burndown_helper/burndown-data-35.yaml
|
108
132
|
- spec/data/create_burndown_helper/burndown-data-42.yaml
|
109
133
|
- spec/data/create_burndown_helper/burndown-data-56.yaml
|
134
|
+
- spec/data/full-board-with-accepted.json
|
110
135
|
- spec/data/full-board.json
|
111
136
|
- spec/data/lists.json
|
112
137
|
- spec/data/trollolorc
|
138
|
+
- spec/data/trollolorc_with_board_aliases
|
139
|
+
- spec/data/vcr/creator_custom_config.yml
|
140
|
+
- spec/data/vcr/creator_default_config.yml
|
141
|
+
- spec/data/vcr/move_backlog.yml
|
142
|
+
- spec/data/vcr/move_backlog_missing_backlog.yml
|
143
|
+
- spec/data/vcr/move_backlog_missing_waterbed.yml
|
144
|
+
- spec/data/vcr/prioritize_backlog_list.yml
|
145
|
+
- spec/data/vcr/prioritize_no_backlog_list.yml
|
146
|
+
- spec/data/vcr/sprint_board.yml
|
147
|
+
- spec/data/vcr/sprint_board_no_waterline.yml
|
113
148
|
- spec/data/vcr/sprint_cleanup.yml
|
149
|
+
- spec/data/vcr/sprint_planning_board.yml
|
114
150
|
- spec/integration/command_line_spec.rb
|
115
151
|
- spec/integration/create_burndown_spec.rb
|
116
152
|
- spec/integration/integration_spec_helper.rb
|
@@ -123,12 +159,19 @@ files:
|
|
123
159
|
- spec/unit/burndown_data_spec.rb
|
124
160
|
- spec/unit/card_spec.rb
|
125
161
|
- spec/unit/cli_spec.rb
|
126
|
-
- spec/unit/
|
162
|
+
- spec/unit/empty_column_spec.rb
|
127
163
|
- spec/unit/retrieve_data_spec.rb
|
164
|
+
- spec/unit/scrum/backlog_mover_spec.rb
|
165
|
+
- spec/unit/scrum/card_type_detection_spec.rb
|
166
|
+
- spec/unit/scrum/creator_spec.rb
|
167
|
+
- spec/unit/scrum/prioritizer_spec.rb
|
168
|
+
- spec/unit/scrum/priority_name_spec.rb
|
169
|
+
- spec/unit/scrum/sprint_board_spec.rb
|
170
|
+
- spec/unit/scrum/sprint_cleaner_spec.rb
|
171
|
+
- spec/unit/scrum/sprint_planning_board_spec.rb
|
128
172
|
- spec/unit/scrum_board_spec.rb
|
129
173
|
- spec/unit/settings_spec.rb
|
130
174
|
- spec/unit/spec_helper.rb
|
131
|
-
- spec/unit/sprint_cleanup_spec.rb
|
132
175
|
- spec/unit/support/test_data_operations.rb
|
133
176
|
- spec/unit/support/update_webmock_data
|
134
177
|
- spec/unit/support/vcr.rb
|
@@ -156,7 +199,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
156
199
|
version: 1.3.6
|
157
200
|
requirements: []
|
158
201
|
rubyforge_project: trollolo
|
159
|
-
rubygems_version: 2.
|
202
|
+
rubygems_version: 2.5.1
|
160
203
|
signing_key:
|
161
204
|
specification_version: 4
|
162
205
|
summary: Trello command line client
|
data/lib/prioritizer.rb
DELETED
@@ -1,34 +0,0 @@
|
|
1
|
-
class Prioritizer
|
2
|
-
|
3
|
-
def initialize(settings)
|
4
|
-
@settings = settings
|
5
|
-
end
|
6
|
-
|
7
|
-
def prioritize(board_id, list_name)
|
8
|
-
list = find_list(board_id, list_name)
|
9
|
-
fail "list not found on board" unless list
|
10
|
-
update_priorities(list)
|
11
|
-
end
|
12
|
-
|
13
|
-
private
|
14
|
-
|
15
|
-
def trello
|
16
|
-
@trello ||= TrelloWrapper.new(@settings)
|
17
|
-
end
|
18
|
-
|
19
|
-
def update_priorities(list)
|
20
|
-
n = 1
|
21
|
-
list.cards.each do |card|
|
22
|
-
next if card.name =~ /waterline/i
|
23
|
-
card.priority = n
|
24
|
-
trello.set_name(card.id, card.name)
|
25
|
-
puts %(set priority to #{n} for "#{card.name}")
|
26
|
-
n += 1
|
27
|
-
end
|
28
|
-
end
|
29
|
-
|
30
|
-
def find_list(board_id, list_name)
|
31
|
-
board = trello.board(board_id)
|
32
|
-
board.columns.find { |list| list.name == list_name }
|
33
|
-
end
|
34
|
-
end
|
data/lib/sprint_cleanup.rb
DELETED
@@ -1,54 +0,0 @@
|
|
1
|
-
class SprintCleanup
|
2
|
-
SOURCE_LISTS = ["Sprint Backlog", "Doing"]
|
3
|
-
TARGET_LIST = "Ready"
|
4
|
-
|
5
|
-
def initialize(settings)
|
6
|
-
@settings = settings
|
7
|
-
init_trello
|
8
|
-
end
|
9
|
-
|
10
|
-
def cleanup(board_id, target_board_id)
|
11
|
-
@board = Trello::Board.find(board_id)
|
12
|
-
@target_board = Trello::Board.find(target_board_id)
|
13
|
-
|
14
|
-
SOURCE_LISTS.each do |list_name|
|
15
|
-
move_cards(@board.lists.find { |l| l.name == list_name })
|
16
|
-
end
|
17
|
-
end
|
18
|
-
|
19
|
-
private
|
20
|
-
|
21
|
-
def init_trello
|
22
|
-
Trello.configure do |config|
|
23
|
-
config.developer_public_key = @settings.developer_public_key
|
24
|
-
config.member_token = @settings.member_token
|
25
|
-
end
|
26
|
-
end
|
27
|
-
|
28
|
-
def target_list
|
29
|
-
@target_list ||= @target_board.lists.find { |l| l.name == TARGET_LIST }
|
30
|
-
end
|
31
|
-
|
32
|
-
def sticky?(card)
|
33
|
-
card.labels.any? { |l| l.name == "Sticky" }
|
34
|
-
end
|
35
|
-
|
36
|
-
def waterline_label(card)
|
37
|
-
card.labels.find { |label| label.name =~ /waterline/i }
|
38
|
-
end
|
39
|
-
|
40
|
-
def remove_waterline_label(card)
|
41
|
-
label = waterline_label(card)
|
42
|
-
card.remove_label(label) if label
|
43
|
-
end
|
44
|
-
|
45
|
-
def move_cards(source_list)
|
46
|
-
source_list.cards.each do |card|
|
47
|
-
next if sticky?(card)
|
48
|
-
puts %(moving card "#{card.name}" to list "#{target_list.name}")
|
49
|
-
card.members.each { |member| card.remove_member(member) }
|
50
|
-
remove_waterline_label(card)
|
51
|
-
card.move_to_board(@target_board, target_list)
|
52
|
-
end
|
53
|
-
end
|
54
|
-
end
|
@@ -1,47 +0,0 @@
|
|
1
|
-
require_relative "spec_helper"
|
2
|
-
require 'pry'
|
3
|
-
|
4
|
-
describe Prioritizer do
|
5
|
-
it "creates new prioritizer" do
|
6
|
-
prioritizer = Prioritizer.new(dummy_settings)
|
7
|
-
expect(prioritizer).to be
|
8
|
-
end
|
9
|
-
|
10
|
-
context "default" do
|
11
|
-
subject { described_class.new(dummy_settings) }
|
12
|
-
|
13
|
-
before(:each) do
|
14
|
-
full_board_mock
|
15
|
-
end
|
16
|
-
|
17
|
-
it "raises an exception if list is not on board" do
|
18
|
-
expect {
|
19
|
-
subject.prioritize("53186e8391ef8671265eba9d", "Backlog")
|
20
|
-
}.to raise_error("list not found on board")
|
21
|
-
end
|
22
|
-
|
23
|
-
it "raises an exception if list is not on board" do
|
24
|
-
RSpec::Expectations.configuration.on_potential_false_positives = :nothing
|
25
|
-
expect {
|
26
|
-
subject.prioritize("53186e8391ef8671265eba9d", "Sprint Backlog")
|
27
|
-
}.not_to raise_error("list not found on board")
|
28
|
-
end
|
29
|
-
|
30
|
-
it "adds priority text to card titles" do
|
31
|
-
[
|
32
|
-
"5319bf244cc53afd5afd991f/name?key=mykey&token=mytoken&value=P1:%20Sprint%203",
|
33
|
-
"5319c16d9d04708d450d65f1/name?key=mykey&token=mytoken&value=(3)%20P2:%20Fill%20Backlog%20column",
|
34
|
-
"5319c57ff6be845f428aa7a3/name?key=mykey&token=mytoken&value=(5)%20P3:%20Read%20data%20from%20Trollolo",
|
35
|
-
"5319c5961e530fd26f83999d/name?key=mykey&token=mytoken&value=(3)%20P4:%20Save%20read%20data%20as%20reference%20data",
|
36
|
-
"5319c5a8743488047e13fcbc/name?key=mykey&token=mytoken&value=(8)%20P5:%20Celebrate%20testing%20board",
|
37
|
-
].each { |value|
|
38
|
-
stub_request(:put, "https://api.trello.com/1/cards/#{value}")
|
39
|
-
}
|
40
|
-
|
41
|
-
expect(STDOUT).to receive(:puts).exactly(5).times
|
42
|
-
expect {
|
43
|
-
subject.prioritize("53186e8391ef8671265eba9d", "Sprint Backlog")
|
44
|
-
}.not_to raise_error
|
45
|
-
end
|
46
|
-
end
|
47
|
-
end
|
@@ -1,18 +0,0 @@
|
|
1
|
-
require_relative "spec_helper"
|
2
|
-
require 'pry'
|
3
|
-
|
4
|
-
describe SprintCleanup do
|
5
|
-
it "creates new sprint cleanup" do
|
6
|
-
sprint_cleanup = SprintCleanup.new(dummy_settings)
|
7
|
-
expect(sprint_cleanup).to be
|
8
|
-
end
|
9
|
-
|
10
|
-
context "default" do
|
11
|
-
subject { described_class.new(dummy_settings) }
|
12
|
-
|
13
|
-
it "moves remaining cards to target board", vcr: "sprint_cleanup", vcr_rerecord: false do
|
14
|
-
expect(STDOUT).to receive(:puts).exactly(5).times
|
15
|
-
expect(subject.cleanup("GVMQz9dx", "neUHHzDo")).to be
|
16
|
-
end
|
17
|
-
end
|
18
|
-
end
|