zen_freshdesk 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/lib/zen_freshdesk/version.rb +1 -1
- data/lib/zen_freshdesk.rb +37 -14
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e07985a6f05f4e03b871fef3b842414bdada9a59
|
4
|
+
data.tar.gz: 7a4c1c016384f082422b7cb5a88004e9bba1c389
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7bce92f1744df6feda4e013ea015035ec8c6db44a6ab02c92ef96f79bd4f719f9d5b321b2301ed58d6d93d9edb7fbb6d5dd45c73c7945c02ccce7a1b794a0d02
|
7
|
+
data.tar.gz: a71c769e25a132f57183948ae52f635cdca65533af4fd1641a1fdb4df05c089611e68ea35a31177cde41c1d9d260322c216a429238818866c025b3171877ba4b
|
data/lib/zen_freshdesk.rb
CHANGED
@@ -3,6 +3,12 @@ require 'rest_client'
|
|
3
3
|
require 'base64'
|
4
4
|
require 'json'
|
5
5
|
|
6
|
+
|
7
|
+
require 'thor'
|
8
|
+
require 'thor/group'
|
9
|
+
|
10
|
+
|
11
|
+
|
6
12
|
module ZenFreshdesk
|
7
13
|
class << self
|
8
14
|
attr_accessor :configuration
|
@@ -13,11 +19,25 @@ module ZenFreshdesk
|
|
13
19
|
yield(configuration)
|
14
20
|
end
|
15
21
|
|
16
|
-
|
22
|
+
class Configuration
|
17
23
|
attr_accessor :uri_api, :api_key, :projects, :requester_id, :submitter_id, :responder_id,
|
18
24
|
:subject, :description, :header, :email
|
19
25
|
end
|
20
26
|
|
27
|
+
# class InstallGenerator < Rails::Generators::Base
|
28
|
+
# include Thor::Actions
|
29
|
+
# source_root File.expand_path("../templates", __FILE__)
|
30
|
+
|
31
|
+
# def create_initializer
|
32
|
+
# template 'initializer.rb.erb', 'config/initializers/zen_freshdeskkkkk.rb'
|
33
|
+
# end
|
34
|
+
# end
|
35
|
+
|
36
|
+
|
37
|
+
|
38
|
+
|
39
|
+
|
40
|
+
|
21
41
|
def self.create_ticket()
|
22
42
|
header = {:content_type => "application/json", :Authorization => "Basic #{Base64.encode64(ZenFreshdesk.configuration.api_key)}"}
|
23
43
|
|
@@ -40,17 +60,20 @@ module ZenFreshdesk
|
|
40
60
|
end
|
41
61
|
end
|
42
62
|
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
63
|
+
ZenFreshdesk.configure do |config|
|
64
|
+
config.api_key = "UPf8ktY8VePpIOQPsNsq"
|
65
|
+
config.uri_api = "http://chinh.freshdesk.com/helpdesk/tickets.json?tags=test"
|
66
|
+
config.projects = ""
|
67
|
+
config.requester_id = "1"
|
68
|
+
config.submitter_id = ""
|
69
|
+
config.responder_id = "3"
|
70
|
+
config.subject = "chinh Support needed.."
|
71
|
+
config.description = "chinh Some details on the issue ..."
|
72
|
+
config.email = "tom@outerspace.com"
|
73
|
+
end
|
74
|
+
|
75
|
+
puts "-------------------------"
|
76
|
+
puts __FILE__
|
77
|
+
puts "-------------------------"
|
78
|
+
# ZenFreshdesk.create_ticket()
|
56
79
|
|