pt 0.6.4 → 0.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (5) hide show
  1. data/Changelog.md +5 -0
  2. data/lib/pt.rb +1 -1
  3. data/lib/pt/client.rb +1 -1
  4. data/lib/pt/ui.rb +22 -24
  5. metadata +2 -2
data/Changelog.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # pt changelog
2
2
 
3
+ ## v0.7.0
4
+
5
+ Fixed the -m option
6
+ Comment, Assign, Estimate, Start, Finish, Deliver, Accept all accept the num value in `pt` or a story id
7
+
3
8
  ## v0.6.3 & v0.6.4
4
9
 
5
10
  Added the ability to see started by username ( good idea marcolz )
data/lib/pt.rb CHANGED
@@ -2,7 +2,7 @@ require 'rubygems'
2
2
 
3
3
  module PT
4
4
  class InputError < StandardError; end
5
- VERSION = '0.6.4'
5
+ VERSION = '0.7'
6
6
  end
7
7
 
8
8
  require 'pt/client'
data/lib/pt/client.rb CHANGED
@@ -119,7 +119,7 @@ class PT::Client
119
119
  project.stories.create(:name => name, :owned_by => owner, :requested_by => requester, :story_type => task_type)
120
120
  end
121
121
 
122
- def create_task_with_descriptionz(project, name, owner, requester, task_type, description)
122
+ def create_task_with_description(project, name, owner, requester, task_type, description)
123
123
  project.stories.create(:name => name, :owned_by => owner, :requested_by => requester, :story_type => task_type, :description => description)
124
124
  end
125
125
 
data/lib/pt/ui.rb CHANGED
@@ -140,14 +140,24 @@ class PT::UI
140
140
  `open #{task.url}`
141
141
  end
142
142
 
143
+ def task_by_id_or_pt_id id
144
+ if id < 1000
145
+ tasks = @client.get_my_work(@project, @local_config[:user_name])
146
+ table = PT::TasksTable.new(tasks)
147
+ table[id]
148
+ else
149
+ @client.get_task_by_id id
150
+ end
151
+ end
152
+
143
153
  def comment
144
- tasks = @client.get_my_work(@project, @local_config[:user_name])
145
- table = PT::TasksTable.new(tasks)
146
154
  if @params[0]
147
- task = table[ @params[0].to_i ]
155
+ task = task_by_id_or_pt_id @params[0].to_i
148
156
  comment = @params[1]
149
157
  title("Adding a comment to #{task.name}")
150
158
  else
159
+ tasks = @client.get_my_work(@project, @local_config[:user_name])
160
+ table = PT::TasksTable.new(tasks)
151
161
  title("Tasks for #{user_s} in #{project_to_s}")
152
162
  task = select("Please select a story to comment it", table)
153
163
  comment = ask("Write your comment")
@@ -161,9 +171,7 @@ class PT::UI
161
171
 
162
172
  def assign
163
173
  if @params[0]
164
- tasks = @client.get_my_work(@project, @local_config[:user_name])
165
- table = PT::TasksTable.new(tasks)
166
- task = table[@params[0].to_i]
174
+ task = task_by_id_or_pt_id @params[0].to_i
167
175
  owner = find_owner @params[1]
168
176
  else
169
177
  title("Tasks for #{user_s} in #{project_to_s}")
@@ -188,9 +196,7 @@ class PT::UI
188
196
 
189
197
  def estimate
190
198
  if @params[0]
191
- tasks = @client.get_my_work(@project, @local_config[:user_name])
192
- table = PT::TasksTable.new(tasks)
193
- task = table[@params[0].to_i]
199
+ task = task_by_id_or_pt_id @params[0].to_i
194
200
  title("Estimating '#{task.name}'")
195
201
 
196
202
  if [0,1,2,3].include? @params[1].to_i
@@ -214,9 +220,7 @@ class PT::UI
214
220
 
215
221
  def start
216
222
  if @params[0]
217
- tasks = @client.get_my_work(@project, @local_config[:user_name])
218
- table = PT::TasksTable.new(tasks)
219
- task = table[@params[0].to_i]
223
+ task = task_by_id_or_pt_id @params[0].to_i
220
224
  title("Starting '#{task.name}'")
221
225
  else
222
226
  tasks = @client.get_my_tasks_to_start(@project, @local_config[:user_name])
@@ -229,9 +233,7 @@ class PT::UI
229
233
 
230
234
  def finish
231
235
  if @params[0]
232
- tasks = @client.get_my_work(@project, @local_config[:user_name])
233
- table = PT::TasksTable.new(tasks)
234
- task = table[@params[0].to_i]
236
+ task = task_by_id_or_pt_id @params[0].to_i
235
237
  title("Finishing '#{task.name}'")
236
238
  else
237
239
  tasks = @client.get_my_tasks_to_finish(@project, @local_config[:user_name])
@@ -244,9 +246,7 @@ class PT::UI
244
246
 
245
247
  def deliver
246
248
  if @params[0]
247
- tasks = @client.get_my_work(@project, @local_config[:user_name])
248
- table = PT::TasksTable.new(tasks)
249
- task = table[@params[0].to_i]
249
+ task = task_by_id_or_pt_id @params[0].to_i
250
250
  title("Delivering '#{task.name}'")
251
251
  else
252
252
  tasks = @client.get_my_tasks_to_deliver(@project, @local_config[:user_name])
@@ -260,9 +260,7 @@ class PT::UI
260
260
 
261
261
  def accept
262
262
  if @params[0]
263
- tasks = @client.get_my_work(@project, @local_config[:user_name])
264
- table = PT::TasksTable.new(tasks)
265
- task = table[@params[0].to_i]
263
+ task = task_by_id_or_pt_id @params[0].to_i
266
264
  title("Accepting '#{task.name}'")
267
265
  else
268
266
  tasks = @client.get_my_tasks_to_accept(@project, @local_config[:user_name])
@@ -470,12 +468,12 @@ class PT::UI
470
468
  title("Command line usage for pt #{PT::VERSION}")
471
469
  puts("pt # show all available tasks")
472
470
  puts("pt todo # show all unscheduled tasks")
473
- puts("pt started # show all started stories")
471
+ puts("pt started ~[owner] # show all started stories")
474
472
  puts("pt create [title] ~[owner] ~[type] -m # create a new task (and include description ala git commit)")
475
473
  puts("pt show [id] # shows detailed info about a task")
476
474
  puts("pt tasks [id] # manage tasks of story")
477
475
  puts("pt open [id] # open a task in the browser")
478
- puts("pt assign [id] [member] # assign owner")
476
+ puts("pt assign [id] ~[owner] # assign owner")
479
477
  puts("pt comment [id] [comment] # add a comment")
480
478
  puts("pt estimate [id] [0-3] # estimate a task in points scale")
481
479
  puts("pt start [id] # mark a task as started")
@@ -485,7 +483,7 @@ class PT::UI
485
483
  puts("pt reject [id] [reason] # mark a task as rejected, explaining why")
486
484
  puts("pt find [query] # looks in your tasks by title and presents it")
487
485
  puts("pt done [id] ~[0-3] ~[comment] # lazy mans finish task, does everything")
488
- puts("pt list [member] # list all tasks for another pt user")
486
+ puts("pt list [owner] # list all tasks for another pt user")
489
487
  puts("pt list all # list all tasks for all users")
490
488
  puts("pt updates [number] # shows number recent activity from your current project")
491
489
  puts("")
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pt
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.4
4
+ version: '0.7'
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2013-04-12 00:00:00.000000000 Z
14
+ date: 2013-05-08 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: pivotal-tracker