mini_fb 2.3.0 → 2.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/mini_fb.rb +4 -10
- data/lib/version.rb +1 -1
- data/spec/mini_fb_spec.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: 3035e3f90f64cfc5e754e9e7a1017cc2c5f41fa5
|
4
|
+
data.tar.gz: 26f1ccd78b203c204eba259b9d673f5d72d14445
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '0969be3dc7034777e972904f70393f6c10013342d4b01bcf770a14efd50bee0578a949817150b90aa1e2482d23d149ea4f5597a4de6b4efe195d5a711678a450'
|
7
|
+
data.tar.gz: 78beff53728a238a059b5bb05bf148c956609fd2b8accb27d804b60ef99a0a488e458dd56e9e9a724c6ee24e11daf9be0e3b1090b013a244241f61e0eff36fd6
|
data/lib/mini_fb.rb
CHANGED
@@ -519,7 +519,7 @@ module MiniFB
|
|
519
519
|
# - app_id: your app ID (string)
|
520
520
|
# - secret: your app secret (string)
|
521
521
|
# - access_token: short-lived user token (string)
|
522
|
-
# returns a hash with one value being 'access_token', the other being '
|
522
|
+
# returns a hash with one value being 'access_token', the other being 'expires_in'
|
523
523
|
#
|
524
524
|
# Throws MiniFB::FaceBookError if response from Facebook Graph API is not successful
|
525
525
|
def self.fb_exchange_token(app_id, secret, access_token)
|
@@ -531,17 +531,11 @@ module MiniFB
|
|
531
531
|
response = @@http.get oauth_url
|
532
532
|
body = response.body.to_s
|
533
533
|
puts 'resp=' + body if @@logging
|
534
|
+
res_hash = JSON.parse(body)
|
534
535
|
unless response.ok?
|
535
|
-
res_hash = JSON.parse(body)
|
536
536
|
raise MiniFB::FaceBookError.new(response.status, "#{res_hash["error"]["type"]}: #{res_hash["error"]["message"]}")
|
537
537
|
end
|
538
|
-
|
539
|
-
params_array = body.split("&")
|
540
|
-
params_array.each do |p|
|
541
|
-
ps = p.split("=")
|
542
|
-
params[ps[0]] = ps[1]
|
543
|
-
end
|
544
|
-
return params
|
538
|
+
return res_hash
|
545
539
|
end
|
546
540
|
|
547
541
|
# Return a JSON object of working Oauth tokens from working session keys, returned in order given
|
@@ -567,7 +561,7 @@ module MiniFB
|
|
567
561
|
options = {}
|
568
562
|
options[:params] = params
|
569
563
|
options[:method] = :get
|
570
|
-
options[:response_type] = :
|
564
|
+
options[:response_type] = :json
|
571
565
|
resp = fetch(url, options)
|
572
566
|
puts 'resp=' + resp.to_s if @@logging
|
573
567
|
resp
|
data/lib/version.rb
CHANGED
data/spec/mini_fb_spec.rb
CHANGED
@@ -41,7 +41,7 @@ describe MiniFB do
|
|
41
41
|
res = MiniFB.fb_exchange_token(app_id, app_secret, access_token)
|
42
42
|
|
43
43
|
expect(res).to include('access_token')
|
44
|
-
expect(res).to include('
|
44
|
+
expect(res).to include('expires_in')
|
45
45
|
end
|
46
46
|
|
47
47
|
it 'raises error on request with invalid params' do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mini_fb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Travis Reeder
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-07-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httpclient
|