]> git.cworth.org Git - sup/blobdiff - lib/sup/person.rb
add --commit option to spawn a compose-mode upon startup
[sup] / lib / sup / person.rb
index 0e58534f0b2d93035f2200258e48d754fbcc3f6c..fb58f23889d53503bce539407b2583767b40a49c 100644 (file)
@@ -9,7 +9,7 @@ class PersonManager
 
     ## read in stored people
     IO.readlines(fn).map do |l|
-      l =~ /^(.*)?:\s+(\d+)\s+(.*)$/ or raise "can't parse: #{l}"
+      l =~ /^(.*)?:\s+(\d+)\s+(.*)$/ or next
       email, time, name = $1, $2, $3
       @@people[email] = Person.new name, email, time, false
     end if File.exists? fn
@@ -162,6 +162,10 @@ class Person
     Person.new name, email
   end
 
+  def indexable_content
+    [name, email, email.split(/@/).first].join(" ")
+  end
+
   def eql? o; email.eql? o.email end
   def hash; email.hash end
 end