zendesk2 0.0.7 → 0.0.8
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.
- data/lib/zendesk2/client.rb +4 -10
- data/lib/zendesk2/version.rb +1 -1
- metadata +1 -1
data/lib/zendesk2/client.rb
CHANGED
@@ -44,13 +44,10 @@ class Zendesk2::Client < Cistern::Service
|
|
44
44
|
subdomain = options[:subdomain] || Zendesk2.defaults[:subdomain]
|
45
45
|
|
46
46
|
host ||= "#{subdomain}.zendesk.com"
|
47
|
-
|
48
|
-
path = options[:path] || "api/v2"
|
49
47
|
scheme = options[:scheme] || "https"
|
50
|
-
|
51
48
|
port = options[:port] || (scheme == "https" ? 443 : 80)
|
52
49
|
|
53
|
-
"#{scheme}://#{host}:#{port}
|
50
|
+
"#{scheme}://#{host}:#{port}"
|
54
51
|
end
|
55
52
|
|
56
53
|
@url = URI.parse(url).to_s
|
@@ -81,7 +78,7 @@ class Zendesk2::Client < Cistern::Service
|
|
81
78
|
|
82
79
|
def request(options={})
|
83
80
|
method = options[:method] || :get
|
84
|
-
url = File.join(@url, options[:path])
|
81
|
+
url = File.join(@url, "/api/v2", options[:path])
|
85
82
|
params = options[:params] || {}
|
86
83
|
body = options[:body]
|
87
84
|
headers = options[:headers] || {}
|
@@ -127,13 +124,10 @@ class Zendesk2::Client < Cistern::Service
|
|
127
124
|
url = options[:url] || begin
|
128
125
|
host = options[:host]
|
129
126
|
host ||= "#{options[:subdomain] || "mock"}.zendesk.com"
|
130
|
-
|
131
|
-
path = options[:path] || "api/v2"
|
132
127
|
scheme = options[:scheme] || "https"
|
133
|
-
|
134
128
|
port = options[:port] || (scheme == "https" ? 443 : 80)
|
135
129
|
|
136
|
-
"#{scheme}://#{host}:#{port}
|
130
|
+
"#{scheme}://#{host}:#{port}"
|
137
131
|
end
|
138
132
|
|
139
133
|
@url = url
|
@@ -152,7 +146,7 @@ class Zendesk2::Client < Cistern::Service
|
|
152
146
|
end
|
153
147
|
|
154
148
|
def url_for(path)
|
155
|
-
File.join(@url, path)
|
149
|
+
File.join(@url, "/api/v2", path)
|
156
150
|
end
|
157
151
|
|
158
152
|
def page(params, collection, path, collection_root, options={})
|
data/lib/zendesk2/version.rb
CHANGED