commit 292f1f35d7b3d56ed03b3dc452ecde290301ac0e
parent 85930e2fbce835152c4bb656462a8436fabab96c
Author: Rich Lane <rlane@club.cc.cmu.edu>
Date: Wed, 13 Jan 2010 10:13:40 -0800
fix ask_for_contacts on Ruby 1.9
String doesn't respond to :map anymore. The previous code was also joining with
" " instead of ", ", which was broken.
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/sup/buffer.rb b/lib/sup/buffer.rb
@@ -535,7 +535,7 @@ EOS
end
def ask_for_contacts domain, question, default_contacts=[]
- default = default_contacts.map { |s| s.to_s }.join(" ")
+ default = default_contacts.is_a?(String) ? default_contacts : default_contacts.map { |s| s.to_s }.join(", ")
default += " " unless default.empty?
recent = Index.load_contacts(AccountManager.user_emails, :num => 10).map { |c| [c.full_address, c.email] }