pt 0.3.9 → 0.5
Sign up to get free protection for your applications and to get access to all the features.
- data/Changelog.md +4 -0
- data/README.md +18 -13
- data/lib/pt.rb +1 -1
- data/lib/pt/client.rb +4 -0
- data/lib/pt/switch_ssl.rb +6 -2
- data/lib/pt/ui.rb +324 -77
- metadata +35 -4
data/Changelog.md
CHANGED
data/README.md
CHANGED
@@ -12,31 +12,35 @@ The first time you run it, `pt` will ask you some data about your Pivotal Tracke
|
|
12
12
|
|
13
13
|
Run `pt` from the root folder of your project.
|
14
14
|
|
15
|
-
pt
|
15
|
+
pt # show all available tasks
|
16
16
|
|
17
|
-
|
17
|
+
pt create [title] ~[owner] ~[type] # create a new task
|
18
18
|
|
19
|
-
|
19
|
+
pt show [id] # shows detailed info about a task
|
20
20
|
|
21
|
-
pt
|
21
|
+
pt open [id] # open a task in the browser
|
22
22
|
|
23
|
-
pt
|
23
|
+
pt assign [id] [member] # assign owner
|
24
24
|
|
25
|
-
pt
|
25
|
+
pt comment [id] [comment] # add a comment
|
26
26
|
|
27
|
-
pt
|
27
|
+
pt estimate [id] [0-3] # estimate a task in points scale
|
28
28
|
|
29
|
-
pt
|
29
|
+
pt start [id] # mark a task as started
|
30
30
|
|
31
|
-
pt
|
31
|
+
pt finish [id] # indicate you've finished a task
|
32
32
|
|
33
|
-
pt
|
33
|
+
pt deliver [id] # indicate the task is delivered
|
34
34
|
|
35
|
-
pt
|
35
|
+
pt accept [id] # mark a task as accepted
|
36
36
|
|
37
|
-
pt
|
37
|
+
pt reject [id] [reason] # mark a task as rejected, explaining why
|
38
38
|
|
39
|
-
pt
|
39
|
+
pt find [query] # search for a task by title and show it
|
40
|
+
|
41
|
+
pt done [id] ~[0-3] # lazy mans finish task, does everything
|
42
|
+
|
43
|
+
pt updates # show recent activity from your current project
|
40
44
|
|
41
45
|
## Problems?
|
42
46
|
|
@@ -44,6 +48,7 @@ You can [open a new issue](https://github.com/raul/pt/issues/new). It can be hel
|
|
44
48
|
|
45
49
|
# Contributors
|
46
50
|
|
51
|
+
[orta therox](http://orta.github.com)
|
47
52
|
[Anthony Crumley](https://github.com/craftycode)
|
48
53
|
[Johan Andersson](http://johan.andersson.net)
|
49
54
|
|
data/lib/pt.rb
CHANGED
data/lib/pt/client.rb
CHANGED
@@ -32,6 +32,10 @@ class PT::Client
|
|
32
32
|
def get_current_iteration(project)
|
33
33
|
PivotalTracker::Iteration.current(project)
|
34
34
|
end
|
35
|
+
|
36
|
+
def get_activities(project)
|
37
|
+
project.activities.all
|
38
|
+
end
|
35
39
|
|
36
40
|
def get_my_work(project, user_name)
|
37
41
|
project.stories.all :mywork => user_name
|
data/lib/pt/switch_ssl.rb
CHANGED
data/lib/pt/ui.rb
CHANGED
@@ -15,8 +15,8 @@ class PT::UI
|
|
15
15
|
@local_config = load_local_config
|
16
16
|
@project = @client.get_project(@local_config[:project_id])
|
17
17
|
command = args[0].to_sym rescue :my_work
|
18
|
-
params = args[1..-1]
|
19
|
-
commands.include?(command.to_sym) ? send(command.to_sym) : help
|
18
|
+
@params = args[1..-1]
|
19
|
+
commands.include?(command.to_sym) ? send(command.to_sym) : help
|
20
20
|
end
|
21
21
|
|
22
22
|
def my_work
|
@@ -25,18 +25,46 @@ class PT::UI
|
|
25
25
|
PT::TasksTable.new(stories).print
|
26
26
|
end
|
27
27
|
|
28
|
-
def
|
29
|
-
|
30
|
-
|
31
|
-
|
28
|
+
def list
|
29
|
+
if @params[0]
|
30
|
+
user = find_owner @params[0]
|
31
|
+
if user
|
32
|
+
stories = @client.get_my_work(@project, user.name)
|
33
|
+
PT::TasksTable.new(stories).print
|
34
|
+
end
|
35
|
+
else
|
32
36
|
members = @client.get_members(@project)
|
33
37
|
table = PT::MembersTable.new(members)
|
34
|
-
|
38
|
+
user = select("Please select a member to see his tasks", table).name
|
39
|
+
title("Work for #{user} in #{project_to_s}")
|
40
|
+
stories = @client.get_my_work(@project, user)
|
41
|
+
PT::TasksTable.new(stories).print
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
def create
|
46
|
+
if @params[0]
|
47
|
+
name = @params[0]
|
48
|
+
owner = find_owner @params[1]
|
49
|
+
requester = @local_config[:user_name]
|
50
|
+
task_type = @params[2] || 'feature'
|
35
51
|
else
|
36
|
-
|
52
|
+
title("Let's create a new task:")
|
53
|
+
name = ask("Name for the new task:")
|
54
|
+
end
|
55
|
+
|
56
|
+
unless owner
|
57
|
+
if ask('Do you want to assign it now? (y/n)').downcase == 'y'
|
58
|
+
members = @client.get_members(@project)
|
59
|
+
table = PT::MembersTable.new(members)
|
60
|
+
owner = select("Please select a member to assign him the task", table).name
|
61
|
+
else
|
62
|
+
owner = nil
|
63
|
+
end
|
64
|
+
requester = @local_config[:user_name]
|
65
|
+
task_type = ask('Type? (c)hore, (b)ug, anything else for feature)')
|
37
66
|
end
|
38
|
-
|
39
|
-
task_type = ask('Type? (c)hore, (b)ug, anything else for feature)')
|
67
|
+
|
40
68
|
task_type = case task_type
|
41
69
|
when 'c', 'chore'
|
42
70
|
'chore'
|
@@ -45,7 +73,7 @@ class PT::UI
|
|
45
73
|
else
|
46
74
|
'feature'
|
47
75
|
end
|
48
|
-
result = @client.create_task(@project, name, owner, requester, task_type)
|
76
|
+
result = @client.create_task(@project, name, owner.name, requester, task_type)
|
49
77
|
if result.errors.any?
|
50
78
|
error(result.errors.errors)
|
51
79
|
else
|
@@ -54,19 +82,32 @@ class PT::UI
|
|
54
82
|
end
|
55
83
|
|
56
84
|
def open
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
85
|
+
if @params[0]
|
86
|
+
tasks = @client.get_my_work(@project, @local_config[:user_name])
|
87
|
+
table = PT::TasksTable.new(tasks)
|
88
|
+
task = table[ @params[0].to_i ]
|
89
|
+
congrats("Opening #{task.name}")
|
90
|
+
else
|
91
|
+
tasks = @client.get_my_open_tasks(@project, @local_config[:user_name])
|
92
|
+
table = PT::TasksTable.new(tasks)
|
93
|
+
title("Tasks for #{user_s} in #{project_to_s}")
|
94
|
+
task = select("Please select a story to open it in the browser", table)
|
95
|
+
end
|
61
96
|
`open #{task.url}`
|
62
97
|
end
|
63
98
|
|
64
99
|
def comment
|
65
|
-
title("Tasks for #{user_s} in #{project_to_s}")
|
66
100
|
tasks = @client.get_my_work(@project, @local_config[:user_name])
|
67
101
|
table = PT::TasksTable.new(tasks)
|
68
|
-
|
69
|
-
|
102
|
+
if @params[0]
|
103
|
+
task = table[ @params[0].to_i ]
|
104
|
+
comment = @params[1]
|
105
|
+
title("Adding a comment to #{task.name}")
|
106
|
+
else
|
107
|
+
title("Tasks for #{user_s} in #{project_to_s}")
|
108
|
+
task = select("Please select a story to comment it", table)
|
109
|
+
comment = ask("Write your comment")
|
110
|
+
end
|
70
111
|
if @client.comment_task(@project, task, comment)
|
71
112
|
congrats("Comment sent, thanks!")
|
72
113
|
else
|
@@ -75,28 +116,46 @@ class PT::UI
|
|
75
116
|
end
|
76
117
|
|
77
118
|
def assign
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
119
|
+
if @params[0]
|
120
|
+
tasks = @client.get_my_work(@project, @local_config[:user_name])
|
121
|
+
table = PT::TasksTable.new(tasks)
|
122
|
+
task = table[@params[0].to_i]
|
123
|
+
owner = find_owner @params[1]
|
124
|
+
else
|
125
|
+
title("Tasks for #{user_s} in #{project_to_s}")
|
126
|
+
tasks = @client.get_tasks_to_assign(@project, @local_config[:user_name])
|
127
|
+
table = PT::TasksTable.new(tasks)
|
128
|
+
task = select("Please select a task to assign it an owner", table)
|
129
|
+
members = @client.get_members(@project)
|
130
|
+
table = PT::MembersTable.new(members)
|
131
|
+
owner = select("Please select a member to assign him the task", table).name
|
132
|
+
end
|
133
|
+
result = @client.assign_task(@project, task, owner.name)
|
86
134
|
if result.errors.any?
|
87
135
|
error(result.errors.errors)
|
88
136
|
else
|
89
|
-
congrats("Task assigned, thanks!")
|
137
|
+
congrats("Task assigned to #{owner}, thanks!")
|
90
138
|
end
|
91
|
-
|
92
139
|
end
|
93
140
|
|
94
141
|
def estimate
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
142
|
+
if @params[0]
|
143
|
+
tasks = @client.get_my_work(@project, @local_config[:user_name])
|
144
|
+
table = PT::TasksTable.new(tasks)
|
145
|
+
task = table[@params[0].to_i]
|
146
|
+
title("Estimating '#{task.name}'")
|
147
|
+
|
148
|
+
if [0,1,2,3].include? @params[1].to_i
|
149
|
+
estimation = @params[1]
|
150
|
+
end
|
151
|
+
else
|
152
|
+
tasks = @client.get_my_tasks_to_estimate(@project, @local_config[:user_name])
|
153
|
+
table = PT::TasksTable.new(tasks)
|
154
|
+
title("Tasks for #{user_s} in #{project_to_s}")
|
155
|
+
task = select("Please select a story to estimate it", table)
|
156
|
+
end
|
157
|
+
|
158
|
+
estimation ||= ask("How many points you estimate for it? (#{@project.point_scale})")
|
100
159
|
result = @client.estimate_task(@project, task, estimation)
|
101
160
|
if result.errors.any?
|
102
161
|
error(result.errors.errors)
|
@@ -105,55 +164,64 @@ class PT::UI
|
|
105
164
|
end
|
106
165
|
end
|
107
166
|
|
108
|
-
def start
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
if result.errors.any?
|
115
|
-
error(result.errors.errors)
|
167
|
+
def start
|
168
|
+
if @params[0]
|
169
|
+
tasks = @client.get_my_work(@project, @local_config[:user_name])
|
170
|
+
table = PT::TasksTable.new(tasks)
|
171
|
+
task = table[@params[0].to_i]
|
172
|
+
title("Starting '#{task.name}'")
|
116
173
|
else
|
117
|
-
|
174
|
+
tasks = @client.get_my_tasks_to_start(@project, @local_config[:user_name])
|
175
|
+
table = PT::TasksTable.new(tasks)
|
176
|
+
title("Tasks for #{user_s} in #{project_to_s}")
|
177
|
+
task = select("Please select a story to mark it as started", table)
|
118
178
|
end
|
179
|
+
start_task task
|
119
180
|
end
|
120
181
|
|
121
182
|
def finish
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
result = @client.mark_task_as(@project, task, 'accepted')
|
128
|
-
else
|
129
|
-
result = @client.mark_task_as(@project, task, 'finished')
|
130
|
-
end
|
131
|
-
if result.errors.any?
|
132
|
-
error(result.errors.errors)
|
183
|
+
if @params[0]
|
184
|
+
tasks = @client.get_my_work(@project, @local_config[:user_name])
|
185
|
+
table = PT::TasksTable.new(tasks)
|
186
|
+
task = table[@params[0].to_i]
|
187
|
+
title("Finishing '#{task.name}'")
|
133
188
|
else
|
134
|
-
|
189
|
+
tasks = @client.get_my_tasks_to_finish(@project, @local_config[:user_name])
|
190
|
+
table = PT::TasksTable.new(tasks)
|
191
|
+
title("Tasks for #{user_s} in #{project_to_s}")
|
192
|
+
task = select("Please select a story to mark it as finished", table)
|
135
193
|
end
|
194
|
+
finish_task task
|
136
195
|
end
|
137
196
|
|
138
197
|
def deliver
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
error(result.errors.errors) if result.errors.any?
|
145
|
-
if result.errors.any?
|
146
|
-
error(result.errors.errors)
|
198
|
+
if @params[0]
|
199
|
+
tasks = @client.get_my_work(@project, @local_config[:user_name])
|
200
|
+
table = PT::TasksTable.new(tasks)
|
201
|
+
task = table[@params[0].to_i]
|
202
|
+
title("Delivering '#{task.name}'")
|
147
203
|
else
|
148
|
-
|
204
|
+
tasks = @client.get_my_tasks_to_deliver(@project, @local_config[:user_name])
|
205
|
+
table = PT::TasksTable.new(tasks)
|
206
|
+
title("Tasks for #{user_s} in #{project_to_s}")
|
207
|
+
task = select("Please select a story to mark it as delivered", table)
|
149
208
|
end
|
209
|
+
|
210
|
+
deliver_task task
|
150
211
|
end
|
151
212
|
|
152
213
|
def accept
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
214
|
+
if @params[0]
|
215
|
+
tasks = @client.get_my_work(@project, @local_config[:user_name])
|
216
|
+
table = PT::TasksTable.new(tasks)
|
217
|
+
task = table[@params[0].to_i]
|
218
|
+
title("Accepting '#{task.name}'")
|
219
|
+
else
|
220
|
+
tasks = @client.get_my_tasks_to_accept(@project, @local_config[:user_name])
|
221
|
+
table = PT::TasksTable.new(tasks)
|
222
|
+
title("Tasks for #{user_s} in #{project_to_s}")
|
223
|
+
task = select("Please select a story to mark it as accepted", table)
|
224
|
+
end
|
157
225
|
result = @client.mark_task_as(@project, task, 'accepted')
|
158
226
|
if result.errors.any?
|
159
227
|
error(result.errors.errors)
|
@@ -166,16 +234,35 @@ class PT::UI
|
|
166
234
|
title("Tasks for #{user_s} in #{project_to_s}")
|
167
235
|
tasks = @client.get_my_work(@project, @local_config[:user_name])
|
168
236
|
table = PT::TasksTable.new(tasks)
|
169
|
-
|
237
|
+
if @params[0]
|
238
|
+
task = table[@params[0].to_i]
|
239
|
+
else
|
240
|
+
task = select("Please select a story to show", table)
|
241
|
+
end
|
242
|
+
|
170
243
|
result = show_task(task)
|
171
244
|
end
|
172
245
|
|
173
246
|
def reject
|
174
247
|
title("Tasks for #{user_s} in #{project_to_s}")
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
248
|
+
if @params[0]
|
249
|
+
tasks = @client.get_my_work(@project, @local_config[:user_name])
|
250
|
+
table = PT::TasksTable.new(tasks)
|
251
|
+
task = table[@params[0].to_i]
|
252
|
+
title("Rejecting '#{task.name}'")
|
253
|
+
else
|
254
|
+
tasks = @client.get_my_tasks_to_reject(@project, @local_config[:user_name])
|
255
|
+
table = PT::TasksTable.new(tasks)
|
256
|
+
title("Tasks for #{user_s} in #{project_to_s}")
|
257
|
+
task = select("Please select a story to mark it as rejected", table)
|
258
|
+
end
|
259
|
+
|
260
|
+
if @params[1]
|
261
|
+
comment = @params[1]
|
262
|
+
else
|
263
|
+
comment = ask("Please explain why are you rejecting the task")
|
264
|
+
end
|
265
|
+
|
179
266
|
if @client.comment_task(@project, task, comment)
|
180
267
|
result = @client.mark_task_as(@project, task, 'rejected')
|
181
268
|
congrats("Task rejected, thanks!")
|
@@ -184,6 +271,130 @@ class PT::UI
|
|
184
271
|
end
|
185
272
|
end
|
186
273
|
|
274
|
+
def done
|
275
|
+
if @params[0]
|
276
|
+
tasks = @client.get_my_work(@project, @local_config[:user_name])
|
277
|
+
table = PT::TasksTable.new(tasks)
|
278
|
+
task = table[@params[0].to_i]
|
279
|
+
|
280
|
+
#we need this for finding again later
|
281
|
+
task_id = task.id
|
282
|
+
|
283
|
+
if !@params[1] && task.estimate == -1
|
284
|
+
error("You need to give an estimate for this task")
|
285
|
+
return
|
286
|
+
end
|
287
|
+
|
288
|
+
if @params[1] && task.estimate == -1
|
289
|
+
if [0,1,2,3].include? @params[1].to_i
|
290
|
+
estimate_task(task, @params[1].to_i)
|
291
|
+
end
|
292
|
+
end
|
293
|
+
|
294
|
+
task = find_my_task_by_task_id task_id
|
295
|
+
start_task task
|
296
|
+
|
297
|
+
task = find_my_task_by_task_id task_id
|
298
|
+
finish_task task
|
299
|
+
|
300
|
+
task = find_my_task_by_task_id task_id
|
301
|
+
deliver_task task
|
302
|
+
end
|
303
|
+
end
|
304
|
+
|
305
|
+
def estimate_task task, difficulty
|
306
|
+
result = @client.estimate_task(@project, task, difficulty)
|
307
|
+
if result.errors.any?
|
308
|
+
error(result.errors.errors)
|
309
|
+
else
|
310
|
+
congrats("Task estimated, thanks!")
|
311
|
+
end
|
312
|
+
end
|
313
|
+
|
314
|
+
def start_task task
|
315
|
+
result = @client.mark_task_as(@project, task, 'started')
|
316
|
+
if result.errors.any?
|
317
|
+
error(result.errors.errors)
|
318
|
+
else
|
319
|
+
congrats("Task started, go for it!")
|
320
|
+
end
|
321
|
+
end
|
322
|
+
|
323
|
+
def finish_task task
|
324
|
+
if task.story_type == 'chore'
|
325
|
+
result = @client.mark_task_as(@project, task, 'accepted')
|
326
|
+
else
|
327
|
+
result = @client.mark_task_as(@project, task, 'finished')
|
328
|
+
end
|
329
|
+
if result.errors.any?
|
330
|
+
error(result.errors.errors)
|
331
|
+
else
|
332
|
+
congrats("Another task bites the dust, yeah!")
|
333
|
+
end
|
334
|
+
end
|
335
|
+
|
336
|
+
def deliver_task task
|
337
|
+
return if task.story_type == 'chore'
|
338
|
+
|
339
|
+
result = @client.mark_task_as(@project, task, 'delivered')
|
340
|
+
error(result.errors.errors) if result.errors.any?
|
341
|
+
if result.errors.any?
|
342
|
+
error(result.errors.errors)
|
343
|
+
else
|
344
|
+
congrats("Task delivered, congrats!")
|
345
|
+
end
|
346
|
+
end
|
347
|
+
|
348
|
+
def find
|
349
|
+
tasks = @client.get_my_work(@project, @local_config[:user_name])
|
350
|
+
if @params[0]
|
351
|
+
tasks.each do | task |
|
352
|
+
if (task.name.downcase.index @params[0]) && (task.current_state != 'delivered')
|
353
|
+
title("--- [#{(tasks.index task) + 1 }] -----------------")
|
354
|
+
show_task(task)
|
355
|
+
end
|
356
|
+
end
|
357
|
+
else
|
358
|
+
message("You need to provide a substring for a tasks title.")
|
359
|
+
end
|
360
|
+
end
|
361
|
+
|
362
|
+
def updates
|
363
|
+
activities = @client.get_activities(@project)
|
364
|
+
tasks = @client.get_my_work(@project, @local_config[:user_name])
|
365
|
+
title("Recent Activity on #{project_to_s}")
|
366
|
+
activities.each do |activity|
|
367
|
+
show_activity(activity, tasks)
|
368
|
+
end
|
369
|
+
end
|
370
|
+
|
371
|
+
|
372
|
+
def help
|
373
|
+
if ARGV[0]
|
374
|
+
message("Command #{ARGV[0]} not recognized. Showing help.")
|
375
|
+
end
|
376
|
+
|
377
|
+
title("Command line usage")
|
378
|
+
message("pt # show all available tasks")
|
379
|
+
message("pt create [title] ~[owner] ~[type] # create a new task")
|
380
|
+
message("pt show [id] # shows detailed info about a task")
|
381
|
+
message("pt open [id] # open a task in the browser")
|
382
|
+
message("pt assign [id] [member] # assign owner")
|
383
|
+
message("pt comment [id] [comment] # add a comment")
|
384
|
+
message("pt estimate [id] [0-3] # estimate a task in points scale")
|
385
|
+
message("pt start [id] # mark a task as started")
|
386
|
+
message("pt finish [id] # indicate you've finished a task")
|
387
|
+
message("pt deliver [id] # indicate the task is delivered");
|
388
|
+
message("pt accept [id] # mark a task as accepted")
|
389
|
+
message("pt reject [id] [reason] # mark a task as rejected, explaining why")
|
390
|
+
message("pt find [query] # looks in your tasks by title and presents it")
|
391
|
+
message("pt done [id] ~[0-3] # lazy mans finish task, does everything")
|
392
|
+
message("pt list [member] # list all tasks for another pt user")
|
393
|
+
message("pt updates # show recent activity from your current project")
|
394
|
+
message("")
|
395
|
+
message("All commands can be ran without arguments for a wizard like UI.")
|
396
|
+
end
|
397
|
+
|
187
398
|
protected
|
188
399
|
|
189
400
|
def commands
|
@@ -295,10 +506,6 @@ class PT::UI
|
|
295
506
|
@io.ask("#{msg.bold}"){ |q| q.echo = '*' }
|
296
507
|
end
|
297
508
|
|
298
|
-
def help(command)
|
299
|
-
error "Command <#{command}> unknown.", "Available commands:" + commands.map{ |c| "\n- #{c}" }.join
|
300
|
-
end
|
301
|
-
|
302
509
|
def user_s
|
303
510
|
"#{@local_config[:user_name]} (#{@local_config[:user_initials]})"
|
304
511
|
end
|
@@ -306,7 +513,36 @@ class PT::UI
|
|
306
513
|
def project_to_s
|
307
514
|
"Project #{@local_config[:project_name].upcase}"
|
308
515
|
end
|
516
|
+
|
517
|
+
def find_task query
|
518
|
+
members = @client.get_members(@project)
|
519
|
+
members.each do | member |
|
520
|
+
if member.name.downcase.index query
|
521
|
+
return member.name
|
522
|
+
end
|
523
|
+
end
|
524
|
+
nil
|
525
|
+
end
|
526
|
+
|
527
|
+
def find_my_task_by_task_id task_id
|
528
|
+
tasks = @client.get_my_work(@project, @local_config[:user_name])
|
529
|
+
tasks.each do |task|
|
530
|
+
if task.id == task_id
|
531
|
+
return task
|
532
|
+
end
|
533
|
+
end
|
534
|
+
end
|
309
535
|
|
536
|
+
def find_owner query
|
537
|
+
members = @client.get_members(@project)
|
538
|
+
members.each do | member |
|
539
|
+
if member.name.downcase.index query
|
540
|
+
return member
|
541
|
+
end
|
542
|
+
end
|
543
|
+
nil
|
544
|
+
end
|
545
|
+
|
310
546
|
def show_task(task)
|
311
547
|
title task.name
|
312
548
|
estimation = [-1, nil].include?(task.estimate) ? "Unestimated" : "#{task.estimate} points"
|
@@ -316,5 +552,16 @@ class PT::UI
|
|
316
552
|
task.notes.all.each{ |n| message "#{n.author}: \"#{n.text}\"" }
|
317
553
|
task.attachments.each{ |a| message "#{a.uploaded_by} uploaded: \"#{a.description.empty? ? "#{a.filename}" : "#{a.description} (#{a.filename})" }\" #{a.url}" }
|
318
554
|
end
|
319
|
-
|
555
|
+
|
556
|
+
def show_activity(activity, tasks)
|
557
|
+
story_id = activity.stories.first.id
|
558
|
+
task_id = nil
|
559
|
+
tasks.each do |story|
|
560
|
+
if story_id == story.id
|
561
|
+
task_id = tasks.index(story)
|
562
|
+
end
|
563
|
+
end
|
564
|
+
message("#{activity.description} [#{task_id}]")
|
565
|
+
end
|
566
|
+
|
320
567
|
end
|
metadata
CHANGED
@@ -1,8 +1,12 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pt
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
+
hash: 1
|
4
5
|
prerelease:
|
5
|
-
|
6
|
+
segments:
|
7
|
+
- 0
|
8
|
+
- 5
|
9
|
+
version: "0.5"
|
6
10
|
platform: ruby
|
7
11
|
authors:
|
8
12
|
- Raul Murciano
|
@@ -10,7 +14,8 @@ autorequire:
|
|
10
14
|
bindir: bin
|
11
15
|
cert_chain: []
|
12
16
|
|
13
|
-
date: 2011-
|
17
|
+
date: 2011-12-25 00:00:00 +01:00
|
18
|
+
default_executable:
|
14
19
|
dependencies:
|
15
20
|
- !ruby/object:Gem::Dependency
|
16
21
|
name: pivotal-tracker
|
@@ -20,7 +25,12 @@ dependencies:
|
|
20
25
|
requirements:
|
21
26
|
- - ">="
|
22
27
|
- !ruby/object:Gem::Version
|
23
|
-
|
28
|
+
hash: 13
|
29
|
+
segments:
|
30
|
+
- 0
|
31
|
+
- 4
|
32
|
+
- 1
|
33
|
+
version: 0.4.1
|
24
34
|
type: :runtime
|
25
35
|
version_requirements: *id001
|
26
36
|
- !ruby/object:Gem::Dependency
|
@@ -31,6 +41,11 @@ dependencies:
|
|
31
41
|
requirements:
|
32
42
|
- - ">="
|
33
43
|
- !ruby/object:Gem::Version
|
44
|
+
hash: 5
|
45
|
+
segments:
|
46
|
+
- 0
|
47
|
+
- 4
|
48
|
+
- 5
|
34
49
|
version: 0.4.5
|
35
50
|
type: :runtime
|
36
51
|
version_requirements: *id002
|
@@ -42,6 +57,10 @@ dependencies:
|
|
42
57
|
requirements:
|
43
58
|
- - ">="
|
44
59
|
- !ruby/object:Gem::Version
|
60
|
+
hash: 11
|
61
|
+
segments:
|
62
|
+
- 1
|
63
|
+
- 2
|
45
64
|
version: "1.2"
|
46
65
|
type: :runtime
|
47
66
|
version_requirements: *id003
|
@@ -53,6 +72,11 @@ dependencies:
|
|
53
72
|
requirements:
|
54
73
|
- - ">="
|
55
74
|
- !ruby/object:Gem::Version
|
75
|
+
hash: 13
|
76
|
+
segments:
|
77
|
+
- 1
|
78
|
+
- 6
|
79
|
+
- 1
|
56
80
|
version: 1.6.1
|
57
81
|
type: :runtime
|
58
82
|
version_requirements: *id004
|
@@ -78,6 +102,7 @@ files:
|
|
78
102
|
- LICENSE
|
79
103
|
- README.md
|
80
104
|
- bin/pt
|
105
|
+
has_rdoc: true
|
81
106
|
homepage: http://www.github.com/raul/pt
|
82
107
|
licenses: []
|
83
108
|
|
@@ -91,17 +116,23 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
91
116
|
requirements:
|
92
117
|
- - ">="
|
93
118
|
- !ruby/object:Gem::Version
|
119
|
+
hash: 3
|
120
|
+
segments:
|
121
|
+
- 0
|
94
122
|
version: "0"
|
95
123
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
96
124
|
none: false
|
97
125
|
requirements:
|
98
126
|
- - ">="
|
99
127
|
- !ruby/object:Gem::Version
|
128
|
+
hash: 3
|
129
|
+
segments:
|
130
|
+
- 0
|
100
131
|
version: "0"
|
101
132
|
requirements: []
|
102
133
|
|
103
134
|
rubyforge_project: pt
|
104
|
-
rubygems_version: 1.
|
135
|
+
rubygems_version: 1.5.2
|
105
136
|
signing_key:
|
106
137
|
specification_version: 3
|
107
138
|
summary: Client to use Pivotal Tracker from the console.
|