zendesk-tools 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +18 -17
- data/lib/zendesk-tools/clean_suspended.rb +21 -16
- data/lib/zendesk-tools/recover_suspended.rb +6 -5
- data/lib/zendesk-tools/version.rb +1 -1
- metadata +19 -19
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b12ae0f5184332c0c4e6e81809487bac6ce34b3a
|
4
|
+
data.tar.gz: ddc6a390e7cf8cb76b4b14e0765b3598500d7445
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 16634d6ab6fb1260861627bb68d0274e639e3cd6e961cbe7867cadc2673b1a5a7ea444c28c2fcdfd92cfaf44e966a8707771962d4d2c0d449cb9876bd872ca9c
|
7
|
+
data.tar.gz: bcc4fda7f8821c554ad5bfbffdb925e8045fbdea79ee58bc934e957c45ef394c126cc660c2136e0a6d407303785c0cc731a489000b4a17a648761d0d15ec3bb5
|
data/README.md
CHANGED
@@ -12,23 +12,24 @@ Install the gem:
|
|
12
12
|
|
13
13
|
Add a JSON config to ~/.zendesk-tools.json (TODO: make command line ovveride):
|
14
14
|
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
15
|
+
```javascript
|
16
|
+
{
|
17
|
+
|
18
|
+
// mandatory
|
19
|
+
"username": "user@example.com",
|
20
|
+
"token": "your_token_here",
|
21
|
+
"url": "https://your_domain.zendesk.com/api/v2",
|
22
|
+
|
23
|
+
//include at least one cause
|
24
|
+
"delete_causes": ["cause1", "cause2"],
|
25
|
+
"delete_subjects": ["subject1", "subject2"],
|
26
|
+
"recover_causes": ["cause1", "cause2"],
|
27
|
+
|
28
|
+
// optional
|
29
|
+
"log_level": "debug",
|
30
|
+
"log_file": "/some/path"
|
31
|
+
}
|
32
|
+
```
|
32
33
|
|
33
34
|
Clean suspended tickets:
|
34
35
|
|
@@ -2,21 +2,26 @@ module ZendeskTools
|
|
2
2
|
class CleanSuspended < Command
|
3
3
|
include Loggable
|
4
4
|
|
5
|
-
# Array with delete causes. Defined in config file
|
6
|
-
DELETE_CAUSES = ZendeskTools.config['delete_causes'] || [
|
7
|
-
"Detected email as being from a system user",
|
8
|
-
"Detected as mail loop",
|
9
|
-
"Automated response mail"
|
10
|
-
]
|
11
5
|
|
12
6
|
# Array with delete subjects. Defined in config file
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
7
|
+
|
8
|
+
def initialize(*args)
|
9
|
+
super
|
10
|
+
|
11
|
+
@delete_causes = ZendeskTools.config['delete_causes'] || [
|
12
|
+
"Detected email as being from a system user",
|
13
|
+
"Detected as mail loop",
|
14
|
+
"Automated response mail"
|
15
|
+
]
|
16
|
+
|
17
|
+
@delete_subjects = ZendeskTools.config['delete_subjects'] || [
|
18
|
+
"Returned mail: see transcript",
|
19
|
+
"Delivery Status Notification (Failure)",
|
20
|
+
"Undeliverable:",
|
21
|
+
"Kan ikke leveres:",
|
22
|
+
"Automatisk svar"
|
23
|
+
]
|
24
|
+
end
|
20
25
|
|
21
26
|
def run
|
22
27
|
@client.suspended_tickets.each do |suspended_ticket|
|
@@ -35,8 +40,8 @@ module ZendeskTools
|
|
35
40
|
cause = suspended_ticket.cause
|
36
41
|
subject = suspended_ticket.subject
|
37
42
|
|
38
|
-
|
39
|
-
|
43
|
+
@delete_causes.any? { |delete_cause| cause.include?(delete_cause) } ||
|
44
|
+
@delete_subjects.any? { |delete_subject| subject.include?(delete_subject) }
|
40
45
|
end
|
41
46
|
end
|
42
|
-
end
|
47
|
+
end
|
@@ -6,14 +6,15 @@ module ZendeskTools
|
|
6
6
|
class RecoverSuspended < Command
|
7
7
|
include Loggable
|
8
8
|
|
9
|
-
# Array with recover causes. Defined in config file
|
10
|
-
RECOVER_CAUSES = ZendeskTools.config['recover_causes'] || [
|
11
|
-
"End-user only allowed to update their own tickets"
|
12
|
-
]
|
13
9
|
|
14
10
|
def initialize(*args)
|
15
11
|
super
|
12
|
+
|
16
13
|
@tmpdir = Dir.mktmpdir
|
14
|
+
|
15
|
+
@recover_causes = ZendeskTools.config['recover_causes'] || [
|
16
|
+
"End-user only allowed to update their own tickets"
|
17
|
+
]
|
17
18
|
end
|
18
19
|
|
19
20
|
def run
|
@@ -89,7 +90,7 @@ module ZendeskTools
|
|
89
90
|
cause = suspended_ticket.cause
|
90
91
|
subject = suspended_ticket.subject
|
91
92
|
|
92
|
-
|
93
|
+
@recover_causes.any? { |recover_cause| cause.include?(recover_cause) }
|
93
94
|
end
|
94
95
|
end
|
95
96
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: zendesk-tools
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jari Bakken
|
@@ -9,90 +9,90 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-06-
|
12
|
+
date: 2014-06-18 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: zendesk_api
|
16
16
|
requirement: !ruby/object:Gem::Requirement
|
17
17
|
requirements:
|
18
|
-
- -
|
18
|
+
- - ~>
|
19
19
|
- !ruby/object:Gem::Version
|
20
20
|
version: 1.3.0
|
21
21
|
type: :runtime
|
22
22
|
prerelease: false
|
23
23
|
version_requirements: !ruby/object:Gem::Requirement
|
24
24
|
requirements:
|
25
|
-
- -
|
25
|
+
- - ~>
|
26
26
|
- !ruby/object:Gem::Version
|
27
27
|
version: 1.3.0
|
28
28
|
- !ruby/object:Gem::Dependency
|
29
29
|
name: json
|
30
30
|
requirement: !ruby/object:Gem::Requirement
|
31
31
|
requirements:
|
32
|
-
- -
|
32
|
+
- - '>='
|
33
33
|
- !ruby/object:Gem::Version
|
34
34
|
version: '0'
|
35
35
|
type: :runtime
|
36
36
|
prerelease: false
|
37
37
|
version_requirements: !ruby/object:Gem::Requirement
|
38
38
|
requirements:
|
39
|
-
- -
|
39
|
+
- - '>='
|
40
40
|
- !ruby/object:Gem::Version
|
41
41
|
version: '0'
|
42
42
|
- !ruby/object:Gem::Dependency
|
43
43
|
name: rake
|
44
44
|
requirement: !ruby/object:Gem::Requirement
|
45
45
|
requirements:
|
46
|
-
- -
|
46
|
+
- - '>='
|
47
47
|
- !ruby/object:Gem::Version
|
48
48
|
version: '0'
|
49
49
|
type: :runtime
|
50
50
|
prerelease: false
|
51
51
|
version_requirements: !ruby/object:Gem::Requirement
|
52
52
|
requirements:
|
53
|
-
- -
|
53
|
+
- - '>='
|
54
54
|
- !ruby/object:Gem::Version
|
55
55
|
version: '0'
|
56
56
|
- !ruby/object:Gem::Dependency
|
57
57
|
name: geminabox
|
58
58
|
requirement: !ruby/object:Gem::Requirement
|
59
59
|
requirements:
|
60
|
-
- -
|
60
|
+
- - '>='
|
61
61
|
- !ruby/object:Gem::Version
|
62
62
|
version: '0'
|
63
63
|
type: :runtime
|
64
64
|
prerelease: false
|
65
65
|
version_requirements: !ruby/object:Gem::Requirement
|
66
66
|
requirements:
|
67
|
-
- -
|
67
|
+
- - '>='
|
68
68
|
- !ruby/object:Gem::Version
|
69
69
|
version: '0'
|
70
70
|
- !ruby/object:Gem::Dependency
|
71
71
|
name: log4r
|
72
72
|
requirement: !ruby/object:Gem::Requirement
|
73
73
|
requirements:
|
74
|
-
- -
|
74
|
+
- - '>='
|
75
75
|
- !ruby/object:Gem::Version
|
76
76
|
version: '0'
|
77
77
|
type: :runtime
|
78
78
|
prerelease: false
|
79
79
|
version_requirements: !ruby/object:Gem::Requirement
|
80
80
|
requirements:
|
81
|
-
- -
|
81
|
+
- - '>='
|
82
82
|
- !ruby/object:Gem::Version
|
83
83
|
version: '0'
|
84
84
|
- !ruby/object:Gem::Dependency
|
85
85
|
name: pry
|
86
86
|
requirement: !ruby/object:Gem::Requirement
|
87
87
|
requirements:
|
88
|
-
- -
|
88
|
+
- - '>='
|
89
89
|
- !ruby/object:Gem::Version
|
90
90
|
version: '0'
|
91
91
|
type: :development
|
92
92
|
prerelease: false
|
93
93
|
version_requirements: !ruby/object:Gem::Requirement
|
94
94
|
requirements:
|
95
|
-
- -
|
95
|
+
- - '>='
|
96
96
|
- !ruby/object:Gem::Version
|
97
97
|
version: '0'
|
98
98
|
description: Tools for FINNs ZenDesk
|
@@ -104,8 +104,8 @@ executables:
|
|
104
104
|
extensions: []
|
105
105
|
extra_rdoc_files: []
|
106
106
|
files:
|
107
|
-
-
|
108
|
-
-
|
107
|
+
- .gitattributes
|
108
|
+
- .gitignore
|
109
109
|
- Gemfile
|
110
110
|
- LICENSE.txt
|
111
111
|
- README.md
|
@@ -128,17 +128,17 @@ require_paths:
|
|
128
128
|
- lib
|
129
129
|
required_ruby_version: !ruby/object:Gem::Requirement
|
130
130
|
requirements:
|
131
|
-
- -
|
131
|
+
- - '>='
|
132
132
|
- !ruby/object:Gem::Version
|
133
133
|
version: '0'
|
134
134
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
135
135
|
requirements:
|
136
|
-
- -
|
136
|
+
- - '>='
|
137
137
|
- !ruby/object:Gem::Version
|
138
138
|
version: '0'
|
139
139
|
requirements: []
|
140
140
|
rubyforge_project:
|
141
|
-
rubygems_version: 2.
|
141
|
+
rubygems_version: 2.0.14
|
142
142
|
signing_key:
|
143
143
|
specification_version: 4
|
144
144
|
summary: Tools for FINNs ZenDesk
|