Subject: [sup-talk] Exception reading contacts.txt

From: [email-masked] (Steve Tooke)
Date: Tue, 09 Oct 2007 14:35:36 +0100

Resend as caught-out by default setting on mailing list... although I've subscribed now anyway!

Really enjoying using sup at the moment, great piece of software.

I've just had this problem with parsing contacts.txt

The problem was: 'can't parse /Users/stevet/.sup/contacts.txt line "Anthony
Dobson: anthony at collierdobson.com\n"' (error type RuntimeError)
A backtrace follows:
/usr/local/lib/ruby/gems/1.8/gems/sup-0.1/lib/sup/contact.rb:13:in
`initialize': can't parse /Users/stevet/.sup/contacts.txt line "Anthony Dobson:
anthony at collierdobson.com\n" (RuntimeError)
        from /usr/local/lib/ruby/gems/1.8/gems/sup-0.1/lib/sup/contact.rb:12:in
`foreach'
        from /usr/local/lib/ruby/gems/1.8/gems/sup-0.1/lib/sup/contact.rb:12:in
`initialize'
        from /usr/local/lib/ruby/gems/1.8/gems/sup-0.1/lib/sup.rb:107:in `new'
        from /usr/local/lib/ruby/gems/1.8/gems/sup-0.1/lib/sup.rb:107:in `start'
        from /usr/local/lib/ruby/gems/1.8/gems/sup-0.1/bin/sup:88
        from /usr/local/bin/sup:16:in `load'   
        from /usr/local/bin/sup:16

There is only one line in the contacts.txt file.

Regards,

-- 
Steve Tooke
steve.tooke at gmail.com

---

From: [email-masked] (William Morgan)
Date: Tue, 09 Oct 2007 06:44:10 -0700

> Dobson: anthony at collierdobson.com\n"' (error type RuntimeError)

Hm, Sup doesn't expect aliases to have spaces. Sup's expecting something
like "tony: Anthony Dobson <anthony at blah.com>". Did you add that line by
hand, or did you use Sup to make the alias?

That translates into two bugfixes for me:
1. Don't allow spaces when inputting a new alias name.
2. Don't crash completely when contacts.txt isn' what you expect.

-- 
William <wmorgan-sup at masanjin.net>

---

From: [email-masked] (Steve Tooke)
Date: Tue, 09 Oct 2007 14:58:51 +0100

Excerpts from William Morgan's message of Tue Oct 09 14:44:10 +0100 2007:
> > Dobson: anthony at blah.com\n"' (error type RuntimeError)
> 

Ahh, that makes sense.

Originally, I had used Sup but that hadn't worked, so assumed that it was related to the way the email address was formatted.

Sup did allow me to enter a space in the alias!

Thanks for the quick reply!

Steve

-- 
Steve Tooke
steve.tooke at gmail.com

---

From: [email-masked] (William Morgan)
Date: Sat, 27 Oct 2007 12:08:50 -0700

> Sup did allow me to enter a space in the alias!

Spaces in aliases should now be fine.