tumblr_client 0.7.3 → 0.7.4

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: d4597029c0d9e24e9a0f7ebc7f3b79cf829ee287
4
- data.tar.gz: cbe00d9e8edcae2fc2f22cef6a9979bedc945736
3
+ metadata.gz: ecc8127a8745bb00c34c509915e7b1dea17fe217
4
+ data.tar.gz: 43d700b7291553832d8cfc228d375086b59199a4
5
5
  SHA512:
6
- metadata.gz: 09c14d78f573c2370b50d85ab1221c8f97388108d8712f578d1efa2406149d30e7fb9a6bf7b173478507df7d7c31f4bfc9aad628ab548072fcf92dcd89ac36d9
7
- data.tar.gz: 04ecbad123bc8274c1f8ec9d62b8597388f7f9e670409d755342131114e85e756bfc2bb35d3ce139a8889c77a53e564471639a79cebc273682c964a49d04b5bf
6
+ metadata.gz: 5f97c3e68ea50118213909b6c22175ede8f1477ac0a2d7e92e6ae413e05ebaec0918944d2446da7c18ac69ec1e8db826f3940944a1e3fb61d8694442ada43001
7
+ data.tar.gz: 944090428837163fd7e4973bbe3ffbd7a7cd2a059a8e73b4577a1bb522da72c8726f4d699cfa0ee6b6a9479713d3f22511c93eab0fbb8d65827e1307dc11921b
@@ -43,7 +43,10 @@ module Tumblr
43
43
  if [201, 200].include?(response.status)
44
44
  response.body['response']
45
45
  else
46
- response.body['meta']
46
+ # surface the meta alongside response
47
+ res = response.body['meta'] || {}
48
+ res.merge! response.body['response'] if response.body['response'].is_a?(Hash)
49
+ res
47
50
  end
48
51
  end
49
52
 
@@ -1,5 +1,5 @@
1
1
  module Tumblr
2
2
 
3
- VERSION = '0.7.3'
3
+ VERSION = '0.7.4'
4
4
 
5
5
  end
@@ -22,9 +22,15 @@ describe Tumblr::Request do
22
22
 
23
23
  context 'with an error response' do
24
24
 
25
- it 'should return the meta object' do
25
+ it 'should return the meta object (merged with response)' do
26
26
  meta = { :message => 'ohno' }
27
- response = OpenStruct.new(:status => 401, :body => { 'meta' => meta })
27
+ response = OpenStruct.new(:status => 401, :body => { 'meta' => meta, 'response' => { :also => 'hi' } })
28
+ client.respond(response).should == { :message => 'ohno', :also => 'hi' }
29
+ end
30
+
31
+ it 'should return the meta object even when response is nil' do
32
+ meta = { :message => 'ohno' }
33
+ response = OpenStruct.new(:status => 401, :body => { 'meta' => meta, 'response' => nil })
28
34
  client.respond(response).should == meta
29
35
  end
30
36
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tumblr_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.3
4
+ version: 0.7.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Bunting
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-05-29 00:00:00.000000000 Z
12
+ date: 2013-07-15 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: faraday