pt 0.6.1 → 0.6.2

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 +4 -0
  2. data/lib/pt.rb +1 -1
  3. data/lib/pt/client.rb +5 -0
  4. data/lib/pt/ui.rb +37 -21
  5. metadata +4 -3
data/Changelog.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # pt changelog
2
2
 
3
+ ## v0.6.2
4
+
5
+ Added "-m" to create that will load the description in your editor ( good idea ahunt09 )
6
+
3
7
  ## v0.6
4
8
 
5
9
  Added command pt started ( Matthijs Groen )
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.1'
5
+ VERSION = '0.6.2'
6
6
  end
7
7
 
8
8
  require 'pt/client'
data/lib/pt/client.rb CHANGED
@@ -119,4 +119,9 @@ 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_description(project, name, owner, requester, task_type, description)
123
+ project.stories.create(:name => name, :owned_by => owner, :requested_by => requester, :story_type => task_type, :description => description)
124
+ end
125
+
126
+
122
127
  end
data/lib/pt/ui.rb CHANGED
@@ -1,6 +1,7 @@
1
1
  require 'yaml'
2
2
  require 'colored'
3
3
  require 'highline'
4
+ require 'tempfile'
4
5
 
5
6
  class PT::UI
6
7
 
@@ -91,7 +92,22 @@ class PT::UI
91
92
  else
92
93
  'feature'
93
94
  end
94
- result = @client.create_task(@project, name, owner, requester, task_type)
95
+ result = nil
96
+
97
+ # did you do a -m so you can add a description?
98
+ if ARGV.include? "-m" or ARGV.include? "--m"
99
+ description_file = Tempfile.new ["pt-create-description", "txt"]
100
+ description_file.write "Description for #{owner}'s #{task_type} ( delete this line )"
101
+
102
+ system `#{ENV['EDITOR']} #{description_file.path}`
103
+
104
+ description = File.read(description_file.path)
105
+ result = @client.create_task_with_description(@project, name, owner, requester, task_type, description)
106
+
107
+ description_file.unlink
108
+ else
109
+ result = @client.create_task(@project, name, owner, requester, task_type)
110
+ end
95
111
  if result.errors.any?
96
112
  error(result.errors.errors)
97
113
  else
@@ -442,26 +458,26 @@ class PT::UI
442
458
  end
443
459
 
444
460
  title("Command line usage for pt #{PT::VERSION}")
445
- puts("pt # show all available tasks")
446
- puts("pt todo # show all unscheduled tasks")
447
- puts("pt started # show all started stories")
448
- puts("pt create [title] ~[owner] ~[type] # create a new task")
449
- puts("pt show [id] # shows detailed info about a task")
450
- puts("pt tasks [id] # manage tasks of story")
451
- puts("pt open [id] # open a task in the browser")
452
- puts("pt assign [id] [member] # assign owner")
453
- puts("pt comment [id] [comment] # add a comment")
454
- puts("pt estimate [id] [0-3] # estimate a task in points scale")
455
- puts("pt start [id] # mark a task as started")
456
- puts("pt finish [id] # indicate you've finished a task")
457
- puts("pt deliver [id] # indicate the task is delivered");
458
- puts("pt accept [id] # mark a task as accepted")
459
- puts("pt reject [id] [reason] # mark a task as rejected, explaining why")
460
- puts("pt find [query] # looks in your tasks by title and presents it")
461
- puts("pt done [id] ~[0-3] ~[comment] # lazy mans finish task, does everything")
462
- puts("pt list [member] # list all tasks for another pt user")
463
- puts("pt list all # list all tasks for all users")
464
- puts("pt updates [number] # shows number recent activity from your current project")
461
+ puts("pt # show all available tasks")
462
+ puts("pt todo # show all unscheduled tasks")
463
+ puts("pt started # show all started stories")
464
+ puts("pt create [title] ~[owner] ~[type] -m # create a new task (and include description ala git commit)")
465
+ puts("pt show [id] # shows detailed info about a task")
466
+ puts("pt tasks [id] # manage tasks of story")
467
+ puts("pt open [id] # open a task in the browser")
468
+ puts("pt assign [id] [member] # assign owner")
469
+ puts("pt comment [id] [comment] # add a comment")
470
+ puts("pt estimate [id] [0-3] # estimate a task in points scale")
471
+ puts("pt start [id] # mark a task as started")
472
+ puts("pt finish [id] # indicate you've finished a task")
473
+ puts("pt deliver [id] # indicate the task is delivered");
474
+ puts("pt accept [id] # mark a task as accepted")
475
+ puts("pt reject [id] [reason] # mark a task as rejected, explaining why")
476
+ puts("pt find [query] # looks in your tasks by title and presents it")
477
+ puts("pt done [id] ~[0-3] ~[comment] # lazy mans finish task, does everything")
478
+ puts("pt list [member] # list all tasks for another pt user")
479
+ puts("pt list all # list all tasks for all users")
480
+ puts("pt updates [number] # shows number recent activity from your current project")
465
481
  puts("")
466
482
  puts("All commands can be run without arguments for a wizard like UI.")
467
483
  end
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.1
4
+ version: 0.6.2
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-02-15 00:00:00.000000000 Z
14
+ date: 2013-03-14 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: pivotal-tracker
@@ -120,8 +120,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
120
120
  version: '0'
121
121
  requirements: []
122
122
  rubyforge_project: pt
123
- rubygems_version: 1.8.23
123
+ rubygems_version: 1.8.25
124
124
  signing_key:
125
125
  specification_version: 3
126
126
  summary: Client to use Pivotal Tracker from the console.
127
127
  test_files: []
128
+ has_rdoc: