diff --git a/lib/whois/parsers/whois.in.ua.rb b/lib/whois/parsers/whois.in.ua.rb index a5d3c908..17e122e4 100644 --- a/lib/whois/parsers/whois.in.ua.rb +++ b/lib/whois/parsers/whois.in.ua.rb @@ -38,7 +38,7 @@ class WhoisInUa < Base end property_supported :available? do - !!(content_for_scanner =~ /No records found for object/) + !!(content_for_scanner =~ /Domain name does not exist/) end property_supported :registered? do @@ -46,19 +46,24 @@ class WhoisInUa < Base end - property_not_supported :created_on + property_supported :created_on do + if content_for_scanner =~ /created:\s+(.*)\n/ + time = $1 + Time.strptime(time, "%Y-%m-%d %H:%M:%S") + end + end property_supported :updated_on do - if content_for_scanner =~ /changed:\s+(.*)\n/ - time = $1.split(" ").last - Time.strptime(time, "%Y%m%d%H%M%S") + if content_for_scanner =~ /updated:\s+(.*)\n/ + time = $1 + Time.strptime(time, "%Y-%m-%d %H:%M:%S") end end property_supported :expires_on do - if content_for_scanner =~ /status:\s+(.*)\n/ - time = $1.split(" ").last - Time.strptime(time, "%Y%m%d%H%M%S") + if content_for_scanner =~ /expires:\s+(.*)\n/ + time = $1 + Time.strptime(time, "%Y-%m-%d %H:%M:%S") end end diff --git a/spec/fixtures/responses/whois.in.ua/in.ua/status_available.txt b/spec/fixtures/responses/whois.in.ua/in.ua/status_available.txt index 32b98a39..f3bba924 100644 --- a/spec/fixtures/responses/whois.in.ua/in.ua/status_available.txt +++ b/spec/fixtures/responses/whois.in.ua/in.ua/status_available.txt @@ -1,4 +1,5 @@ -% In.UA whois server. (whois.in.ua) -% All questions regarding this service please send to help@whois.in.ua -% To search for domains and In.UA maintainers using the web, visit http://whois.in.ua -% No records found for object U34JEDZCQ.IN.UA +* +* Whois query server SUNIC +* + +u34jedzcq.in.ua - Domain name does not exist diff --git a/spec/fixtures/responses/whois.in.ua/in.ua/status_registered.expected b/spec/fixtures/responses/whois.in.ua/in.ua/status_registered.expected index 63c8d320..7f7dfb13 100644 --- a/spec/fixtures/responses/whois.in.ua/in.ua/status_registered.expected +++ b/spec/fixtures/responses/whois.in.ua/in.ua/status_registered.expected @@ -9,23 +9,24 @@ #created_on - %s %ERROR{AttributeNotSupported} + %s %CLASS{time} + %s %TIME{2007-12-18 17:12:35} #updated_on %s %CLASS{time} - %s %TIME{2012-12-16 13:41:04} + %s %TIME{2017-12-19 09:54:31} #expires_on %s %CLASS{time} - %s %TIME{2013-12-18 00:00:00} + %s %TIME{2018-12-19 21:00:00} #nameservers %s %CLASS{array} %s %SIZE{3} %s[0] %CLASS{nameserver} - %s[0].name == "ns12.uadns.com" + %s[0].name == "ns10.uadns.com" %s[1] %CLASS{nameserver} - %s[1].name == "ns11.uadns.com" + %s[1].name == "ns12.uadns.com" %s[2] %CLASS{nameserver} - %s[2].name == "ns10.uadns.com" + %s[2].name == "ns11.uadns.com" diff --git a/spec/fixtures/responses/whois.in.ua/in.ua/status_registered.txt b/spec/fixtures/responses/whois.in.ua/in.ua/status_registered.txt index fc0adcd8..cd083434 100644 --- a/spec/fixtures/responses/whois.in.ua/in.ua/status_registered.txt +++ b/spec/fixtures/responses/whois.in.ua/in.ua/status_registered.txt @@ -1,16 +1,38 @@ -% In.UA whois server. (whois.in.ua) -% All questions regarding this service please send to help@whois.in.ua -% To search for domains and In.UA maintainers using the web, visit http://whois.in.ua -domain: dle.in.ua -descr: dle.in.ua -admin-c: VP535-UANIC -tech-c: NIC-UANIC -status: OK-UNTIL 20131218000000 -nserver: NS12.UADNS.COM -nserver: NS11.UADNS.COM -nserver: NS10.UADNS.COM -mnt-by: DRS-MNT-INUA -mnt-lower: DRS-MNT-INUA -changed: notify@drs.ua 20121216134104 -source: INUA +* +* Whois query server SUNIC +* + +domain: dle.in.ua +registrar: ua.nic +registrant: vp535-sunic +admin: vp535-sunic +tech: nic-sunic +nserver: ns10.uadns.com +nserver: ns12.uadns.com +nserver: ns11.uadns.com +status: ok +created: 2007-12-18 20:12:35 +updated: 2017-12-19 12:54:31 +expires: 2018-12-20 00:00:00 +source: SUNIC + +Contact nic-sunic +-------------------- +id: nic-sunic +email: support@nic.ua +phone: +380.445933222 +fax: +380.445937569 +addr_int: not published +name_int: NIC-UANIC +org_int: NIC.UA LLC + +Contact vp535-sunic +-------------------- +id: vp535-sunic +email: not published +phone: not published +fax: not published +addr_loc: not published +name_loc: not published +org_loc: not published