climine 0.0.8 → 0.1.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 89336748fbdb61b719c4d94f99643450ba1b8b3a
4
- data.tar.gz: a73a5daa7475983a0a733131f67860997793db51
3
+ metadata.gz: a766cf2cbfe3d3f21c80570c7ebd6444ceafb039
4
+ data.tar.gz: 262936fed1889baf10ea219025c8b18c22af40dd
5
5
  SHA512:
6
- metadata.gz: e36c4f1e8542509db2ccb035a2f5b6d0edae2041febaf0c1b8eb50b0440d178dc8fe36d902b9f6d6236000a5f13ace8b7c1cadbc58100c64d25a0087775bf434
7
- data.tar.gz: 220980dc95d8c089bdb163a61c396bdd883408d440ae5e65553810445c4ff677fe087281e7a2ca61cd8c165e92cf68e7167405411ced82033b0807e7abeb843b
6
+ metadata.gz: 0660e15ecebcc4e28d6797ee8718b89b5a2a611ae84587c8d0d7f68bd9109110024e24ae99362c5186efd470e678966f55497e7fab126b8b87299e4cb0e6de4f
7
+ data.tar.gz: a3e5f2ecce059f248750657adc7c069542e14757ce81ec74cef779a9f8ee044c24318390031b5007eb06b168922b432c5de9ad60fa515f054a85c558a6d8b5f1
data/README.md CHANGED
@@ -129,10 +129,26 @@ Options:
129
129
  -t, [--tracker-id=TRACKER_ID] # tracker_id (search by `tracker` command)
130
130
  -s, [--status-id=STATUS_ID] # status_id (search by `status` command)
131
131
  -u, [--user-id=USER_ID] # user_id (search by `user` command)
132
+ -n, [--notes=NOTES] # notes (comment)
132
133
 
133
134
  update Redmine Issues. see) http://www.redmine.org/projects/redmine/wiki/Rest_Issues#Updating-an-issue
134
135
  ```
135
136
 
137
+ #### post issue notes
138
+
139
+ ```
140
+ Usage:
141
+ climine issue notes [TICKET_NO] [NOTE]
142
+
143
+ Options:
144
+ -t, [--tracker-id=TRACKER_ID] # tracker_id (search by `tracker` command)
145
+ -s, [--status-id=STATUS_ID] # status_id (search by `status` command)
146
+ -u, [--user-id=USER_ID] # user_id (search by `user` command)
147
+ -n, [--notes=NOTES] # notes (comment)
148
+
149
+ post notes Redmine Issues. see) http://www.redmine.org/projects/redmine/wiki/Rest_Issues#Updating-an-issue
150
+ ```
151
+
136
152
  #### update issue status
137
153
 
138
154
 
@@ -91,6 +91,7 @@ module Climine::Command
91
91
  option :tracker_id, type: :numeric, aliases: '-t', banner: "TRACKER_ID", desc: "tracker_id (search by `tracker` command)"
92
92
  option :status_id, type: :numeric, aliases: '-s', banner: "STATUS_ID", desc: "status_id (search by `status` command)"
93
93
  option :user_id, type: :numeric, aliases: '-u', banner: "USER_ID", desc: "user_id (search by `user` command)"
94
+ option :notes, type: :string, aliases: '-n', banner: "NOTES", desc: "notes (comment)"
94
95
  def update(id=nil)
95
96
  say("required ticket number!", :red) and return unless id
96
97
 
@@ -100,6 +101,29 @@ module Climine::Command
100
101
  render :issue, redmine.issue(id)
101
102
  end
102
103
 
104
+ desc "notes [TICKET_NO] [NOTE]", "post notes Redmine Issues. see) http://www.redmine.org/projects/redmine/wiki/Rest_Issues#Updating-an-issue"
105
+ option :tracker_id, type: :numeric, aliases: '-t', banner: "TRACKER_ID", desc: "tracker_id (search by `tracker` command)"
106
+ option :status_id, type: :numeric, aliases: '-s', banner: "STATUS_ID", desc: "status_id (search by `status` command)"
107
+ option :user_id, type: :numeric, aliases: '-u', banner: "USER_ID", desc: "user_id (search by `user` command)"
108
+ option :notes, type: :string, aliases: '-n', banner: "NOTES", desc: "notes (comment)"
109
+ def notes(id=nil, notes=nil)
110
+ say("required ticket number!", :red) and return unless id
111
+
112
+ if notes
113
+ options[:notes] = notes
114
+ elsif !options[:notes]
115
+ options[:notes] = ask_notes
116
+ end
117
+
118
+ if options[:user_id]
119
+ options[:assigned_to_id] = options.delete(:user_id)
120
+ end
121
+
122
+ redmine.update_issue id, options
123
+
124
+ render :issue, redmine.issue(id, { include: [:journals] })
125
+ end
126
+
103
127
  desc "start [TICKET_NO]", "update status of issue to ID:2."
104
128
  option :tracker_id, type: :numeric, aliases: '-t', banner: "TRACKER_ID", desc: "tracker_id (search by `tracker` command)"
105
129
  option :user_id, type: :numeric, aliases: '-u', banner: "USER_ID", desc: "user_id (search by `user` command)"
@@ -151,17 +175,26 @@ module Climine::Command
151
175
  end
152
176
 
153
177
  def ask_description
178
+ ask_by_editor "description"
179
+ end
180
+
181
+ def ask_notes
182
+ ask_by_editor "notes"
183
+ end
184
+
185
+ def ask_by_editor name
154
186
  editor = config.editor
155
187
  if editor.nil? or editor.empty?
156
- description = ask_not_empty("description > ")
188
+ value = ask_not_empty("#{name} > ")
157
189
  else
158
- tmp = Tempfile.new('description_tmp')
190
+ tmp = Tempfile.new("#{name}_tmp")
159
191
  system "#{editor} #{tmp.path}"
160
- description = open(tmp.path){|f| f.read.force_encoding('utf-8') }
192
+ value = open(tmp.path){|f| f.read.force_encoding('utf-8') }
161
193
  tmp.unlink
162
194
  end
163
- description
195
+ value
164
196
  end
197
+
165
198
  }
166
199
  end
167
200
  end
@@ -1,3 +1,3 @@
1
1
  module Climine
2
- VERSION = "0.0.8"
2
+ VERSION = "0.1.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: climine
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.8
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - yagince
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-06-07 00:00:00.000000000 Z
11
+ date: 2014-07-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor