rfacebook 0.8.3 → 0.8.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -166,7 +166,7 @@ class FacebookSession
166
166
 
167
167
  def cached_call_method(method,params)
168
168
  key = cache_key_for(method,params)
169
- @logger.debug "RFacebook::FacebookSession\#cached_call_method - #{method}(#{params.inspect}) - attempting to hit cache" if @logger
169
+ @logger.debug "** RFacebook::FacebookSession\#cached_call_method - #{method}(#{params.inspect}) - attempting to hit cache" if @logger
170
170
  return @callcache[key] ||= call_method(method,params)
171
171
  end
172
172
 
@@ -191,7 +191,7 @@ class FacebookSession
191
191
  # use_ssl - set to true if the call will be made over SSL
192
192
  def call_method(method, params={}, use_ssl=false)
193
193
 
194
- @logger.debug "RFacebook::FacebookSession\#call_method - #{method}(#{params.inspect}) - making remote call" if @logger
194
+ @logger.debug "** RFacebook::FacebookSession\#call_method - #{method}(#{params.inspect}) - making remote call" if @logger
195
195
 
196
196
  # ensure that this object has been activated somehow
197
197
  if (!method.include?("auth") and !is_activated?)
@@ -225,12 +225,13 @@ class FacebookSession
225
225
 
226
226
  # do the request
227
227
  xmlstring = post_request(@api_server_base_url, @api_server_path, method, params, use_ssl)
228
+ # @logger.debug "** RFacebook::FacebookSession\#call_method - #{method}(#{params.inspect}) - raw XML response: #{xmlstring}" if @logger
228
229
  xml = Facepricot.new(xmlstring)
229
230
 
230
231
  # error checking
231
232
  if xml.at("error_response")
232
233
 
233
- @logger.debug "RFacebook::FacebookSession\#call_method - #{method}(#{params.inspect}) - remote call failed" if @logger
234
+ @logger.debug "** RFacebook::FacebookSession\#call_method - #{method}(#{params.inspect}) - remote call failed" if @logger
234
235
 
235
236
  @last_call_was_successful = false
236
237
  code = xml.at("error_code").inner_html
@@ -107,6 +107,7 @@ module RFacebook
107
107
  if (facebookUid and facebookSessionKey and expirationTime)
108
108
  # Method 1: we have the user id and key from the fb_sig_ params
109
109
  @fbsession.activate_with_previous_session(facebookSessionKey, facebookUid, expirationTime)
110
+ RAILS_DEFAULT_LOGGER.debug "** rfacebook: Activated session from inside the canvas"
110
111
 
111
112
  elsif (!in_facebook_canvas? and session[:rfacebook_fbsession])
112
113
  # Method 2: we've logged in the user already
@@ -115,6 +116,10 @@ module RFacebook
115
116
  end
116
117
 
117
118
  end
119
+
120
+ if @fbsession
121
+ @fbsession.logger = RAILS_DEFAULT_LOGGER
122
+ end
118
123
 
119
124
  return @fbsession
120
125
 
@@ -124,7 +129,7 @@ module RFacebook
124
129
 
125
130
  # DEPRECATED
126
131
  def facebook_redirect_to(url)
127
- RAILS_DEFAULT_LOGGER.info "DEPRECATION NOTICE: facebook_redirect_to is deprecated in RFacebook, redirect_to works like any Rails app since 0.8.2"
132
+ RAILS_DEFAULT_LOGGER.info "DEPRECATION NOTICE: facebook_redirect_to is deprecated in RFacebook. Instead, you can use redirect_to like any Rails app."
128
133
  if in_facebook_canvas?
129
134
  render :text => "<fb:redirect url=\"#{url}\" />"
130
135
  elsif url =~ /^https?:\/\/([^\/]*\.)?facebook\.com(:\d+)?/i
@@ -233,13 +238,16 @@ module RFacebook
233
238
  return path
234
239
  end
235
240
 
241
+
242
+ alias_method(:redirect_to__ALIASED, :redirect_to)
243
+
236
244
  def redirect_to(options = {}, *parameters)
237
245
  if in_facebook_canvas?
238
246
  RAILS_DEFAULT_LOGGER.debug "** Canvas redirect to #{url_for(options)}"
239
247
  render :text => "<fb:redirect url=\"#{url_for(options)}\" />"
240
248
  else
241
249
  RAILS_DEFAULT_LOGGER.debug "** Regular redirect_to"
242
- redirect_to(options, *parameters)
250
+ redirect_to__ALIASED(options, *parameters)
243
251
  end
244
252
  end
245
253
 
@@ -117,10 +117,18 @@ production:
117
117
  puts "* ensure that you have Rails running on your local machine at port #{localPort}"
118
118
  puts "* once logged in to the tunnel, you can visit http://#{remoteHost}:#{remotePort} to view your site"
119
119
  puts "* use ctrl-c to quit the tunnel"
120
+ puts "* if you have problems creating the tunnel, you may need to add the following to /etc/ssh/sshd_config on your server:"
121
+ puts "
122
+
123
+ GatewayPorts clientspecified
124
+
125
+ "
120
126
  puts "* if you have problems with #{remoteHost} timing out your ssh connection, add the following lines to your '~/.ssh/config' file:"
121
127
  puts "
128
+
122
129
  Host #{remoteHost}
123
130
  ServerAliveInterval 120
131
+
124
132
  "
125
133
  puts "======================================================"
126
134
  exec "#{cmd} -nNT -g -R *:#{remotePort}:0.0.0.0:#{localPort} #{remoteUsername}@#{remoteHost}"
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.3
7
- date: 2007-08-07 00:00:00 -07:00
6
+ version: 0.8.4
7
+ date: 2007-08-08 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