fb-auth 1.0.0.alpha1 → 1.0.0.alpha2

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: b92a001d9a902960bdbb31dfe72cd02191901df1
4
- data.tar.gz: 718e5ac23244e8789bff97d82baeefe2e81c751b
3
+ metadata.gz: 790daa9f0ee7a7ae4c1d1b3060ddd7f55e452406
4
+ data.tar.gz: 4ca8950d88c280f2c2b334879d82e7a448374512
5
5
  SHA512:
6
- metadata.gz: 39775c3dfb582f352fc9d73df5b9b93aec902439b15bba17f0dd890b279ca5794b9f213cd310cf40ed0b85e5a3262072d40f8137e0e154a3b1113753b3bffa8c
7
- data.tar.gz: bdff56d25598cf2bea7d3fd2b934d924a1207c3943648601c76538aeef5bf3fe474b61f7ad16b52e61355a8c793973fcef81d593fca63d69eda8011505f2fc10
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` and `manage_pages`). Then set the token as
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
@@ -40,7 +40,7 @@ module Fb
40
40
  {}.tap do |params|
41
41
  params[:client_id] = Fb.configuration.client_id
42
42
  params[:redirect_uri] = @redirect_uri
43
- params[:scope] = 'email,manage_pages,read_insights'
43
+ params[:scope] = 'email,pages_show_list,read_insights'
44
44
  end
45
45
  end
46
46
 
@@ -2,6 +2,6 @@ module Fb
2
2
  class Auth
3
3
  # @return [String] the SemVer-compatible gem version.
4
4
  # @see http://semver.org
5
- VERSION = '1.0.0.alpha1'
5
+ VERSION = '1.0.0.alpha2'
6
6
  end
7
7
  end
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.alpha1
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-24 00:00:00.000000000 Z
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
@@ -1,5 +0,0 @@
1
- module Fb
2
- # Provides custom errors for Fb intended to be raised on a failed API call.
3
- class Error < StandardError
4
- end
5
- end
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