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
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
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!
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.
Sponsor our Newsletter | Privacy Policy | Terms of Service | Remote Ruby Jobs