tumblr_client 0.7.3 → 0.7.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/tumblr/request.rb +4 -1
- data/lib/tumblr/version.rb +1 -1
- data/spec/examples/request_spec.rb +8 -2
- 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: ecc8127a8745bb00c34c509915e7b1dea17fe217
|
4
|
+
data.tar.gz: 43d700b7291553832d8cfc228d375086b59199a4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5f97c3e68ea50118213909b6c22175ede8f1477ac0a2d7e92e6ae413e05ebaec0918944d2446da7c18ac69ec1e8db826f3940944a1e3fb61d8694442ada43001
|
7
|
+
data.tar.gz: 944090428837163fd7e4973bbe3ffbd7a7cd2a059a8e73b4577a1bb522da72c8726f4d699cfa0ee6b6a9479713d3f22511c93eab0fbb8d65827e1307dc11921b
|
data/lib/tumblr/request.rb
CHANGED
@@ -43,7 +43,10 @@ module Tumblr
|
|
43
43
|
if [201, 200].include?(response.status)
|
44
44
|
response.body['response']
|
45
45
|
else
|
46
|
-
response
|
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
|
|
data/lib/tumblr/version.rb
CHANGED
@@ -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.
|
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-
|
12
|
+
date: 2013-07-15 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: faraday
|