rxg_client 1.1.1 → 1.1.5
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 +4 -4
- data/lib/rxg_client.rb +21 -4
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 97c8cc6907d34f148f4ed877ceaa81940c65bb310f8692099476188aa109bd37
|
4
|
+
data.tar.gz: a3f88ebc8fd9ce488fc8297d2a934e093a50de80d81444cb1092c252989af805
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ca44c78dabc1a5d271bd2b7370e4cb0f1ee6f26de8db6b26b6e17e9b4ccb012aafcb7b746f7ff7be1c311c06c2c3575bf98a7c7609118b96575da31751aae690
|
7
|
+
data.tar.gz: 4049d4f5de89ba71f01c4f391ed07479671742a9423002266647eac690c95c005a11c0994ecf6dfd429735acc70314d95ea0c41bae4e38104b48f11691a75fc5
|
data/lib/rxg_client.rb
CHANGED
@@ -4,7 +4,8 @@ class RxgClient
|
|
4
4
|
include HTTParty
|
5
5
|
|
6
6
|
attr_accessor :api_key, :hostname, :base_uri, :fleet, :request_format,
|
7
|
-
:raise_exceptions, :verify_ssl, :auth_method, :default_timeout, :debug_output
|
7
|
+
:raise_exceptions, :verify_ssl, :auth_method, :default_timeout, :debug_output,
|
8
|
+
:response_headers
|
8
9
|
|
9
10
|
def request_format= (requested_format)
|
10
11
|
raise HTTParty::UnsupportedFormat unless [ :json, :xml ].include?(requested_format.to_sym)
|
@@ -114,10 +115,17 @@ class RxgClient
|
|
114
115
|
:base_uri => self.base_uri,
|
115
116
|
:timeout => self.default_timeout,
|
116
117
|
:format => self.request_format,
|
117
|
-
:debug_output => self.debug_output
|
118
|
+
:debug_output => self.debug_output,
|
119
|
+
:verify => self.verify_ssl
|
118
120
|
}
|
121
|
+
self.response_headers = nil
|
119
122
|
response = self.class.send(http_method, action, **default_args.merge(args))
|
120
|
-
response.success?
|
123
|
+
if response.success?
|
124
|
+
self.response_headers = response.headers
|
125
|
+
self.parse(response.body)
|
126
|
+
else
|
127
|
+
raise RxgError.new(response.message, response.body)
|
128
|
+
end
|
121
129
|
end
|
122
130
|
end
|
123
131
|
|
@@ -217,4 +225,13 @@ class RxgClient
|
|
217
225
|
raise exception if instance.raise_exceptions
|
218
226
|
end
|
219
227
|
|
220
|
-
end
|
228
|
+
end
|
229
|
+
|
230
|
+
class RxgError < StandardError
|
231
|
+
attr_reader :response_body
|
232
|
+
|
233
|
+
def initialize(msg, response_body=nil)
|
234
|
+
@response_body = response_body
|
235
|
+
super(msg)
|
236
|
+
end
|
237
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rxg_client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Lannar Dean
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-01-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httparty
|
@@ -36,7 +36,7 @@ homepage: https://github.com/rgnets/rxg_client
|
|
36
36
|
licenses:
|
37
37
|
- MIT
|
38
38
|
metadata: {}
|
39
|
-
post_install_message:
|
39
|
+
post_install_message:
|
40
40
|
rdoc_options: []
|
41
41
|
require_paths:
|
42
42
|
- lib
|
@@ -52,7 +52,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
52
52
|
version: '0'
|
53
53
|
requirements: []
|
54
54
|
rubygems_version: 3.0.6
|
55
|
-
signing_key:
|
55
|
+
signing_key:
|
56
56
|
specification_version: 4
|
57
57
|
summary: RXG API Client
|
58
58
|
test_files: []
|