fgraph 0.1.2 → 0.1.3
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.
- data/README.rdoc +4 -4
- data/VERSION.yml +1 -1
- data/lib/fgraph/client.rb +2 -2
- data/test/fgraph/client_test.rb +8 -8
- data/test/fgraph_test.rb +2 -2
- metadata +3 -3
data/README.rdoc
CHANGED
@@ -106,11 +106,11 @@ OAuth Application Access Token, required to access application anlytics data:
|
|
106
106
|
|
107
107
|
=== FGraph::Client
|
108
108
|
|
109
|
-
#
|
109
|
+
# Initialize with default options
|
110
110
|
fg_client = FGraph::Client.new(:client_id => '...', :client_secret => '...')
|
111
|
-
fg_client.oauth_authorize_url(:
|
112
|
-
fg_client.oauth_access_token(
|
113
|
-
|
111
|
+
fg_client.oauth_authorize_url('[redirect uri]', :scope => 'publish_stream')
|
112
|
+
fg_client.oauth_access_token('[redirect uri]', '[authorization code]')
|
113
|
+
|
114
114
|
# Intialize with access token
|
115
115
|
fg_client = FGraph::Client.new(:access_token => '...')
|
116
116
|
fg_client.me
|
data/VERSION.yml
CHANGED
data/lib/fgraph/client.rb
CHANGED
@@ -21,8 +21,8 @@ module FGraph
|
|
21
21
|
#
|
22
22
|
# # Initialize with default options
|
23
23
|
# fg_client = FGraph::Client.new(:client_id => '...', :client_secret => '...')
|
24
|
-
# fg_client.oauth_authorize_url(:
|
25
|
-
# fg_client.oauth_access_token(
|
24
|
+
# fg_client.oauth_authorize_url('[redirect uri]', :scope => 'publish_stream')
|
25
|
+
# fg_client.oauth_access_token('[redirect uri]', '[authorization code]')
|
26
26
|
#
|
27
27
|
# # Intialize with access token
|
28
28
|
# fg_client = FGraph::Client.new(:access_token => '...')
|
data/test/fgraph/client_test.rb
CHANGED
@@ -20,9 +20,9 @@ class ClientTest < Test::Unit::TestCase
|
|
20
20
|
context "FGraph::Client#oauth_authorize_url" do
|
21
21
|
should "call FGraph.oauth_authorize_url with :client_id option" do
|
22
22
|
FGraph.expects(:oauth_authorize_url).with(FACEBOOK_API_KEY, FACEBOOK_OAUTH_REDIRECT_URI, {
|
23
|
-
:scope => '
|
23
|
+
:scope => 'publish_stream'
|
24
24
|
})
|
25
|
-
fb_client.oauth_authorize_url(FACEBOOK_OAUTH_REDIRECT_URI, :scope => '
|
25
|
+
fb_client.oauth_authorize_url(FACEBOOK_OAUTH_REDIRECT_URI, :scope => 'publish_stream')
|
26
26
|
end
|
27
27
|
end
|
28
28
|
|
@@ -40,10 +40,10 @@ class ClientTest < Test::Unit::TestCase
|
|
40
40
|
object_id = '12345'
|
41
41
|
FGraph.expects(:object).with(object_id,
|
42
42
|
:access_token => FACEBOOK_OAUTH_ACCESS_TOKEN,
|
43
|
-
:fields => '
|
43
|
+
:fields => 'publish_stream'
|
44
44
|
)
|
45
45
|
|
46
|
-
fb_client.object(object_id, :fields => '
|
46
|
+
fb_client.object(object_id, :fields => 'publish_stream')
|
47
47
|
end
|
48
48
|
|
49
49
|
should "support #object_[category] method" do
|
@@ -57,10 +57,10 @@ class ClientTest < Test::Unit::TestCase
|
|
57
57
|
should "call FGraph.objects with :access_token option" do
|
58
58
|
FGraph.expects(:objects).with(['1', '2', {
|
59
59
|
:access_token => FACEBOOK_OAUTH_ACCESS_TOKEN,
|
60
|
-
:fields => '
|
60
|
+
:fields => 'publish_stream'
|
61
61
|
}])
|
62
62
|
|
63
|
-
fb_client.objects('1', '2', :fields => '
|
63
|
+
fb_client.objects('1', '2', :fields => 'publish_stream')
|
64
64
|
end
|
65
65
|
end
|
66
66
|
|
@@ -68,10 +68,10 @@ class ClientTest < Test::Unit::TestCase
|
|
68
68
|
should "call FGraph.me with :access_token option" do
|
69
69
|
FGraph.expects(:me).with([{
|
70
70
|
:access_token => FACEBOOK_OAUTH_ACCESS_TOKEN,
|
71
|
-
:fields => '
|
71
|
+
:fields => 'publish_stream'
|
72
72
|
}])
|
73
73
|
|
74
|
-
fb_client.me(:fields => '
|
74
|
+
fb_client.me(:fields => 'publish_stream')
|
75
75
|
end
|
76
76
|
|
77
77
|
should "support #me_[category] method" do
|
data/test/fgraph_test.rb
CHANGED
@@ -67,11 +67,11 @@ class FGraphTest < Test::Unit::TestCase
|
|
67
67
|
FGraph.expects(:format_url).with('/oauth/authorize', {
|
68
68
|
:client_id => FACEBOOK_API_KEY,
|
69
69
|
:redirect_uri => FACEBOOK_OAUTH_REDIRECT_URI,
|
70
|
-
:scope => '
|
70
|
+
:scope => 'publish_stream'
|
71
71
|
})
|
72
72
|
|
73
73
|
FGraph.oauth_authorize_url(FACEBOOK_API_KEY, FACEBOOK_OAUTH_REDIRECT_URI,
|
74
|
-
:scope => '
|
74
|
+
:scope => 'publish_stream')
|
75
75
|
end
|
76
76
|
end
|
77
77
|
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 1
|
8
|
-
-
|
9
|
-
version: 0.1.
|
8
|
+
- 3
|
9
|
+
version: 0.1.3
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Herryanto Siatono
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2010-05-
|
17
|
+
date: 2010-05-21 00:00:00 +08:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|