code: def validate_uri(value)
        URI.parse(value)
      rescue URI::InvalidURIError => e
        raise ValidationError, "invalid URI: #{e.message}"
      end
docs: Validate URI string format following RFC 2396
   (see http://tools.ietf.org/html/rfc2396)