facebooker2 0.0.5 → 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
data/lib/facebooker2.rb CHANGED
@@ -25,7 +25,7 @@ module Facebooker2
25
25
  end
26
26
 
27
27
  def self.load_facebooker_yaml
28
- config = YAML.load(File.read(File.join(::Rails.root,"config","facebooker.yml")))[::Rails.env]
28
+ config = YAML.load(ERB.new(File.read(File.join(::Rails.root,"config","facebooker.yml"))).result)[::Rails.env]
29
29
  raise NotConfigured.new("Unable to load configuration for #{::Rails.env} from facebooker.yml. Is it set up?") if config.nil?
30
30
  self.configuration = config.with_indifferent_access
31
31
  end
@@ -23,13 +23,14 @@ module Facebooker2
23
23
 
24
24
  text = options.delete(:text)
25
25
 
26
- content_tag("fb:login-button",text,options.merge(:onlogin=>js))
26
+ #rails 3 only escapes non-html_safe strings, so get the raw string instead of the SafeBuffer
27
+ content_tag("fb:login-button",text,options.merge(:onlogin=>js.to_str))
27
28
  end
28
29
 
29
30
  def fb_login(options = {},&proc)
30
31
  js = capture(&proc)
31
32
  text = options.delete(:text)
32
- concat(content_tag("fb:login-button",text,options.merge(:onlogin=>js)))
33
+ concat(content_tag("fb:login-button",text,options.merge(:onlogin=>js.to_str)))
33
34
  end
34
35
 
35
36
  #
@@ -37,7 +38,7 @@ module Facebooker2
37
38
  # args are passed to the call to link_to_function
38
39
  def fb_logout_link(text,url,*args)
39
40
  function= "FB.logout(function() {window.location.href = '#{url}';})"
40
- link_to_function text, function, *args
41
+ link_to_function text, function.to_str, *args
41
42
  end
42
43
 
43
44
  def fb_server_fbml(style=nil,&proc)
@@ -40,7 +40,14 @@ module Facebooker2
40
40
  }());
41
41
  </script>
42
42
  JAVASCRIPT
43
- block_given? ? concat(js) : js
43
+ escaped_js = fb_html_safe(js)
44
+ if block_given?
45
+ concat(escaped_js)
46
+ #return the empty string, since concat returns the buffer and we don't want double output
47
+ # from klochner
48
+ ""
49
+ else
50
+ escaped_js
44
51
  end
45
52
  end
46
53
  end
metadata CHANGED
@@ -1,7 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: facebooker2
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ hash: 19
5
+ prerelease: false
6
+ segments:
7
+ - 0
8
+ - 0
9
+ - 6
10
+ version: 0.0.6
5
11
  platform: ruby
6
12
  authors:
7
13
  - Mike Mangino
@@ -9,29 +15,39 @@ autorequire:
9
15
  bindir: bin
10
16
  cert_chain: []
11
17
 
12
- date: 2010-08-20 00:00:00 -04:00
18
+ date: 2011-01-11 00:00:00 -05:00
13
19
  default_executable:
14
20
  dependencies:
15
21
  - !ruby/object:Gem::Dependency
16
22
  name: mogli
17
- type: :runtime
18
- version_requirement:
19
- version_requirements: !ruby/object:Gem::Requirement
23
+ prerelease: false
24
+ requirement: &id001 !ruby/object:Gem::Requirement
25
+ none: false
20
26
  requirements:
21
27
  - - ">="
22
28
  - !ruby/object:Gem::Version
29
+ hash: 7
30
+ segments:
31
+ - 0
32
+ - 0
33
+ - 12
23
34
  version: 0.0.12
24
- version:
35
+ type: :runtime
36
+ version_requirements: *id001
25
37
  - !ruby/object:Gem::Dependency
26
38
  name: ruby-hmac
27
- type: :runtime
28
- version_requirement:
29
- version_requirements: !ruby/object:Gem::Requirement
39
+ prerelease: false
40
+ requirement: &id002 !ruby/object:Gem::Requirement
41
+ none: false
30
42
  requirements:
31
43
  - - ">="
32
44
  - !ruby/object:Gem::Version
45
+ hash: 3
46
+ segments:
47
+ - 0
33
48
  version: "0"
34
- version:
49
+ type: :runtime
50
+ version_requirements: *id002
35
51
  description: Facebook Connect integration library for ruby and rails
36
52
  email: mmangino@elevatedrails.com
37
53
  executables: []
@@ -59,21 +75,27 @@ rdoc_options: []
59
75
  require_paths:
60
76
  - lib
61
77
  required_ruby_version: !ruby/object:Gem::Requirement
78
+ none: false
62
79
  requirements:
63
80
  - - ">="
64
81
  - !ruby/object:Gem::Version
82
+ hash: 3
83
+ segments:
84
+ - 0
65
85
  version: "0"
66
- version:
67
86
  required_rubygems_version: !ruby/object:Gem::Requirement
87
+ none: false
68
88
  requirements:
69
89
  - - ">="
70
90
  - !ruby/object:Gem::Version
91
+ hash: 3
92
+ segments:
93
+ - 0
71
94
  version: "0"
72
- version:
73
95
  requirements: []
74
96
 
75
97
  rubyforge_project:
76
- rubygems_version: 1.3.5
98
+ rubygems_version: 1.3.7
77
99
  signing_key:
78
100
  specification_version: 3
79
101
  summary: Facebook Connect integration library for ruby and rails