spaceborne 0.1.31 → 0.1.32
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/README.md +2 -1
- data/lib/spaceborne.rb +9 -1
- data/lib/spaceborne/version.rb +1 -1
- 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: 1d0cc2ecd5be2a2cf85fe7df08c05514ab0cb74a5904eaf5b3a8b1c70a2e375f
|
4
|
+
data.tar.gz: 04d190d82b7a1e207ec8f0a24263ac43b141e04350f763a80b86c7362dc60625
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e8c1d2bedc95a45d5320e6b69a116ea470bb200f67e801258c34e3968c0cd6d90021c70890467c68bfd5d63f79bc7688959ac5da921e0faecffae0de690c5287
|
7
|
+
data.tar.gz: 28784cf263020280389d5efa9a45ac19c1fa463c0476dfae384d4b47b5f5683962e483790e2ea6d5a48716d69cde1c6a951fe718824521a1a0df0986a959e3a4
|
data/README.md
CHANGED
@@ -205,8 +205,9 @@ Validation for headers follows the same pattern as above, although nesting of mu
|
|
205
205
|
* `expect_header_types same arguments/handling as expect_json_types`
|
206
206
|
5. It is possible to use non-json data in a request
|
207
207
|
6. Expectations on a response with an array of hashes with keys that are unknown, but that have a defined structure are supported (using the '*' in a path)
|
208
|
+
7. Responses that have header with Content-Encoding of gzip are gunzip'd in json_body
|
208
209
|
|
209
|
-
The following example shows how
|
210
|
+
The following example shows how extension # 6 works
|
210
211
|
|
211
212
|
```ruby
|
212
213
|
{ "array_of_hashes": [
|
data/lib/spaceborne.rb
CHANGED
@@ -58,8 +58,16 @@ end
|
|
58
58
|
|
59
59
|
# monkeypatch Airborne
|
60
60
|
module Airborne
|
61
|
+
def decode_body
|
62
|
+
if response.headers[:content_encoding]&.include?('gzip')
|
63
|
+
Zlib::Inflate.new(32 + Zlib::MAX_WBITS).inflate(response.body)
|
64
|
+
else
|
65
|
+
response.body
|
66
|
+
end
|
67
|
+
end
|
68
|
+
|
61
69
|
def json_body
|
62
|
-
@json_body ||= JSON.parse(
|
70
|
+
@json_body ||= JSON.parse(decode_body, symbolize_names: true)
|
63
71
|
rescue StandardError
|
64
72
|
raise InvalidJsonError, 'Api request returned invalid json'
|
65
73
|
end
|
data/lib/spaceborne/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: spaceborne
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.32
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Keith Williams
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-06-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|