api_hammer 0.6.0 → 0.6.2
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/CHANGELOG.md +6 -0
- data/lib/api_hammer/faraday/request_logger.rb +12 -0
- data/lib/api_hammer/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cad71c4845ac7dc8ce71b2306a695006543660ca
|
4
|
+
data.tar.gz: 1cf589d15afc74e731b46a84f31d1288aab247be
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e3bf0d98484b8b9b784c6401789799b2da515735ef6c2538d54f0d345974059807c54be2146f868305af2f07ed2de0790513aed9bc24d451c41f9dda7e2c982a
|
7
|
+
data.tar.gz: 6289598474e1d772157b00a78f36a9c304dcc62165b517d6ce95000712342890296b41044653380f33d17c29bd8de201d166d1fd9034988c83700118c4d08524
|
data/CHANGELOG.md
CHANGED
@@ -64,6 +64,18 @@ module ApiHammer
|
|
64
64
|
# deal with the vagaries of getting the response body in a form which JSON
|
65
65
|
# gem will not cry about dumping
|
66
66
|
def response_body(response_env)
|
67
|
+
unless response_env.body.is_a?(String)
|
68
|
+
begin
|
69
|
+
# if the response body is not a string, but JSON doesn't complain
|
70
|
+
# about dumping whatever it is, go ahead and use it
|
71
|
+
JSON.dump([response_env.body])
|
72
|
+
return response_env.body
|
73
|
+
rescue
|
74
|
+
# otherwise return nil - don't know what to do with whatever this object is
|
75
|
+
return nil
|
76
|
+
end
|
77
|
+
end
|
78
|
+
|
67
79
|
# first try to change the string's encoding per the Content-Type header
|
68
80
|
content_type = response_env.response_headers['Content-Type']
|
69
81
|
response_body = response_env.body.dup
|
data/lib/api_hammer/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: api_hammer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ethan
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-08-
|
11
|
+
date: 2014-08-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rack
|