fb-auth 1.0.0.alpha1 → 1.0.0.alpha2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/fb/auth.rb +1 -1
- data/lib/fb/auth/version.rb +1 -1
- metadata +2 -4
- data/lib/fb/error.rb +0 -5
- data/lib/fb/request.rb +0 -38
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 790daa9f0ee7a7ae4c1d1b3060ddd7f55e452406
|
4
|
+
data.tar.gz: 4ca8950d88c280f2c2b334879d82e7a448374512
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: aae5e94da39c94e1b875639fdd6c326262397265ef19008077be5398b37524286a9e5ec2d028eb753e7afd64e14d3163f5d45847cec22daeb7aa794c0ee9a565
|
7
|
+
data.tar.gz: 29baef9efcae55f9b0a99504e7d50760a4d1c9433d7ca510cb7b356e95f00ae3ffa9272f37f35edd2319dc21b937c56438e995de2fb766c1f13895afe07a710f
|
data/README.md
CHANGED
@@ -63,7 +63,7 @@ Fb::Auth.new(redirect_uri: redirect_uri, code: code).access_token
|
|
63
63
|
|
64
64
|
After checking out the repo, run `bin/setup` to install dependencies.
|
65
65
|
If you would like to run tests for Fb::Auth, please obtain a long-term access token that manages at least one page
|
66
|
-
and has permission to read your Facebook email (set scope to include `email`
|
66
|
+
and has permission to read your Facebook email (set scope to include `email`, `pages_show_list`, & `read_insights`). Then set the token as
|
67
67
|
as an environment variable:
|
68
68
|
|
69
69
|
export FB_TEST_ACCESS_TOKEN="YourToken"
|
data/lib/fb/auth.rb
CHANGED
data/lib/fb/auth/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fb-auth
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.0.
|
4
|
+
version: 1.0.0.alpha2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Aaron Dao
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date: 2017-07-
|
12
|
+
date: 2017-07-26 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: fb-support
|
@@ -119,8 +119,6 @@ files:
|
|
119
119
|
- fb-auth.gemspec
|
120
120
|
- lib/fb/auth.rb
|
121
121
|
- lib/fb/auth/version.rb
|
122
|
-
- lib/fb/error.rb
|
123
|
-
- lib/fb/request.rb
|
124
122
|
homepage: https://github.com/Fullscreen/fb-auth
|
125
123
|
licenses:
|
126
124
|
- MIT
|
data/lib/fb/error.rb
DELETED
data/lib/fb/request.rb
DELETED
@@ -1,38 +0,0 @@
|
|
1
|
-
require 'uri'
|
2
|
-
require 'net/http'
|
3
|
-
require 'json'
|
4
|
-
require 'fb/error'
|
5
|
-
|
6
|
-
module Fb
|
7
|
-
# @private
|
8
|
-
class Request
|
9
|
-
def initialize(options = {})
|
10
|
-
@host = options.fetch :host, 'graph.facebook.com'
|
11
|
-
@path = options[:path]
|
12
|
-
@params = options.fetch :params, {}
|
13
|
-
unless @params.include? :access_token
|
14
|
-
@params.merge!(client_id: Fb.configuration.client_id)
|
15
|
-
end
|
16
|
-
end
|
17
|
-
|
18
|
-
def url
|
19
|
-
uri.to_s
|
20
|
-
end
|
21
|
-
|
22
|
-
def run
|
23
|
-
res = Net::HTTP.get_response(uri)
|
24
|
-
unless res.is_a?(Net::HTTPSuccess)
|
25
|
-
message = JSON.parse(res.body)["error"]["message"]
|
26
|
-
raise Fb::Error, message
|
27
|
-
end
|
28
|
-
JSON.parse(res.body)
|
29
|
-
end
|
30
|
-
|
31
|
-
private
|
32
|
-
|
33
|
-
def uri
|
34
|
-
query = URI.encode_www_form @params
|
35
|
-
URI::HTTPS.build host: @host, path: @path, query: query
|
36
|
-
end
|
37
|
-
end
|
38
|
-
end
|