Permalink
Browse files

whois.nic.org.uy crashes when update date is blank.

  • Loading branch information...
1 parent 849c3ee commit a3ae5f50b5a81a12f7f429cddc8730697d4e1b71 @weppos committed Feb 25, 2014
View
2 CHANGELOG.md
@@ -11,6 +11,8 @@
- FIXED: whois.nic.cd crashes because the registry is no longer returning a status.
+- FIXED: whois.nic.org.uy crashes when update date is blank.
+
- CHANGED: Updated whois.nic.ec parser to the new response format.
- CHANGED: Updated whois.pandi.or.id parser to the new response format.
View
27 lib/whois/record/parser/whois.nic.org.uy.rb
@@ -14,33 +14,32 @@ module Whois
class Record
class Parser
- #
- # = whois.nic.org.uy parser
- #
# Parser for the whois.nic.org.uy server.
#
- # NOTE: This parser is just a stub and provides only a few basic methods
- # to check for domain availability and get domain status.
- # Please consider to contribute implementing missing methods.
- # See WhoisNicIt parser for an explanation of all available methods
- # and examples.
+ # @note This parser is just a stub and provides only a few basic methods
+ # to check for domain availability and get domain status.
+ # Please consider to contribute implementing missing methods.
+ #
+ # @see Whois::Record::Parser::Example
+ # The Example parser for the list of all available methods.
#
class WhoisNicOrgUy < Base
property_supported :status do
if content_for_scanner =~ /Estatus del dominio: (.+?)\n/
case $1.downcase
- when "activo" then :registered
- else
- Whois.bug!(ParserError, "Unknown status `#{$1}'.")
+ when "activo"
+ :registered
+ else
+ Whois.bug!(ParserError, "Unknown status `#{$1}'.")
end
else
:available
end
end
property_supported :available? do
- !!(content_for_scanner =~ /No match for "(.*?)"/)
+ !!(content_for_scanner =~ /No match for "(.+?)"/)
end
property_supported :registered? do
@@ -49,13 +48,13 @@ class WhoisNicOrgUy < Base
property_supported :created_on do
- if content_for_scanner =~ /Fecha de Creacion: (.*)\n/
+ if content_for_scanner =~ /Fecha de Creacion: (.+)\n/
Time.parse($1)
end
end
property_supported :updated_on do
- if content_for_scanner =~ /Ultima Actualizacion: (.*)\n/
+ if content_for_scanner =~ /Ultima Actualizacion: (.+)\n/
Time.parse($1)
end
end
View
2 spec/fixtures/responses/whois.nic.org.uy/property_updated_on_blank.expected
@@ -0,0 +1,2 @@
+#updated_on
+ %s == nil
View
27 spec/fixtures/responses/whois.nic.org.uy/property_updated_on_blank.txt
@@ -0,0 +1,27 @@
+
+Servidor Whois de NIC-Uruguay (.UY)
+
+Este servidor contiene informacion autoritativa exclusivamente de dominios bajo .UY, EDU.UY, ORG.UY, NET.UY, GUB.UY y MIL.UY
+Cualquier consulta sobre este servicio, puede hacerla al correo electronico dns-adm@seciu.edu.uy
+
+Por informacion sobre dominios bajo COM.UY dirigirse a https://nic.anteldata.com.uy/dns/consultaWhois/whois.action
+
+Titular:
+
+ Nombre de Dominio: gub.uy
+ Registrado por: Servicio Central de Informática de la Universidad (SeCIU-UdelaR) (http://www.nic.org.uy)
+
+ Contacto Administrativo:
+
+ Contacto Tecnico:
+
+ Contacto de Cobranza:
+
+ Ultima Actualizacion:
+ Fecha de Creacion: 1990-09-10 00:00:00
+
+ Estatus del dominio: ACTIVO
+
+
+NIC-Uruguay - SeCIU - UdelaR
+http://www.nic.org.uy
View
6 spec/fixtures/responses/whois.nic.org.uy/status_available.txt
@@ -1,10 +1,12 @@
Servidor Whois de NIC-Uruguay (.UY)
-Este servidor contiene informacion autoritativa exclusivamente de dominios .UY
+Este servidor contiene informacion autoritativa exclusivamente de dominios bajo .UY, EDU.UY, ORG.UY, NET.UY, GUB.UY y MIL.UY
Cualquier consulta sobre este servicio, puede hacerla al correo electronico dns-adm@seciu.edu.uy
-No match for "u34jedzcq.edu.uy".
+Por informacion sobre dominios bajo COM.UY dirigirse a https://nic.anteldata.com.uy/dns/consultaWhois/whois.action
+
+No match for "u34jedzcq.uy".
NIC-Uruguay - SeCIU - UdelaR
http://www.nic.org.uy
View
12 spec/fixtures/responses/whois.nic.org.uy/status_registered.expected
@@ -10,11 +10,11 @@
#created_on
%s %CLASS{time}
- %s %TIME{2001-06-15 00:00:00}
+ %s %TIME{2012-07-03 20:58:58}
#updated_on
%s %CLASS{time}
- %s %TIME{2009-11-04 16:23:11}
+ %s %TIME{2012-09-12 02:32:59}
#expires_on
%s %ERROR{AttributeNotSupported}
@@ -24,6 +24,10 @@
%s %CLASS{array}
%s %SIZE{2}
%s[0] %CLASS{nameserver}
- %s[0].name == "seciu.edu.uy"
+ %s[0].name == "ns1.markmonitor.com"
+ %s[0].ipv4 == nil
+ %s[0].ipv6 == nil
%s[1] %CLASS{nameserver}
- %s[1].name == "tacuabe.rau.edu.uy"
+ %s[1].name == "ns3.markmonitor.com"
+ %s[1].ipv4 == nil
+ %s[1].ipv6 == nil
View
52 spec/fixtures/responses/whois.nic.org.uy/status_registered.txt
@@ -1,48 +1,48 @@
Servidor Whois de NIC-Uruguay (.UY)
-Este servidor contiene informacion autoritativa exclusivamente de dominios .UY
+Este servidor contiene informacion autoritativa exclusivamente de dominios bajo .UY, EDU.UY, ORG.UY, NET.UY, GUB.UY y MIL.UY
Cualquier consulta sobre este servicio, puede hacerla al correo electronico dns-adm@seciu.edu.uy
+Por informacion sobre dominios bajo COM.UY dirigirse a https://nic.anteldata.com.uy/dns/consultaWhois/whois.action
+
Titular:
-Servicio Central de Informática - Universidad de la República (seciu.edu.uy-uynic) info@seciu.edu.uy
- Servicio Central de Informática - Universidad de la República
- Colonia 2066, CP 1200
- Montevideo UY
- 598 2 4083901
+Google Inc (go101-adnic-o) mail@nameaction.com
+ Google Inc
+ 1600 Amphitheatre Parkway Mountain View Mountain View Estados Unidos
+ NOT AVAILABLE NOT AVAILABLE
+ 1-650-2530000 (FAX) 1-650-6188571
- Nombre de Dominio: seciu.edu.uy
+ Nombre de Dominio: google.uy
+ Registrado por: Antel (https://nic.anteldata.com.uy/dns/)
Contacto Administrativo:
- Roberto Goinheix (rg2-uynic) dns-adm@seciu.edu.uy
- Roberto Goinheix
- Colonia 2066 - Montevideo, Uruguay
- Colonia 2066 - Montevideo, Uruguay UY
- 598 2 408.39.01
+ Comintur SA Netgate (ne26-adnic) dominios@netgate.com.uy
+ 21 de Setiembre 2840
+ NOT AVAILABLE NOT AVAILABLE
+ 598-27126666
Contacto Tecnico:
- Sergio Ramirez (sr3-uynic) sramirez@seciu.edu.uy
- ORG
- Colonia 2066 - Montevideo CP 11200, Uruguay
- Colonia 2066 - Montevideo, Estado UY
- 598 2 408 39 01 x+598 2 (FAX) 598 - +598 2
+ Markmonitor Tech Markmonitor (mm100-adnic) mail@nameaction.com
+ 391 N Ancestor pl
+ NOT AVAILABLE NOT AVAILABLE
+ 1 2083895740
Contacto de Cobranza:
- Roberto Goinheix (rg2-uynic) dns-adm@seciu.edu.uy
- Roberto Goinheix
- Colonia 2066 - Montevideo, Uruguay
- Colonia 2066 - Montevideo, Uruguay UY
- 598 2 408.39.01
+ Comintur SA Netgate (ne26-adnic) dominios@netgate.com.uy
+ 21 de Setiembre 2840
+ NOT AVAILABLE NOT AVAILABLE
+ 598-27126666
- Ultima Actualizacion: 2009-11-04 16:23:11
- Fecha de Creacion: 2001-06-15 00:00:00
+ Ultima Actualizacion: 2012-09-12 02:32:59
+ Fecha de Creacion: 2012-07-03 20:58:58
Estatus del dominio: ACTIVO
Servidor(es) de Nombres de Dominio:
- - seciu.edu.uy
- - tacuabe.rau.edu.uy
+ - ns1.markmonitor.com
+ - ns3.markmonitor.com
NIC-Uruguay - SeCIU - UdelaR
http://www.nic.org.uy
View
29 spec/whois/record/parser/responses/whois.nic.org.uy/property_updated_on_blank_spec.rb
@@ -0,0 +1,29 @@
+# encoding: utf-8
+
+# This file is autogenerated. Do not edit it manually.
+# If you want change the content of this file, edit
+#
+# /spec/fixtures/responses/whois.nic.org.uy/property_updated_on_blank.expected
+#
+# and regenerate the tests with the following rake task
+#
+# $ rake spec:generate
+#
+
+require 'spec_helper'
+require 'whois/record/parser/whois.nic.org.uy.rb'
+
+describe Whois::Record::Parser::WhoisNicOrgUy, "property_updated_on_blank.expected" do
+
+ subject do
+ file = fixture("responses", "whois.nic.org.uy/property_updated_on_blank.txt")
+ part = Whois::Record::Part.new(body: File.read(file))
+ described_class.new(part)
+ end
+
+ describe "#updated_on" do
+ it do
+ expect(subject.updated_on).to eq(nil)
+ end
+ end
+end
View
12 spec/whois/record/parser/responses/whois.nic.org.uy/status_registered_spec.rb
@@ -39,13 +39,13 @@
describe "#created_on" do
it do
expect(subject.created_on).to be_a(Time)
- expect(subject.created_on).to eq(Time.parse("2001-06-15 00:00:00"))
+ expect(subject.created_on).to eq(Time.parse("2012-07-03 20:58:58"))
end
end
describe "#updated_on" do
it do
expect(subject.updated_on).to be_a(Time)
- expect(subject.updated_on).to eq(Time.parse("2009-11-04 16:23:11"))
+ expect(subject.updated_on).to eq(Time.parse("2012-09-12 02:32:59"))
end
end
describe "#expires_on" do
@@ -58,9 +58,13 @@
expect(subject.nameservers).to be_a(Array)
expect(subject.nameservers).to have(2).items
expect(subject.nameservers[0]).to be_a(Whois::Record::Nameserver)
- expect(subject.nameservers[0].name).to eq("seciu.edu.uy")
+ expect(subject.nameservers[0].name).to eq("ns1.markmonitor.com")
+ expect(subject.nameservers[0].ipv4).to eq(nil)
+ expect(subject.nameservers[0].ipv6).to eq(nil)
expect(subject.nameservers[1]).to be_a(Whois::Record::Nameserver)
- expect(subject.nameservers[1].name).to eq("tacuabe.rau.edu.uy")
+ expect(subject.nameservers[1].name).to eq("ns3.markmonitor.com")
+ expect(subject.nameservers[1].ipv4).to eq(nil)
+ expect(subject.nameservers[1].ipv6).to eq(nil)
end
end
end

0 comments on commit a3ae5f5

Please sign in to comment.