pivotal-slacker 1.7.1 → 1.8.0

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.
Files changed (2) hide show
  1. data/bin/pivotal-slacker +36 -5
  2. metadata +1 -1
data/bin/pivotal-slacker CHANGED
@@ -39,7 +39,7 @@ $menu_story_mapping = {}
39
39
  require "commander/import"
40
40
  require "pivotal-tracker"
41
41
 
42
- program :version, "1.6.0"
42
+ program :version, "1.7.1"
43
43
  program :description, "Pivotal Tracker command line client."
44
44
 
45
45
  # ----------------------------------------------------------
@@ -203,9 +203,35 @@ def define_commands
203
203
  story_id = normalize_story_id(args[0].to_i)
204
204
 
205
205
  story = $project.stories.find(story_id)
206
- story.update :current_state => "started"
206
+ result = story.update :current_state => "started", :owned_by => $config.user
207
+
208
+ errs_array = result.errors.to_a
209
+ if errs_array.size > 0
210
+ errs_array.uniq.each do |error| # uniq because sometimes they're duplicated.
211
+ puts Formatter.err error
212
+ end
213
+ else
214
+ puts Formatter.story_action(Formatter.state("started"), story.id, story.name) + "."
215
+ end
216
+ end
217
+ end
218
+
219
+ command :estimate do |c|
220
+ c.syntax = "pivotal-slacker estimate story_id"
221
+ c.description = "Assign an estimate to a Pivotal Tracker story."
222
+ c.example "Estimate a story with ID 123 as being 1 point of effort", "pivotal-slacker estimate 123 --points 1"
223
+ c.option "--points", "The estimate in points to assign to the story"
224
+ c.action do |args, options|
225
+ options.default :points => nil
226
+
227
+ raise "--points is required" if options.points == nil
228
+
229
+ story_id = normalize_story_id(args[0].to_i)
207
230
 
208
- puts Formatter.story_action(Formatter.state("started"), story.id, story.name) + "."
231
+ story = $project.stories.find(story_id)
232
+ result = story.update :estimate => options.points
233
+
234
+ puts Formatter.story_action("estimated", story.id, story.name) + "."
209
235
  end
210
236
  end
211
237
 
@@ -304,6 +330,7 @@ command :shell do |c|
304
330
  c.action do |args, options|
305
331
  loop do
306
332
  input = Readline::readline("pivotal-slacker> ")
333
+
307
334
  break if input.nil? or input == "q" or input == "quit"
308
335
  next if input.strip == ""
309
336
 
@@ -334,8 +361,12 @@ command :shell do |c|
334
361
  menu_story_mapping = {}
335
362
  end
336
363
  end
337
-
338
- command.run *argv
364
+
365
+ begin
366
+ command.run *argv
367
+ rescue Exception => e
368
+ puts e
369
+ end
339
370
 
340
371
  init_new_shell_loop
341
372
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pivotal-slacker
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.7.1
4
+ version: 1.8.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: