Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

whois.nic.ki parser must support `Delegated' status (closes #119)

  • Loading branch information...
commit ae6310411f94d777ff91ae691b5d7f9b5e2a56fa 1 parent 79949d9
@weppos authored
View
2  CHANGELOG.rdoc
@@ -6,6 +6,8 @@
* FIXED: whois.nic.mu parser must support `Delegated' status.
+* FIXED: whois.nic.ki parser must support `Delegated' status (#119).
+
== Release 2.1.1
View
28 README.rdoc
@@ -1,26 +1,26 @@
-= Whois
+# Whois
Whois is an intelligent pure Ruby WHOIS client and parser.
It is a OS-independent library and doesn't require external C libraries or Gems: it is a 100% Ruby software.
-This software was developed to power {RoboDomain}[http://www.robodomain.com] and, since July 2009, it ran more than thousands requests.
+This software was developed to power [RoboDomain](http://www.robodomain.com) and, since July 2009, it ran more than thousands requests.
An extensive test suite is available to verify the library correctness but you must be aware that registrant might change Whois interfaces without notice and at any time causing queries to specific hosts to stop working.
-== Features
+## Features
-* Ability to query registry data for {IPv4, IPv6, TLDs, and domain names}[http://www.ruby-whois.org/manual/usage.html#usage-objects]
-* Ability to {parse WHOIS responses}[http://www.ruby-whois.org/manual/parser.html]
-* Flexible and extensible interface (e.g. You can define {custom servers}[http://www.ruby-whois.org/manual/server.html] on the fly)
+* Ability to query registry data for [IPv4, IPv6, TLDs, and domain names](http://www.ruby-whois.org/manual/usage.html#usage-objects)
+* Ability to [parse WHOIS responses](http://www.ruby-whois.org/manual/parser.html)
+* Flexible and extensible interface (e.g. You can define [custom servers](http://www.ruby-whois.org/manual/server.html) on the fly)
* Object oriented design, featuring 10 different design patterns
* Pure Ruby library, without any external dependency other than Ruby itself
-* Compatible with {Ruby 1.8.6 and greater}[http://www.ruby-whois.org/manual/installation.html#installation-requirements], including Ruby 1.9 branch
-* Successfully tested against several {Ruby implementations}[http://www.ruby-whois.org/manual/interpreters.html]
+* Compatible with [Ruby 1.8.7 and greater](http://www.ruby-whois.org/manual/installing.html#installation-requirements), including Ruby 1.9 branch
+* Successfully tested against several [Ruby implementations](http://www.ruby-whois.org/manual/interpreters.html)
-== Requirements
+## Requirements
* Ruby >= 1.8.7
@@ -29,23 +29,23 @@ For older versions of Ruby, see the CHANGELOG.rdoc file.
In addition to the standard Ruby interpreter (MRI),
Whois has been successfully tested against several
-{Ruby implementations}[http://www.ruby-whois.org/manual/interpreters.html].
+[Ruby implementations](http://www.ruby-whois.org/manual/interpreters.html).
-== Installation
+## Installation
This library is intended to be installed as a Gem.
- $ gem install whois
+ $ gem install whois
You might need administrator privileges on your system to install it.
-== Upgrade
+## Upgrade
Install the newer version via RubyGems.
- $ gem install whois
+ $ gem install whois
Minor and bugfix releases normally won't break backwards-compatibility. You can read the CHANGELOG.rdoc file to learn about the changes in each release.
View
11 lib/whois/record/parser/whois.nic.ki.rb
@@ -30,12 +30,11 @@ class WhoisNicKi < Base
property_supported :status do
if content_for_scanner =~ /Status:\s+(.+?)\n/
case $1.downcase
- when "active"
- :registered
- when "not registered"
- :available
- else
- Whois.bug!(ParserError, "Unknown status `#{$1}'.")
+ when "active" then :registered
+ when "delegated" then :registered
+ when "not registered" then :available
+ else
+ Whois.bug!(ParserError, "Unknown status `#{$1}'.")
end
else
Whois.bug!(ParserError, "Unable to parse status.")
View
8 spec/fixtures/responses/whois.nic.ki/property_status_active.expected
@@ -0,0 +1,8 @@
+#status
+ should: %s == :registered
+
+#available?
+ should: %s == false
+
+#registered?
+ should: %s == true
View
54 spec/fixtures/responses/whois.nic.ki/property_status_active.txt
@@ -0,0 +1,54 @@
+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.
+
+Domain Information
+Query: google.ki
+Status: Active
+Created: 15 May 2006
+Modified: 21 Mar 2010
+Expires: 27 Nov 2010
+Name Servers:
+ ns1.google.com
+ ns2.google.com
+ ns3.google.com
+ ns4.google.com
+
+Registrar Information
+Registrar Name: MarkMonitor
+Registration URL: http://www.markmonitor.com
+Address: MarkMonitor
+Emerald Tech Center
+391 N. Ancestor Place
+Boise, ID 83704
+Country: US
+Phone: +1 (208) 389-5740
+Fax: +1 (208) 389-5771
+Customer Service Contact: ccops@markmonitor.com
+Customer Service Email: ccops@markmonitor.com
+
+
+
+
+Registrant:
+Organisation: Google Inc.
+Address:
+ 1600 Amphitheatre Parkway
+ Mountain View, CA 94043
+ US
+Email Address: dns-admin@google.com
+Phone Number: +1.6502530000
+Fax Number: +1.6506188571
+
View
8 spec/fixtures/responses/whois.nic.ki/property_status_delegated.expected
@@ -0,0 +1,8 @@
+#status
+ should: %s == :registered
+
+#available?
+ should: %s == false
+
+#registered?
+ should: %s == true
View
78 spec/fixtures/responses/whois.nic.ki/property_status_delegated.txt
@@ -0,0 +1,78 @@
+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.
+
+Domain Information
+Query: zumba.ki
+Status: Delegated
+Created: 26 Oct 2010
+Modified: 24 Jun 2011
+Expires: 27 Oct 2011
+Name Servers:
+ a.ns.zerigo.net
+ b.ns.zerigo.net
+ c.ns.zerigo.net
+ d.ns.zerigo.net
+ e.ns.zerigo.net
+
+Registrar Information
+Registrar Name: Instra Corporation
+Registration URL: http://www.instra.com
+Address: INSTRA CORPORATION PTY LTD
+ACN 110 054 610
+GPO Box 988
+Melbourne VIC 3001
+Australia
+Country: AU
+Phone: 1800 220 123
+Fax: +61 3 9783 6844
+Customer Service Contact: Louise Lentino
+Customer Service Email: domsup@instra.com
+
+
+
+
+Registrant:
+Name: Rodrigo Faerman
+Address:
+ 3801 N 29th Ave
+ Hollywood, FL 33020
+ US
+Email Address: rodrigo@zumba.com
+Phone Number: +1.9549253755 ext. 1111
+Fax Number: +1.9549253505 ext. 1111
+
+
+Admin Contact:
+Name: Rodrigo Faerman
+Address:
+ 3801 N 29th Ave
+ Hollywood, FL 33020
+ US
+Email Address: rodrigo@zumba.com
+Phone Number: +1.9549253755 ext. 1111
+Fax Number: +1.9549253505 ext. 1111
+
+
+Technical Contact:
+Name: Rodrigo Faerman
+Address:
+ 3801 N 29th Ave
+ Hollywood, FL 33020
+ US
+Email Address: rodrigo@zumba.com
+Phone Number: +1.9549253755 ext. 1111
+Fax Number: +1.9549253505 ext. 1111
+
View
8 spec/fixtures/responses/whois.nic.ki/property_status_not_registered.expected
@@ -0,0 +1,8 @@
+#status
+ should: %s == :available
+
+#available?
+ should: %s == true
+
+#registered?
+ should: %s == false
View
22 spec/fixtures/responses/whois.nic.ki/property_status_not_registered.txt
@@ -0,0 +1,22 @@
+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.
+
+Domain Information
+Query: u34jedzcq.ki
+Status: Not Registered
+
+
+
View
39 spec/whois/record/parser/responses/whois.nic.ki/property_status_active_spec.rb
@@ -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.ki/property_status_active.expected
+#
+# and regenerate the tests with the following rake task
+#
+# $ rake spec:generate
+#
+
+require 'spec_helper'
+require 'whois/record/parser/whois.nic.ki.rb'
+
+describe Whois::Record::Parser::WhoisNicKi, "property_status_active.expected" do
+
+ before(:each) do
+ file = fixture("responses", "whois.nic.ki/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
View
39 spec/whois/record/parser/responses/whois.nic.ki/property_status_delegated_spec.rb
@@ -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.ki/property_status_delegated.expected
+#
+# and regenerate the tests with the following rake task
+#
+# $ rake spec:generate
+#
+
+require 'spec_helper'
+require 'whois/record/parser/whois.nic.ki.rb'
+
+describe Whois::Record::Parser::WhoisNicKi, "property_status_delegated.expected" do
+
+ before(:each) do
+ file = fixture("responses", "whois.nic.ki/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
View
39 spec/whois/record/parser/responses/whois.nic.ki/property_status_not_registered_spec.rb
@@ -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.ki/property_status_not_registered.expected
+#
+# and regenerate the tests with the following rake task
+#
+# $ rake spec:generate
+#
+
+require 'spec_helper'
+require 'whois/record/parser/whois.nic.ki.rb'
+
+describe Whois::Record::Parser::WhoisNicKi, "property_status_not_registered.expected" do
+
+ before(:each) do
+ file = fixture("responses", "whois.nic.ki/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
Please sign in to comment.
Something went wrong with that request. Please try again.