Skip to content

Commit

Permalink
Merge commit 'mmangino/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
Erik Ogan committed Aug 17, 2010
2 parents 7743ddb + 5b6ad81 commit d4f24b9
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 6 deletions.
8 changes: 8 additions & 0 deletions lib/facebooker/attachment.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,14 @@ def add_flash(swfsource, imgsource, width=nil, height=nil, expanded_width=nil, e
params[:expanded_height] = expanded_height unless expanded_height.nil?
add_media(params)
end


def add_property(key, value)
@storage[:properties] ||= {}
@storage[:properties][key] = value
end



def to_hash
@storage
Expand Down
4 changes: 2 additions & 2 deletions lib/facebooker/rails/facebook_url_rewriting.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def link_to_new_canvas?
one_or_true @request.parameters["fb_sig_in_new_facebook"]
end

def link_to_canvas?(params, options)
def link_to_canvas?(options)
option_override = options[:canvas]
return false if option_override == false # important to check for false. nil should use default behavior
option_override || (can_safely_access_request_parameters? && (one_or_true(@request.parameters["fb_sig_in_canvas"]) || one_or_true(@request.parameters[:fb_sig_in_canvas]) || one_or_true(@request.parameters["fb_sig_is_ajax"]) ))
Expand All @@ -44,7 +44,7 @@ def can_safely_access_request_parameters?

def rewrite_url_with_facebooker(*args)
options = args.first.is_a?(Hash) ? args.first : args.last
is_link_to_canvas = @request.env["REQUEST_METHOD"] == "POST" && link_to_canvas?(@request.request_parameters, options)
is_link_to_canvas = link_to_canvas?(options)
if is_link_to_canvas && !options.has_key?(:host)
options[:host] = Facebooker.canvas_server_base
end
Expand Down
2 changes: 1 addition & 1 deletion lib/facebooker/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module Facebooker #:nodoc:
module VERSION #:nodoc:
MAJOR = 1
MINOR = 0
TINY = 71
TINY = 74

STRING = [MAJOR, MINOR, TINY].join('.')
end
Expand Down
4 changes: 2 additions & 2 deletions lib/tasks/facebooker.rake
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ namespace :facebooker do
task :setup => :environment do
facebook_config = File.join(RAILS_ROOT,"config","facebooker.yml")
unless File.exist?(facebook_config)
plugin_root = File.join(RAILS_ROOT,"vendor","plugins")
facebook_config_tpl = File.join(plugin_root,"facebooker","generators","facebook","templates","config","facebooker.yml")
facebooker_root = File.expand_path(File.join(File.dirname(__FILE__),"..",".."))
facebook_config_tpl = File.join(facebooker_root,"generators","facebook","templates","config","facebooker.yml")
FileUtils.cp facebook_config_tpl, facebook_config
puts "Ensure 'GatewayPorts yes' is enabled in the remote development server's sshd config when using any of the facebooker:tunnel:*' rake tasks"
puts "Configuration created in #{RAILS_ROOT}/config/facebooker.yml"
Expand Down
2 changes: 1 addition & 1 deletion test/test_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
require 'multi_rails_init'
rescue LoadError
# multi rails not installed, test against newest supported version of Rails
gem 'rails', '2.3.8'
gem 'rails', (ENV['RAILS_VERSION'] || '2.3.8')
end
require 'active_support'
require 'flexmock/test_unit'
Expand Down

0 comments on commit d4f24b9

Please sign in to comment.