zendesk_api 1.3.8 → 1.3.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +1 -0
- data/lib/zendesk_api/actions.rb +11 -0
- data/lib/zendesk_api/resource.rb +0 -6
- data/lib/zendesk_api/version.rb +1 -1
- data/spec/core/spec_helper.rb +9 -0
- 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: 29e998ef5ac29f169434e9f790efadefacb2643f
|
4
|
+
data.tar.gz: 4c04948d4dbe97717235756b3d966f90de072b5a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1ff31fb5fc88df8a3eba6d624fc838a6e2a339184dbd66749cefe7a097a6e01877524a95215f75bb8d7cb5625c43719aaf247a2df61df23dc2bc99368b364824
|
7
|
+
data.tar.gz: 9a02b1a2563b332facca8b17a3a2469e3765a406c46ae1f5a39110b8a3cb206cd39417f5764903f48dd23626f4e0dcf81c64e06e25e2ee9cc5a8b10cb63363aa
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -15,6 +15,7 @@ Please check out the [wiki](https://github.com/zendesk/zendesk_api_client_rb/wik
|
|
15
15
|
* Version 0.3.2 introduced a regression when side-loading roles on users. This was fixed in 0.3.4.
|
16
16
|
* Version 1.0.0 changes the way errors are handled. Please see the [wiki page](https://github.com/zendesk/zendesk_api_client_rb/wiki/Errors) for more info.
|
17
17
|
* Version 1.3.0 updates the Faraday dependency to 0.9. Since Faraday did not bump a major version we have not either, but there is no guarantee >= 1.3.0 works with Faraday < 0.9
|
18
|
+
* Version 1.3.8 had a bug where attachments were created, but the response was not handled properly
|
18
19
|
|
19
20
|
## Installation
|
20
21
|
|
data/lib/zendesk_api/actions.rb
CHANGED
@@ -1,5 +1,15 @@
|
|
1
1
|
module ZendeskAPI
|
2
|
+
module ResponseHandler
|
3
|
+
def handle_response(response)
|
4
|
+
if response.body && response.body[self.class.singular_resource_name]
|
5
|
+
@attributes.replace(@attributes.deep_merge(response.body[self.class.singular_resource_name]))
|
6
|
+
end
|
7
|
+
end
|
8
|
+
end
|
9
|
+
|
2
10
|
module Save
|
11
|
+
include ResponseHandler
|
12
|
+
|
3
13
|
# If this resource hasn't been deleted, then create or save it.
|
4
14
|
# Executes a POST if it is a {Data#new_record?}, otherwise a PUT.
|
5
15
|
# Merges returned attributes on success.
|
@@ -75,6 +85,7 @@ module ZendeskAPI
|
|
75
85
|
module Read
|
76
86
|
def self.extended(klass)
|
77
87
|
klass.send(:include, ZendeskAPI::Sideloading)
|
88
|
+
klass.send(:include, ResponseHandler)
|
78
89
|
end
|
79
90
|
|
80
91
|
# Finds a resource by an id and any options passed in.
|
data/lib/zendesk_api/resource.rb
CHANGED
@@ -143,12 +143,6 @@ module ZendeskAPI
|
|
143
143
|
class DataResource < Data
|
144
144
|
attr_accessor :error, :error_message
|
145
145
|
extend Verbs
|
146
|
-
|
147
|
-
def handle_response(response)
|
148
|
-
if response.body && response.body[self.class.singular_resource_name]
|
149
|
-
@attributes.replace(@attributes.deep_merge(response.body[self.class.singular_resource_name]))
|
150
|
-
end
|
151
|
-
end
|
152
146
|
end
|
153
147
|
|
154
148
|
# Represents a resource that can only GET
|
data/lib/zendesk_api/version.rb
CHANGED
data/spec/core/spec_helper.rb
CHANGED
@@ -78,6 +78,15 @@ def client
|
|
78
78
|
|
79
79
|
client.config.logger.level = (ENV["LOG"] ? Logger::DEBUG : Logger::WARN)
|
80
80
|
client.config.cache.size = 0
|
81
|
+
client.callbacks.clear
|
82
|
+
|
83
|
+
client.insert_callback do |env|
|
84
|
+
warning = env[:response_headers]["X-Zendesk-API-Warn"]
|
85
|
+
|
86
|
+
if warning && warning !~ /\["access_token"\]/ && client.config.logger
|
87
|
+
client.config.logger.warn "WARNING: #{warning}"
|
88
|
+
end
|
89
|
+
end
|
81
90
|
|
82
91
|
client
|
83
92
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: zendesk_api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Steven Davidovitz
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-06-
|
12
|
+
date: 2014-06-27 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bump
|