rfacebook 0.8.4 → 0.8.5
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/lib/facepricot.rb
CHANGED
@@ -221,18 +221,23 @@ module RFacebook
|
|
221
221
|
|
222
222
|
alias_method(:url_for__ALIASED, :url_for)
|
223
223
|
|
224
|
-
def url_for(options={}, *
|
225
|
-
|
226
|
-
|
227
|
-
|
224
|
+
def url_for(options={}, *parameters)
|
225
|
+
if !options
|
226
|
+
RAILS_DEFAULT_LOGGER.info "** options cannot be nil in call to url_for"
|
227
|
+
end
|
228
228
|
if in_facebook_canvas? #TODO: or in_facebook_frame?)
|
229
|
-
|
229
|
+
if options.is_a? Hash
|
230
|
+
options[:only_path] = true
|
231
|
+
end
|
232
|
+
path = url_for__ALIASED(options, *parameters)
|
230
233
|
if path.starts_with?(self.facebook_callback_path)
|
231
234
|
path.gsub!(self.facebook_callback_path, self.facebook_canvas_path)
|
232
235
|
if !options.has_key?(:only_path)
|
233
236
|
path = "http://apps.facebook.com#{path}"
|
234
237
|
end
|
235
238
|
end
|
239
|
+
else
|
240
|
+
path = url_for__ALIASED(options, *parameters)
|
236
241
|
end
|
237
242
|
|
238
243
|
return path
|
@@ -65,12 +65,28 @@ module RFacebook
|
|
65
65
|
end
|
66
66
|
end
|
67
67
|
|
68
|
+
# load Facebook configuration file
|
68
69
|
begin
|
69
70
|
FACEBOOK = YAML.load_file("#{RAILS_ROOT}/config/facebook.yml")[RAILS_ENV]
|
70
71
|
rescue
|
71
72
|
FACEBOOK = {}
|
72
73
|
end
|
73
74
|
|
75
|
+
# make sure the paths have leading and trailing slashes
|
76
|
+
def ensureLeadingAndTrailingSlashesForPath(path)
|
77
|
+
if !path.starts_with?("/")
|
78
|
+
path = "/#{path}"
|
79
|
+
end
|
80
|
+
if !path.reverse.starts_with?("/")
|
81
|
+
path = "#{path}/"
|
82
|
+
end
|
83
|
+
return path
|
84
|
+
end
|
85
|
+
|
86
|
+
FACEBOOK["canvas_path"] = ensureLeadingAndTrailingSlashesForPath(FACEBOOK["canvas_path"])
|
87
|
+
FACEBOOK["callback_path"] = ensureLeadingAndTrailingSlashesForPath(FACEBOOK["callback_path"])
|
88
|
+
|
89
|
+
# inject methods
|
74
90
|
ActionView::Base.send(:include, RFacebook::Rails::ViewExtensions)
|
75
91
|
ActionView::Base.send(:include, RFacebook::Rails::Plugin::ViewExtensions)
|
76
92
|
|
@@ -79,4 +95,3 @@ ActionController::Base.send(:include, RFacebook::Rails::Plugin::ControllerExtens
|
|
79
95
|
|
80
96
|
ActiveRecord::Base.send(:include, RFacebook::Rails::ModelExtensions)
|
81
97
|
ActiveRecord::Base.send(:include, RFacebook::Rails::Plugin::ModelExtensions)
|
82
|
-
|
metadata
CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.9.0
|
|
3
3
|
specification_version: 1
|
4
4
|
name: rfacebook
|
5
5
|
version: !ruby/object:Gem::Version
|
6
|
-
version: 0.8.
|
7
|
-
date: 2007-08-
|
6
|
+
version: 0.8.5
|
7
|
+
date: 2007-08-10 00:00:00 -07:00
|
8
8
|
summary: A Ruby interface to the Facebook API v1.0+ (F8 and beyond). Works with RFacebook on Rails plugin (see rfacebook.rubyforge.org).
|
9
9
|
require_paths:
|
10
10
|
- lib
|