fgraph 0.2.1 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- data/History +7 -0
- data/README.rdoc +3 -3
- data/VERSION.yml +2 -2
- data/lib/fgraph/rails/fgraph_helper.rb +6 -0
- data/lib/tasks/fgraph.rake +1 -1
- metadata +4 -4
data/History
CHANGED
data/README.rdoc
CHANGED
@@ -180,13 +180,12 @@ Sample codes:
|
|
180
180
|
<fb:login-button autologoutlink="true" perms="email,publish_stream"></fb:login-button>
|
181
181
|
|
182
182
|
<% if fgraph_logged_in? %>
|
183
|
-
<br>Hello <%=
|
184
|
-
<br><%= fgraph_image_tag(
|
183
|
+
<br>Hello <%= fgraph_user['name'] %>,
|
184
|
+
<br><%= fgraph_image_tag(fgraph_user, 'large') %>
|
185
185
|
<% end %>
|
186
186
|
|
187
187
|
For Asynchronous load, use <tt>window.afterFbAsyncInit</tt>:
|
188
188
|
|
189
|
-
<%= fgraph_javascript_init_tag :async => true %>
|
190
189
|
<script type="text/javascript">
|
191
190
|
window.afterFbAsyncInit = function() {
|
192
191
|
FB.Event.subscribe('auth.sessionChange', function(response) {
|
@@ -198,6 +197,7 @@ For Asynchronous load, use <tt>window.afterFbAsyncInit</tt>:
|
|
198
197
|
});
|
199
198
|
}
|
200
199
|
</script>
|
200
|
+
<%= fgraph_javascript_init_tag :async => true %>
|
201
201
|
|
202
202
|
== License
|
203
203
|
|
data/VERSION.yml
CHANGED
@@ -59,11 +59,17 @@ module FGraph
|
|
59
59
|
return true if fgraph_session and fgraph_access_token
|
60
60
|
end
|
61
61
|
|
62
|
+
# Currently logged in facebook user
|
62
63
|
def fgraph_current_user
|
63
64
|
return @fgraph_current_user if @fgraph_current_user
|
64
65
|
@fgraph_current_user = fgraph_client.me
|
65
66
|
end
|
66
67
|
|
68
|
+
# Alias for fgraph_current_user
|
69
|
+
def fgraph_user
|
70
|
+
fgraph_current_user
|
71
|
+
end
|
72
|
+
|
67
73
|
# Return FGraph::Client instance initialized with settings set in <tt>fgraph.yml</tt>.
|
68
74
|
# Initialized with <tt>:access_token</tt> as well if Facebook session exists.
|
69
75
|
def fgraph_client
|
data/lib/tasks/fgraph.rake
CHANGED
@@ -6,7 +6,7 @@ namespace :fgraph do
|
|
6
6
|
fgraph_config = File.join(RAILS_ROOT, "config", "fgraph.yml")
|
7
7
|
unless File.exist?(fgraph_config)
|
8
8
|
fgraph_config_template = File.join(RAILS_ROOT, "vendor", "plugins", "fgraph", "templates", "fgraph.yml")
|
9
|
-
FileUtils.cp
|
9
|
+
FileUtils.cp fgraph_config_template, fgraph_config
|
10
10
|
puts "#{RAILS_ROOT}/config/fgraph.yml created, please update your app_id and app_secret."
|
11
11
|
else
|
12
12
|
puts "#{RAILS_ROOT}/config/fgraph.yml already exists."
|
metadata
CHANGED
@@ -4,9 +4,9 @@ version: !ruby/object:Gem::Version
|
|
4
4
|
prerelease: false
|
5
5
|
segments:
|
6
6
|
- 0
|
7
|
-
-
|
8
|
-
-
|
9
|
-
version: 0.
|
7
|
+
- 3
|
8
|
+
- 0
|
9
|
+
version: 0.3.0
|
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-
|
17
|
+
date: 2010-06-08 00:00:00 +08:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|