zendeath 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -0
- data/lib/commands.rb +6 -7
- data/lib/zendeath.rb +12 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 18d92dfbbaf0e992e0ea315f8e3a76bf74bc1731
|
4
|
+
data.tar.gz: 04fbe5b36919231e81086c3491b66dc5224afb91
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4b6fe7d8436cce82a825489961bc3b434ffbd91bfa8edc9adda298929c537516106e254ea61755c023f64bf8f9ed5a9f2d2571dcccf25694e503c35ff61170cd
|
7
|
+
data.tar.gz: d81f9bfae71ce9d32d1e62c71152c856a15b7316b5e43d5aaf9ace1e33f3023c9e7cbf8f4af87aac060ae02975f3cd68ec7f38c889b9edfbe58e9aa31afc0be7
|
data/README.md
CHANGED
@@ -28,3 +28,5 @@ No tests because I don't know how to write tests yet.
|
|
28
28
|
- [ ] showticket should left/right justify for requester/agent
|
29
29
|
- [ ] Ability to post updates to tickets
|
30
30
|
- [ ] Ability to change status of tickets
|
31
|
+
|
32
|
+
[![Gem Version](https://badge.fury.io/rb/zendeath.png)](http://badge.fury.io/rb/zendeath)
|
data/lib/commands.rb
CHANGED
@@ -22,7 +22,8 @@ class Commands
|
|
22
22
|
@request = Net::HTTP::Get.new(@uri.request_uri)
|
23
23
|
elsif type == 'Put'
|
24
24
|
@request = Net::HTTP::Put.new(@uri.request_uri)
|
25
|
-
@
|
25
|
+
@request['Content-Type'] = 'application/json'
|
26
|
+
@request.body = body
|
26
27
|
else
|
27
28
|
raise ArgumentError.new('Unrecognized HTTP request type.')
|
28
29
|
end
|
@@ -118,16 +119,14 @@ class Commands
|
|
118
119
|
end
|
119
120
|
end
|
120
121
|
|
121
|
-
def updateticket(ticketid, comment, status='open', is_public='
|
122
|
+
def updateticket(ticketid, comment, status='open', is_public='false')
|
122
123
|
# https://support.puppetlabs.com/api/v2/tickets/3717.json
|
123
124
|
@uri.path = "/api/v2/tickets/#{ticketid.to_s}.json"
|
124
|
-
|
125
|
-
raise ArgumentError.new('Valid ticket status is pending, on-hold, open, or solved.')
|
126
|
-
end
|
125
|
+
|
127
126
|
updatearray = {
|
128
127
|
'ticket' => {
|
129
|
-
'
|
130
|
-
'
|
128
|
+
'status' => status,
|
129
|
+
'comment' => { 'body' => comment, 'public' => is_public }
|
131
130
|
}
|
132
131
|
}
|
133
132
|
updatearray_json = updatearray.to_json
|
data/lib/zendeath.rb
CHANGED
@@ -31,7 +31,18 @@ module Zendeath
|
|
31
31
|
when 'update'
|
32
32
|
# def updateticket(ticketid, comment, status='open', is_public='true')
|
33
33
|
|
34
|
-
|
34
|
+
updatearray = {
|
35
|
+
'ticketid' => ARGV[1],
|
36
|
+
'comment' => (STDIN.tty? ? ARGV[4] : STDIN.read),
|
37
|
+
'status' => ARGV[2],
|
38
|
+
'public' => ARGV[3],
|
39
|
+
}
|
40
|
+
|
41
|
+
command.updateticket(updatearray['ticketid'],
|
42
|
+
updatearray['comment'],
|
43
|
+
updatearray['status'],
|
44
|
+
updatearray['public'])
|
45
|
+
|
35
46
|
when 'showticket'
|
36
47
|
unless ARGV.length == 2
|
37
48
|
raise ArgumentError.new('showticket requires a ticket number')
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: zendeath
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Zachary Alex Stern
|
@@ -11,7 +11,7 @@ cert_chain: []
|
|
11
11
|
date: 2013-12-10 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Zendeath is a command line client for Zendesk, primarily focused on Puppet
|
14
|
-
Labs' use case
|
14
|
+
Labs' use case. It may be made more generic in the future.
|
15
15
|
email: zacharyalexstern@gmail.com
|
16
16
|
executables:
|
17
17
|
- zendeath
|