From 617bcfe12e8c98a9b924f656215383d4d5ecb743 Mon Sep 17 00:00:00 2001 From: Nicolas Pouillard Date: Mon, 10 Mar 2008 09:11:17 +0100 Subject: [PATCH] sort contacts when saving contacts.txt This makes sup behave more nicely when contacts.txt is under version control. --- lib/sup/contact.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/sup/contact.rb b/lib/sup/contact.rb index 8050c06..b0c272e 100644 --- a/lib/sup/contact.rb +++ b/lib/sup/contact.rb @@ -51,7 +51,7 @@ class ContactManager def save File.open(@fn, "w") do |f| - @p2a.each do |p, a| + @p2a.sort_by { |(p, a)| [p.full_address, a] }.each do |(p, a)| f.puts "#{a || ''}: #{p.full_address}" end end -- 2.45.2