Skip to content

Commit

Permalink
Merge pull request #161 from sherwind/uz-no-expiration
Browse files Browse the repository at this point in the history
whois.cctld.uz.rb parser crashes when expiration date is dash.
  • Loading branch information
weppos committed May 28, 2012
2 parents 1590606 + 8e98516 commit 129cbd0
Show file tree
Hide file tree
Showing 4 changed files with 156 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/whois/record/parser/whois.cctld.uz.rb
Expand Up @@ -57,8 +57,8 @@ class WhoisCctldUz < Base
property_not_supported :updated_on property_not_supported :updated_on


property_supported :expires_on do property_supported :expires_on do
if content_for_scanner =~ /^Expiration Date:(.*)\n/ if content_for_scanner =~ /^Expiration Date:\s+(.*)\n/
Time.parse($1) Time.parse($1) unless $1 == '-'
end end
end end


Expand Down
@@ -0,0 +1,2 @@
#expires_on
should: %s == nil
123 changes: 123 additions & 0 deletions spec/fixtures/responses/whois.cctld.uz/property_expires_on_dash.txt
@@ -0,0 +1,123 @@

% UzWhois Server Version 1.0

% Domain names in the .uz domain can now be registered
% with many different competing registrars. Go to http://www.cctld.uz/
% for detailed information.

Domain Name: CCTLD.UZ
Registrar: UZINFOCOM
Whois Server: www.whois.uz
Referral URL: http://www.cctld.uz/
Name Server: ns.uz. 91.212.89.8
Name Server: ns2.uz. 81.95.224.158
Status: RESERVED
Updated Date: 01-may-2005
Creation Date: 01-May-2005
Expiration Date: -


% >>> Last update of whois database: Fri, 11 May 2012 13:38:36 +0500 <<<

% NOTICE: The expiration date displayed in this record is the date the
% registrar's sponsorship of the domain name registration in the registry is
% currently set to expire. This date does not necessarily reflect the expiration
% date of the domain name registrant's agreement with the sponsoring
% registrar. Users may consult the sponsoring registrar's Whois database to
% view the registrar's reported date of expiration for this registration.

% TERMS OF USE: You are not authorized to access or query our Whois
% database through the use of electronic processes that are high-volume and
% automated except as reasonably necessary to register domain names or
% modify existing registrations; the Data in Center UZINFOCOM ccTLD.uz
% Services ( Center UZINFOCOM ) Whois database is provided by Center UZINFOCOM for
% information purposes only, and to assist persons in obtaining information
% about or related to a domain name registration record. Center UZINFOCOM does not
% guarantee its accuracy. By submitting a Whois query, you agree to abide
% by the following terms of use: You agree that you may use this Data only
% for lawful purposes and that under no circumstances will you use this Data
% to: (1) allow, enable, or otherwise support the transmission of mass
% unsolicited, commercial advertising or solicitations via e-mail, telephone,
% or facsimile; or (2) enable high volume, automated, electronic processes
% that apply to Center UZINFOCOM (or its computer systems). The compilation,
% repackaging, dissemination or other use of this Data is expressly
% prohibited without the prior written consent of Center UZINFOCOM. You agree not to
% use electronic processes that are automated and high-volume to access or
% query the Whois database except as reasonably necessary to register
% domain names or modify existing registrations. Center UZINFOCOM reserves the right
% to restrict your access to the Whois database in its sole discretion to ensure
% operational stability. Center UZINFOCOM may restrict or terminate your access to the
% Whois database for failure to abide by these terms of use. Center UZINFOCOM
% reserves the right to modify these terms at any time.

% The Registry database contains ONLY .UZ domains and
% Registrars.

% Registration Service Provided By: UZINFOCOM

Domain Name: CCTLD.UZ

Registrant:
not.defined.
Rakhimov D. K. (info [at] uzinfocom.uz)
A.Navoi str., 28 B
Tashkent
Uzbekistan, 100011
UZ
Tel. +998 71 238-42-00
Fax. +998 71 238-42-48

Creation Date: 01-May-2005
Expiration Date: -

Domain servers in listed order:
ns.uz.
ns2.uz.


Administrative Contact:
Center UZINFOCOM
Djuraev I.D. (info [at] uzinfocom.uz)
A.Navoi str., 28 B
Tashkent
Uzbekistan, 100011
UZ
Tel. +998 71 238-41-48
Fax. +998 71 238-42-48

Technical Contact:
Center UZINFOCOM
Deykhin V.V. (info [at] uzinfocom.uz)
A.Navoi str., 28 B
Tashkent
Uzbekistan, 100011
UZ
Tel. +998 71 238-42-45
Fax. +998 71 238-42-48

Billing Contact:
Center UZINFOCOM
Karnaushevskaya A.K. (info [at] uzinfocom.uz)
A.Navoi str., 28 B
Tashkent
Uzbekistan, 100011
UZ
Tel. +998 71 238-42-00
Fax. +998 71 238-42-48

Status: RESERVED

% The data in this whois database is provided to you for informationpurposes only, that is, to assist you in obtaining
% information about or related to a domain name registration record. We make this informationavailable "as is", and do
% not guarantee its accuracy. By submitting awhois query, you agree that you will use this data only for lawfulpurposes
% and that, under no circumstances will you use this data to:(1) enable high volume, automated, electronic processes
% that stress orload this whois database system providing you this information; or(2) allow, enable, or otherwise
% support the transmission of massunsolicited, commercial advertising or solicitations via direct mail,electronic mail,
% or by telephone. The compilation, repackaging,dissemination or other use of this data is expressly prohibited withoutprior
% written consent from us. The registrar of record is Critical Internet, Inc.. We reserve the right to modifythese terms at
% any time. By submitting this query, you agree to abideby these terms.


% The Whois Server (ver. 1.0) of ccTLD.UZ
% (c) 2005, Center UZINFOCOM

@@ -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.cctld.uz/property_expires_on_dash.expected
#
# and regenerate the tests with the following rake task
#
# $ rake spec:generate
#

require 'spec_helper'
require 'whois/record/parser/whois.cctld.uz.rb'

describe Whois::Record::Parser::WhoisCctldUz, "property_expires_on_dash.expected" do

before(:each) do
file = fixture("responses", "whois.cctld.uz/property_expires_on_dash.txt")
part = Whois::Record::Part.new(:body => File.read(file))
@parser = klass.new(part)
end

describe "#expires_on" do
it do
@parser.expires_on.should == nil
end
end
end

0 comments on commit 129cbd0

Please sign in to comment.