title: Ruby Checking to see if website exists
body: <p>Ok i am checking to see if my server is running. It works as long as the port is correct. But if I cange the port to one I know is not excepted it completely skips my if routine. The example below works fine. But change the port number to say 99 and it completely skips the if. I would think it should fall into the else section.</p>
  
  <pre><code>url = URI.parse("http://www.google.com/")
  url.port = 80
  req = Net::HTTP.new(url.host, url.port)
  res = req.request_head(url.path)
  
  if res.code == "200"
      #do something
  else
      #do something else
  end
  </code></pre>