taskmapper-cli 0.0.1 → 0.0.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/README.rdoc +18 -1
  2. data/bin/tm +40 -13
  3. data/lib/tm/version.rb +1 -1
  4. data/lib/tm.rb +2 -0
  5. metadata +4 -4
data/README.rdoc CHANGED
@@ -64,10 +64,19 @@ http://dl.dropbox.com/u/576024/2013-04-02-165558_976x133_scrot.png
64
64
 
65
65
  http://dl.dropbox.com/u/576024/2013-04-02-165840_1011x124_scrot.png
66
66
 
67
- tm task --list=single --project-attribute='name:test-project' --search-attribute='title:test-task'
67
+ tm task --list=single --project-attribute='name:test-project' --task-attribute='title:test-task'
68
68
 
69
69
  http://dl.dropbox.com/u/576024/2013-04-02-170111_950x124_scrot.png
70
70
 
71
+ ==== Create task
72
+
73
+ This particular needs needs --project-attribute and --task-attribute to work on an existing
74
+ project and task respectevily.
75
+
76
+ tm task --project-attribute='name:test-project' --task-attribute='title:testing' --create-task
77
+
78
+ http://dl.dropbox.com/u/576024/2013-04-09-102245_1304x162_scrot.png
79
+
71
80
  === Comment command
72
81
 
73
82
  ==== List comments
@@ -87,6 +96,14 @@ the user will retrieve the comments. (ex. 'title:test-task')
87
96
 
88
97
  http://dl.dropbox.com/u/576024/2013-04-04-143242_1196x148_scrot.png
89
98
 
99
+ ==== Create comments
100
+
101
+ This command needs three mandatory options --project-attribute, --task-attribute and --comment-attribute.
102
+
103
+ tm comment --project-attribute='name:test-project --task-attribute='title:test-task' --command-attribute='body:testing' --create-comment
104
+
105
+ http://dl.dropbox.com/u/576024/2013-04-09-102018_1354x161_scrot.png
106
+
90
107
  For more help
91
108
 
92
109
  tm help
data/bin/tm CHANGED
@@ -77,7 +77,7 @@ end
77
77
 
78
78
  desc 'Manage iteration with tickets, depends on a project name'
79
79
  command :task do |c|
80
- ticket_commands = {
80
+ task_read_commands = {
81
81
  'all' => TM::Commands::ListAllTasks,
82
82
  'first' => TM::Commands::FirstTask,
83
83
  'last' => TM::Commands::LastTask,
@@ -93,16 +93,22 @@ command :task do |c|
93
93
  List tasks possible arguments 'all', 'first', 'last', 'single'. Default 'all'.
94
94
  """
95
95
  c.default_value 'all'
96
- c.arg_name ticket_commands.keys.join("|")
96
+ c.arg_name task_read_commands.keys.join("|")
97
97
  c.flag [:l, :list]
98
98
 
99
+ c.desc 'Create task'
100
+ c.long_desc """
101
+ Create tasks for a given project
102
+ """
103
+ c.switch 'create-task'
104
+
99
105
  c.desc 'Format of the output'
100
106
  c.arg_name output_formats.keys.join("|")
101
107
  c.default_value 'pretty'
102
108
  c.flag :format
103
109
 
104
110
  c.desc 'Attributes for --list=single. ex "name:TaskName"'
105
- c.flag 'search-attribute'
111
+ c.flag 'task-attribute'
106
112
 
107
113
  c.desc 'Disable color'
108
114
  c.switch 'no-color'
@@ -110,18 +116,22 @@ command :task do |c|
110
116
  c.action do |global_options, options, args|
111
117
  Sickill::Rainbow.enabled = false if options[:'no-color']
112
118
  formatter = output_formats[options[:format]]
113
- command = ticket_commands[options[:list]]
119
+ unless options[:'create-task']
120
+ command = task_read_commands[options[:list]]
121
+ else
122
+ command = TM::Commands::CreateTask
123
+ end
114
124
  command.new(TM::ProviderHandler.build_handler(
115
125
  global_options[:provider],
116
126
  global_options[:authentication]),
117
127
  formatter,
118
- options[:'project-attribute']).execute(options[:'search-attribute'])
128
+ options[:'project-attribute']).execute(options[:'task-attribute'])
119
129
  end
120
130
  end
121
131
 
122
132
  desc 'Manage iteration with comments, depends on a project and task'
123
133
  command :comment do |c|
124
- comment_commands = {
134
+ comment_read_commands = {
125
135
  'all' => TM::Commands::ListAllCommentsForTask
126
136
  }
127
137
 
@@ -134,7 +144,7 @@ command :comment do |c|
134
144
  List tasks possible arguments 'all'.
135
145
  """
136
146
  c.default_value 'all'
137
- c.arg_name comment_commands.keys.join("|")
147
+ c.arg_name comment_read_commands.keys.join("|")
138
148
  c.flag [:l, :list]
139
149
 
140
150
  c.desc 'Format of the output'
@@ -142,6 +152,12 @@ command :comment do |c|
142
152
  c.default_value 'pretty'
143
153
  c.flag :format
144
154
 
155
+ c.desc 'Create a comment'
156
+ c.switch 'create-comment'
157
+
158
+ c.desc 'Comment attribute for creation'
159
+ c.flag 'comment-attribute'
160
+
145
161
  c.desc 'Use to find the task to search for comments Ex. "name:TaskName"'
146
162
  c.flag 'task-attribute'
147
163
 
@@ -151,12 +167,23 @@ command :comment do |c|
151
167
  c.action do |global_options, options, args|
152
168
  Sickill::Rainbow.enabled = false if options[:'no-color']
153
169
  formatter = output_formats[options[:format]]
154
- command = comment_commands[options[:list]]
155
- command.new(TM::ProviderHandler.build_handler(
156
- global_options[:provider],
157
- global_options[:authentication]),
158
- formatter,
159
- options[:'project-attribute']).execute(options[:'task-attribute'])
170
+ unless options[:'create-comment']
171
+ command = comment_read_commands[options[:list]]
172
+
173
+ command.new(TM::ProviderHandler.build_handler(
174
+ global_options[:provider],
175
+ global_options[:authentication]),
176
+ formatter,
177
+ options[:'project-attribute']).execute(options[:'task-attribute'])
178
+ else
179
+ TM::Commands::CreateComment.new(TM::ProviderHandler.build_handler(
180
+ global_options[:provider],
181
+ global_options[:authentication]),
182
+ formatter,
183
+ options[:'project-attribute']).execute(
184
+ options[:'task-attribute'],
185
+ options[:'comment-attribute'])
186
+ end
160
187
  end
161
188
  end
162
189
 
data/lib/tm/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Tm
2
- VERSION = '0.0.1'
2
+ VERSION = '0.0.2'
3
3
  end
data/lib/tm.rb CHANGED
@@ -15,6 +15,8 @@ require 'tm/commands/list_all_tasks'
15
15
  require 'tm/commands/first_task'
16
16
  require 'tm/commands/last_task'
17
17
  require 'tm/commands/single_task'
18
+ require 'tm/commands/create_task'
19
+ require 'tm/commands/create_comment'
18
20
 
19
21
  # Formatters
20
22
  require 'tm/commands/list_all_comments_for_task'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: taskmapper-cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-04-08 00:00:00.000000000 Z
12
+ date: 2013-04-09 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: taskmapper
@@ -413,7 +413,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
413
413
  version: '0'
414
414
  segments:
415
415
  - 0
416
- hash: -3180869278577975679
416
+ hash: 1822266939625810085
417
417
  required_rubygems_version: !ruby/object:Gem::Requirement
418
418
  none: false
419
419
  requirements:
@@ -422,7 +422,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
422
422
  version: '0'
423
423
  segments:
424
424
  - 0
425
- hash: -3180869278577975679
425
+ hash: 1822266939625810085
426
426
  requirements: []
427
427
  rubyforge_project:
428
428
  rubygems_version: 1.8.25