fgraph 0.5.1 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
data/History CHANGED
@@ -1,3 +1,6 @@
1
+ v0.6.0
2
+ * Add status, cookie, and xfbml options to fgraph_javascript_init_tag
3
+
1
4
  v0.5.0
2
5
  * Update httparty dependency
3
6
 
data/VERSION.yml CHANGED
@@ -1,5 +1,5 @@
1
1
  ---
2
- :patch: 1
2
+ :patch: 0
3
3
  :build:
4
4
  :major: 0
5
- :minor: 5
5
+ :minor: 6
@@ -11,22 +11,31 @@ module FGraph
11
11
  # * <tt>app_id</tt> - overrride Fgraph.config['app_id'] value.
12
12
  # * <tt>async</tt> - asynchronous javascript include & initialization.
13
13
  # for other Facebook JS initialization codes please wrap under:
14
- #
14
+ # * <tt>status</tt> - default: false, will check login status, and auto-login user if they are connected
15
+ # * <tt>cookie</tt> - default: true, auto set cookies
16
+ # * <tt>xfbml</tt> - default: true, auto parse xfbml tags
17
+ #
18
+ # If async is set to true, the callback function is window.afterFbAsyncInit, e.g.
15
19
  # window.afterFbAsyncInit = function() {
16
20
  # ....
17
21
  # }
18
22
  #
19
23
  def fgraph_javascript_init_tag(options={})
20
- options = { :app_id => FGraph.config['app_id'] }.merge(options || {})
24
+ options = { :app_id => FGraph.config['app_id'],
25
+ :status => true,
26
+ :cookie => true,
27
+ :xfbml => true
28
+ }.merge(options || {})
29
+
30
+ fb_init = "FB.init({appId: '#{options[:app_id]}', status: #{options[:status]}, cookie: #{options[:cookie]}, xfbml: #{options[:xfbml]}});"
21
31
 
22
32
  if options[:async]
23
33
  %{
24
34
  <div id="fb-root"></div>
25
35
  <script>
26
36
  window.fbAsyncInit = function() {
27
- FB.init({appId: '#{options[:app_id]}', status: true, cookie: true,
28
- xfbml: true});
29
-
37
+ #{fb_init}
38
+
30
39
  if (window.afterFbAsyncInit) {
31
40
  window.afterFbAsyncInit();
32
41
  }
@@ -44,7 +53,7 @@ module FGraph
44
53
  tag << %{
45
54
  <div id="fb-root"></div>
46
55
  <script>
47
- FB.init({appId: '#{options[:app_id]}', status: true, cookie: true, xfbml: true});
56
+ #{fb_init}
48
57
  </script>
49
58
  }
50
59
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fgraph
3
3
  version: !ruby/object:Gem::Version
4
- hash: 9
4
+ hash: 7
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
- - 5
9
- - 1
10
- version: 0.5.1
8
+ - 6
9
+ - 0
10
+ version: 0.6.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - Herryanto Siatono
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-11-13 00:00:00 +08:00
18
+ date: 2011-02-25 00:00:00 +08:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -116,8 +116,8 @@ homepage: http://github.com/jugend/fgraph
116
116
  licenses: []
117
117
 
118
118
  post_install_message:
119
- rdoc_options:
120
- - --charset=UTF-8
119
+ rdoc_options: []
120
+
121
121
  require_paths:
122
122
  - lib
123
123
  required_ruby_version: !ruby/object:Gem::Requirement
@@ -146,8 +146,8 @@ signing_key:
146
146
  specification_version: 3
147
147
  summary: Ruby Facebook Graph API
148
148
  test_files:
149
+ - examples/get_access_token.rb
150
+ - examples/publish_feed.rb
149
151
  - test/fgraph/client_test.rb
150
152
  - test/fgraph_test.rb
151
153
  - test/test_helper.rb
152
- - examples/get_access_token.rb
153
- - examples/publish_feed.rb