help_scout 0.6.0 → 0.7.0

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 81382f7b709606575977992773cbf146b9063a6f
4
- data.tar.gz: 9d50c47b51f8beff738cc166ff0f41b66aea5cee
3
+ metadata.gz: c18838b8f3d306d2abb411f299fafcadafc2a887
4
+ data.tar.gz: f796e09b19f5a954065b37cbaf5ed17e189a2728
5
5
  SHA512:
6
- metadata.gz: 4c0d08c3dc4e5a25f98b022419c612b92e9008b8ba0fd0649f539dc153982a7b2a6a9a14336e6cade5215226ff34d35ac66dec7c62200c23b07b48da852555db
7
- data.tar.gz: 4436eeb10dbb398874b2fa89dd34b7e01fdeeab4f4684e30582dddf4d8820d53925426758f4285316702382ee0c2e62060b4a6feae01342cda47bc6b28cb7256
6
+ metadata.gz: c05acce3a643814aeaa6f97ec338f87ad81dfb84cd6c13403eb67af846564914ce0cfa27f4fd3e2da142525aac803de93e05d272c6c63032ab5506d7dd582101
7
+ data.tar.gz: eb3c81078b5c075ed67f56cdd90a077b31098356ccfc8af16da513abc108772097223cf0f52b7c63a94f7d46f59effd14c15afe801ad721b4dceb0deecd772aa
data/Gemfile CHANGED
@@ -1,4 +1,6 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
+ ruby '2.4.1'
4
+
3
5
  # Specify your gem's dependencies in help_scout.gemspec
4
6
  gemspec
@@ -1,3 +1,3 @@
1
1
  class HelpScout
2
- VERSION = "0.6.0"
2
+ VERSION = "0.7.0"
3
3
  end
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.6.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-29 00:00:00.000000000 Z
13
+ date: 2017-08-31 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: httparty