tops_connect 0.3.4 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/tops_connect/client.rb +13 -4
- data/lib/tops_connect/configuration.rb +0 -3
- data/lib/tops_connect/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3430e8a541b493b7f8463528b31f2d9c3e29a867
|
4
|
+
data.tar.gz: 4d60f6d1530827e9b9f66403ce56ce7a0dfa43b0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f6f7280592da6ee403a2afccf71824a92c52d174e08f61da5d019cd372ab53d83d9462a12de932fc36965d5755a87507e4182c5bc91f10ba1ad8001479805aa5
|
7
|
+
data.tar.gz: f9dff07b8f31a2abb8902ae8fee21fe752cdd89a410b88737249c02d9596912f8617ae1e7ba584b958fb92a9efc51dec8335d25aae3cb1eb664a7315d8af3e9f
|
data/lib/tops_connect/client.rb
CHANGED
@@ -37,13 +37,22 @@ module TopsConnect
|
|
37
37
|
when 200
|
38
38
|
response.parsed_response
|
39
39
|
when 400..499
|
40
|
-
raise BadRequest, response.parsed_response['
|
40
|
+
raise TopsConnect::BadRequest, response.parsed_response['Message']
|
41
|
+
when 500..599
|
42
|
+
raise TopsConnect::InternalError, response.parsed_response['Message']
|
41
43
|
else
|
42
|
-
raise
|
44
|
+
raise TopsConnect::ApiError,
|
45
|
+
"#{response.code}: #{response.parsed_response['Message']}"
|
43
46
|
end
|
44
47
|
end
|
48
|
+
end
|
45
49
|
|
46
|
-
|
47
|
-
|
50
|
+
class ApiError < ::RuntimeError
|
51
|
+
end
|
52
|
+
|
53
|
+
class BadRequest < ApiError
|
54
|
+
end
|
55
|
+
|
56
|
+
class InternalError < ApiError
|
48
57
|
end
|
49
58
|
end
|
data/lib/tops_connect/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tops_connect
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Steven Hoffman
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-01-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -128,7 +128,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
128
128
|
version: '0'
|
129
129
|
requirements: []
|
130
130
|
rubyforge_project:
|
131
|
-
rubygems_version: 2.6.
|
131
|
+
rubygems_version: 2.6.8
|
132
132
|
signing_key:
|
133
133
|
specification_version: 4
|
134
134
|
summary: Make use of the Tops Connect API
|