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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ce63ff50e3e052b9baa6a9f6f6c45e9a5a7f2ed5
4
- data.tar.gz: 7f0e9b25392ce4a3e8ee142fba08046c6162915b
3
+ metadata.gz: cad71c4845ac7dc8ce71b2306a695006543660ca
4
+ data.tar.gz: 1cf589d15afc74e731b46a84f31d1288aab247be
5
5
  SHA512:
6
- metadata.gz: 6e34d35e48b004a332d754bf4ca95b41841ba2aba0a4071e4f583b4d311855f045d7444fc5e30a91fa751cf7aefb1e245289be6932bd283cb2bba0aba04058aa
7
- data.tar.gz: e3763513e988b90137f7160a023faf59ebe03f1a84d37ae148da4aa7cb988c8716b4c14a01e4469317dcec4daa9eb0082aa1722cf836c071c0ca75c9b2c56e0a
6
+ metadata.gz: e3bf0d98484b8b9b784c6401789799b2da515735ef6c2538d54f0d345974059807c54be2146f868305af2f07ed2de0790513aed9bc24d451c41f9dda7e2c982a
7
+ data.tar.gz: 6289598474e1d772157b00a78f36a9c304dcc62165b517d6ce95000712342890296b41044653380f33d17c29bd8de201d166d1fd9034988c83700118c4d08524
@@ -1,3 +1,9 @@
1
+ # v0.6.2
2
+ - ApiHammer::RequestLogger response body fix
3
+
4
+ # v0.6.1
5
+ - broken release, yanked
6
+
1
7
  # v0.6.0
2
8
  - ApiHammer::RailsOrSidekiqLogger
3
9
 
@@ -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
@@ -1,3 +1,3 @@
1
1
  module ApiHammer
2
- VERSION = "0.6.0"
2
+ VERSION = "0.6.2"
3
3
  end
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.0
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-05 00:00:00.000000000 Z
11
+ date: 2014-08-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rack