IPSocket::getaddress problem

Hey guys, I want to test if IPSocket::getaddress(‘address’) is valid
before printing it or anything…

If the user enters an invalid address then the program dies, i tried
rescuing the error but i didn’t have much luck, any ideas?

Thanks in advance

BUMP

Seriously, No-one?

success = false
begin
a = IPSocket::getaddress(‘their input’)
success = true
rescue Exception => detail

arr! evil address

success = false
end

Haze N. wrote:

Hey guys, I want to test if IPSocket::getaddress(‘address’) is valid
before printing it or anything…

If the user enters an invalid address then the program dies, i tried
rescuing the error but i didn’t have much luck, any ideas?

Thanks in advance

On Aug 14, 2007, at 5:52 PM, Haze N. wrote:

Hey guys, I want to test if IPSocket::getaddress(‘address’) is valid
before printing it or anything…

If the user enters an invalid address then the program dies, i tried
rescuing the error but i didn’t have much luck, any ideas?

Thanks in advance

Posted via http://www.ruby-forum.com/.

Try creating a test first.
Using testing facilities in Ruby is exactly for this kind of thing!