decathlon-https 0.1.0 → 0.1.1
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/decathlon/https.rb +6 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5e77e52e06d2a1439a50db956aa191d1546e841855335ab49ba8ee09f07b47d2
|
4
|
+
data.tar.gz: db61d7f4884ea36931e238a2f3c246253b86a643ff810ff236c114ff4f5d2986
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6c0d324ae1d0ba10408c1ac4b7cee0f7e1451df585a713a6f3573bae8fda5a68bbabd6931ea9fc6f3cdbb0c19caeec72ec14a2e1f057d4462f084c94848bb3db
|
7
|
+
data.tar.gz: 1ee31ed60530112ec4e70bd189fb30c6daa9ee53501933abeeb21d474204ac028677e188d71228ab4eada0b88d7d1b74ea152c0f86986085536ca34b13df7aa5
|
data/lib/decathlon/https.rb
CHANGED
@@ -9,7 +9,7 @@ module Decathlon
|
|
9
9
|
#
|
10
10
|
module HTTPS
|
11
11
|
|
12
|
-
VERSION = "0.1.
|
12
|
+
VERSION = "0.1.1"
|
13
13
|
|
14
14
|
def self.json_api_request(base_url: '', params: {}, verb: :get, headers: {})
|
15
15
|
|
@@ -59,7 +59,11 @@ module Decathlon
|
|
59
59
|
|
60
60
|
# Make an HTTPS query to the host and return a symbolized hash of the JSON response
|
61
61
|
#
|
62
|
-
|
62
|
+
response = http.request(request)
|
63
|
+
code = response.code.to_i
|
64
|
+
body = response.body.to_s
|
65
|
+
return {} if code == 204 || (body.empty? && code < 400)
|
66
|
+
return JSON.parse(body, symbolize_names: true)
|
63
67
|
|
64
68
|
end
|
65
69
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: decathlon-https
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jack Hayter
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-07-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|