help_scout 0.6.0 → 0.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +2 -0
- data/lib/help_scout/version.rb +1 -1
- data/lib/help_scout.rb +8 -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: c18838b8f3d306d2abb411f299fafcadafc2a887
|
4
|
+
data.tar.gz: f796e09b19f5a954065b37cbaf5ed17e189a2728
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c05acce3a643814aeaa6f97ec338f87ad81dfb84cd6c13403eb67af846564914ce0cfa27f4fd3e2da142525aac803de93e05d272c6c63032ab5506d7dd582101
|
7
|
+
data.tar.gz: eb3c81078b5c075ed67f56cdd90a077b31098356ccfc8af16da513abc108772097223cf0f52b7c63a94f7d46f59effd14c15afe801ad721b4dceb0deecd772aa
|
data/Gemfile
CHANGED
data/lib/help_scout/version.rb
CHANGED
data/lib/help_scout.rb
CHANGED
@@ -4,6 +4,8 @@ require "httparty"
|
|
4
4
|
class HelpScout
|
5
5
|
class ValidationError < StandardError; end
|
6
6
|
class NotImplementedError < StandardError; end
|
7
|
+
class NotFoundError < StandardError; end
|
8
|
+
class InternalServerError < StandardError; end
|
7
9
|
|
8
10
|
# Status codes used by Help Scout, not all are implemented in this gem yet.
|
9
11
|
# http://developer.helpscout.net/help-desk-api/status-codes/
|
@@ -11,6 +13,8 @@ class HelpScout
|
|
11
13
|
HTTP_CREATED = 201
|
12
14
|
HTTP_NO_CONTENT = 204
|
13
15
|
HTTP_BAD_REQUEST = 400
|
16
|
+
HTTP_NOT_FOUND = 404
|
17
|
+
HTTP_INTERNAL_SERVER_ERROR = 500
|
14
18
|
|
15
19
|
attr_accessor :last_response
|
16
20
|
|
@@ -198,6 +202,10 @@ class HelpScout
|
|
198
202
|
@last_response.parsed_response
|
199
203
|
when HTTP_BAD_REQUEST
|
200
204
|
raise ValidationError, last_response.parsed_response["message"]
|
205
|
+
when HTTP_NOT_FOUND
|
206
|
+
raise NotFoundError
|
207
|
+
when HTTP_INTERNAL_SERVER_ERROR
|
208
|
+
raise InternalServerError
|
201
209
|
else
|
202
210
|
raise NotImplementedError, "Help Scout returned something that is not implemented by the help_scout gem yet: #{@last_response.code}: #{@last_response.parsed_response["message"] if @last_response.parsed_response}"
|
203
211
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: help_scout
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dennis Paagman
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: exe
|
12
12
|
cert_chain: []
|
13
|
-
date: 2017-08-
|
13
|
+
date: 2017-08-31 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: httparty
|