Skip to content

Commit

Permalink
whois.nic.af parser must support `Delegated' status.
Browse files Browse the repository at this point in the history
  • Loading branch information
weppos committed Aug 24, 2011
1 parent d55fe5b commit 6f1d895
Show file tree
Hide file tree
Showing 11 changed files with 264 additions and 2 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.rdoc
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@

* FIXED: whois.nic.name parser must support multiple statuses.

* FIXED: whois.nic.af parser must support `Delegated' status.

* REMOVED: Removed deprecated Whois::Answer class.

* REMOVED: Removed deprecated Whois::Record#== behavior.
Expand Down
8 changes: 6 additions & 2 deletions lib/whois/record/parser/whois.nic.af.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,12 @@ class WhoisNicAf < Base
property_supported :status do
if content_for_scanner =~ /Status:\s+(.+?)\n/
case $1.downcase
when "active" then :registered
when "not registered" then :available
when "active"
:registered
when "delegated"
:registered
when "not registered"
:available
else
Whois.bug!(ParserError, "Unknown status `#{$1}'.")
end
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#status
should: %s == :registered

#available?
should: %s == false

#registered?
should: %s == true
56 changes: 56 additions & 0 deletions spec/fixtures/responses/whois.nic.af/property_status_active.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
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. Whois database is provided by CoCCA as a service to the internet community on behalf of CoCCA members. (http://www.cocca.cx/members.jsp)

The data is for information purposes only. CoCCA 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 CoCCA it's members (or CoCCA or member computer systems). The compilation, repackaging, dissemination or other use of this Data is expressly prohibited.

ADRAS Helpdesk | http://helpdesk.adras.af

Domain Information
Query: google.af
Created: 05 Oct 2009
Expires: 05 May 2010
Modified: 29 Jan 2010
Status: Active
Registrar: MarkMonitor
Name Servers:
ns1.google.com
ns2.google.com

Registrant:
Google Inc.
Google Inc.
1600 Amphitheatre Parkway
Mountain View, CA 94043
US
dns-admin@google.com
Voice: +1.6502530000
Fax: +1.6506188571

Administrative Contact:
Google Inc.
Google Inc.
1600 Amphitheatre Parkway
Mountain View, CA 94043
US
dns-admin@google.com
Voice: +1.6502530000
Fax: +1.6506188571

Technical Contact:
Google Inc.
Google Inc.
1600 Amphitheatre Parkway
Mountain View, CA 94043
US
dns-admin@google.com
Voice: +1.6502530000
Fax: +1.6506188571

Billing Contact:
eMarkmonitor Inc. dba MarkMonitor
PMB 155
10400 Overland Road
Boise, Idaho 83709 US
ccops@markmonitor.com
Voice: +1 (208) 389 5799


Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#status
should: %s == :registered

#available?
should: %s == false

#registered?
should: %s == true
46 changes: 46 additions & 0 deletions spec/fixtures/responses/whois.nic.af/property_status_delegated.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
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. Whois database is provided by AFGNIC as a service to the internet community.

The data is for information purposes only. AFGNIC 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 CoCCA it's members (or CoCCA or member computer systems). The compilation, repackaging, dissemination or other use of this Data is expressly prohibited.

ADRAS Helpdesk | http://helpdesk.adras.af
Domain Information
Query: netlinks.af
Status: Delegated
Created: 17 Sep 2006
Modified: 01 Jan 2011
Expires: 16 Jan 2020
Name Servers:
ns1.netlynxhost.com
ns2.netlynxhost.com

Registrar Information
Registrar Name: Afghanistan Ministry of Communications
Address: AFGNIC Office
7th floor , Ministry of Communications
Muhammad Jan Khan Watt
Kabul, Afghanistan.
Country: AF
Phone: +93 20 210 2684
Customer Service Contact: afgnic@nic.af
Customer Service Email: afgnic@nic.af




Registrant:
Name: Netlinks Solutions
Address:
kabul
kabul AF
Email Address: unknown
Phone Number: UNKNOWN


Admin Contact:
Name: Farshid Ghyasi Ghyasi
Address:
kabul
kabul AF
Email Address: farshid@netlynx.com.af
Phone Number: +93 0773020100

Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#status
should: %s == :available

#available?
should: %s == true

#registered?
should: %s == false
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
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. Whois database is provided by CoCCA as a service to the internet community on behalf of CoCCA members. (http://www.cocca.cx/members.jsp)

The data is for information purposes only. CoCCA 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 CoCCA it's members (or CoCCA or member computer systems). The compilation, repackaging, dissemination or other use of this Data is expressly prohibited.

ADRAS Helpdesk | http://helpdesk.adras.af

Domain Information
Query: u34jedzcq.af
Status: Not Registered




Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# 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.af/property_status_active.expected
#
# and regenerate the tests with the following rake task
#
# $ rake genspec:parsers
#

require 'spec_helper'
require 'whois/record/parser/whois.nic.af.rb'

describe Whois::Record::Parser::WhoisNicAf, "property_status_active.expected" do

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

describe "#status" do
it do
@parser.status.should == :registered
end
end
describe "#available?" do
it do
@parser.available?.should == false
end
end
describe "#registered?" do
it do
@parser.registered?.should == true
end
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# 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.af/property_status_delegated.expected
#
# and regenerate the tests with the following rake task
#
# $ rake genspec:parsers
#

require 'spec_helper'
require 'whois/record/parser/whois.nic.af.rb'

describe Whois::Record::Parser::WhoisNicAf, "property_status_delegated.expected" do

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

describe "#status" do
it do
@parser.status.should == :registered
end
end
describe "#available?" do
it do
@parser.available?.should == false
end
end
describe "#registered?" do
it do
@parser.registered?.should == true
end
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# 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.af/property_status_not_registered.expected
#
# and regenerate the tests with the following rake task
#
# $ rake genspec:parsers
#

require 'spec_helper'
require 'whois/record/parser/whois.nic.af.rb'

describe Whois::Record::Parser::WhoisNicAf, "property_status_not_registered.expected" do

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

describe "#status" do
it do
@parser.status.should == :available
end
end
describe "#available?" do
it do
@parser.available?.should == true
end
end
describe "#registered?" do
it do
@parser.registered?.should == false
end
end
end

0 comments on commit 6f1d895

Please sign in to comment.