facebooker2 0.0.12 → 0.0.13

Sign up to get free protection for your applications and to get access to all the features.
data/lib/facebooker2.rb CHANGED
@@ -2,7 +2,7 @@
2
2
  require "mogli"
3
3
  module Facebooker2
4
4
 
5
- @oauth2 = false
5
+ @oauth2 = true
6
6
  @cookie_prefix = 'fbs_'
7
7
 
8
8
  class NotConfigured < Exception; end
@@ -17,10 +17,15 @@ module Facebooker2
17
17
  # => <fb:login-button onlogin="window.location.href = &quot;/other_page&quot;;" v="2">Login with Facebook</fb:login-button>
18
18
  #
19
19
  def fb_login_and_redirect(url, options = {})
20
- js = update_page do |page|
21
- page.redirect_to url
20
+ # Check if we got the update_page method (pre-Rails 3.1)
21
+ if respond_to? 'update_page'
22
+ js = update_page do |page|
23
+ page.redirect_to url
24
+ end
25
+ # Else use plain js
26
+ else
27
+ js = "window.location.href = '#{url}'"
22
28
  end
23
-
24
29
  text = options.delete(:text)
25
30
 
26
31
  #rails 3 only escapes non-html_safe strings, so get the raw string instead of the SafeBuffer
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: facebooker2
3
3
  version: !ruby/object:Gem::Version
4
- hash: 7
4
+ hash: 5
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 12
10
- version: 0.0.12
9
+ - 13
10
+ version: 0.0.13
11
11
  platform: ruby
12
12
  authors:
13
13
  - Mike Mangino
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-08-31 00:00:00 -04:00
18
+ date: 2011-09-30 00:00:00 -04:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -26,12 +26,12 @@ dependencies:
26
26
  requirements:
27
27
  - - ">="
28
28
  - !ruby/object:Gem::Version
29
- hash: 7
29
+ hash: 93
30
30
  segments:
31
31
  - 0
32
32
  - 0
33
- - 12
34
- version: 0.0.12
33
+ - 33
34
+ version: 0.0.33
35
35
  type: :runtime
36
36
  version_requirements: *id001
37
37
  - !ruby/object:Gem::Dependency