Permalink
Browse files

Remove old coza whois support

  • Loading branch information...
1 parent 3d01c6b commit 7c7fe7459b34194adb7b367533e547abc2f4a4c7 @rorymckinley committed Nov 1, 2012
@@ -1,76 +0,0 @@
-#--
-# Ruby Whois
-#
-# An intelligent pure Ruby WHOIS client and parser.
-#
-# Copyright (c) 2009-2012 Simone Carletti <weppos@weppos.net>
-#++
-
-
-require 'whois/record/parser/base'
-
-
-module Whois
- class Record
- class Parser
-
- #
- # = whois.coza.net.za parser
- #
- # Parser for the whois.coza.net.za server.
- #
- class WhoisCozaNetZa < Base
-
- property_not_supported :disclaimer
-
-
- property_not_supported :domain
-
- property_not_supported :domain_id
-
-
- property_not_supported :referral_whois
-
- property_not_supported :referral_url
-
-
- property_supported :status do
- if available?
- :available
- else
- :registered
- end
- end
-
- property_supported :available? do
- content_for_scanner.strip == "Available"
- end
-
- property_supported :registered? do
- !available?
- end
-
-
- property_not_supported :created_on
-
- property_not_supported :updated_on
-
- property_not_supported :expires_on
-
-
- property_not_supported :registrar
-
- property_not_supported :registrant_contacts
-
- property_not_supported :admin_contacts
-
- property_not_supported :technical_contacts
-
-
- property_not_supported :nameservers
-
- end
-
- end
- end
-end
@@ -104,53 +104,6 @@ def parse_date(date_string)
end
end
- property_supported :registered? do
- !available?
- end
-
- property_supported :nameservers do
- if content_for_scanner =~ /Name Servers:\n((.+\n)+)\n/
- $1.split("\n").map do |line|
- Record::Nameserver.new(:name => line.strip)
- end
- end
- end
-
- property_supported :registrar do
- if content_for_scanner =~ /Registrar:\n(.+)\[ ID = (.+) \]\s*\n/
- Whois::Record::Registrar.new(:name => $1.strip, :id => $2.strip)
- end
- end
-
- property_supported :registrant_contacts do
- if content_for_scanner =~ /Registrant:\n((.+\n)+)\n/
- reg_details = $1.split("\n")
- name = reg_details[0].strip
- email = get_email(reg_details[1])
- telephone = get_telephone(reg_details[2])
- fax = get_fax(reg_details[3])
- end
-
- if content_for_scanner =~ /Registrant's Address:\n((.+\n)+)\n/
- address = ($1.split("\n").map { |part| part.strip }).join(" ")
- end
-
- [Whois::Record::Contact.new(:type => Whois::Record::Contact::TYPE_REGISTRANT, :name => name, :email => email, :phone => telephone, :fax => fax, :address => address)]
- end
-
- private
-
- def get_email(email_candidate)
- $1.strip if email_candidate.strip =~ /^Email: (.+)$/
- end
-
- def get_telephone(telephone_candidate)
- $1.strip if telephone_candidate.strip =~ /^Tel: (.+)$/
- end
-
- def get_fax(fax_candidate)
- $1.strip if fax_candidate.strip =~ /^Fax: (.+)$/
- end
end
end
end
@@ -1,53 +0,0 @@
-#disclaimer
- should: %s raise_error(Whois::PropertyNotSupported)
-
-
-#domain
- should: %s raise_error(Whois::PropertyNotSupported)
-
-#domain_id
- should: %s raise_error(Whois::PropertyNotSupported)
-
-
-#referral_url
- should: %s raise_error(Whois::PropertyNotSupported)
-
-#referral_whois
- should: %s raise_error(Whois::PropertyNotSupported)
-
-
-#status
- should: %s == :available
-
-#available?
- should: %s == true
-
-#registered?
- should: %s == false
-
-
-#created_on
- should: %s raise_error(Whois::PropertyNotSupported)
-
-#updated_on
- should: %s raise_error(Whois::PropertyNotSupported)
-
-#expires_on
- should: %s raise_error(Whois::PropertyNotSupported)
-
-
-#registrar
- should: %s raise_error(Whois::PropertyNotSupported)
-
-#registrant_contacts
- should: %s raise_error(Whois::PropertyNotSupported)
-
-#admin_contacts
- should: %s raise_error(Whois::PropertyNotSupported)
-
-#technical_contacts
- should: %s raise_error(Whois::PropertyNotSupported)
-
-
-#nameservers
- should: %s raise_error(Whois::PropertyNotSupported)
@@ -1 +0,0 @@
-Available
@@ -1,53 +0,0 @@
-#disclaimer
- should: %s raise_error(Whois::PropertyNotSupported)
-
-
-#domain
- should: %s raise_error(Whois::PropertyNotSupported)
-
-#domain_id
- should: %s raise_error(Whois::PropertyNotSupported)
-
-
-#referral_url
- should: %s raise_error(Whois::PropertyNotSupported)
-
-#referral_whois
- should: %s raise_error(Whois::PropertyNotSupported)
-
-
-#status
- should: %s == :registered
-
-#available?
- should: %s == false
-
-#registered?
- should: %s == true
-
-
-#created_on
- should: %s raise_error(Whois::PropertyNotSupported)
-
-#updated_on
- should: %s raise_error(Whois::PropertyNotSupported)
-
-#expires_on
- should: %s raise_error(Whois::PropertyNotSupported)
-
-
-#registrar
- should: %s raise_error(Whois::PropertyNotSupported)
-
-#registrant_contacts
- should: %s raise_error(Whois::PropertyNotSupported)
-
-#admin_contacts
- should: %s raise_error(Whois::PropertyNotSupported)
-
-#technical_contacts
- should: %s raise_error(Whois::PropertyNotSupported)
-
-
-#nameservers
- should: %s raise_error(Whois::PropertyNotSupported)
@@ -1,2 +0,0 @@
-Registered
-%referral url:http://www.coza.net.za/cgi-bin/whois.sh?Domain=google
@@ -1,104 +0,0 @@
-# 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.coza.net.za/status_available.expected
-#
-# and regenerate the tests with the following rake task
-#
-# $ rake spec:generate
-#
-
-require 'spec_helper'
-require 'whois/record/parser/whois.coza.net.za.rb'
-
-describe Whois::Record::Parser::WhoisCozaNetZa, "status_available.expected" do
-
- subject do
- file = fixture("responses", "whois.coza.net.za/status_available.txt")
- part = Whois::Record::Part.new(:body => File.read(file))
- described_class.new(part)
- end
-
- describe "#disclaimer" do
- it do
- lambda { subject.disclaimer }.should raise_error(Whois::PropertyNotSupported)
- end
- end
- describe "#domain" do
- it do
- lambda { subject.domain }.should raise_error(Whois::PropertyNotSupported)
- end
- end
- describe "#domain_id" do
- it do
- lambda { subject.domain_id }.should raise_error(Whois::PropertyNotSupported)
- end
- end
- describe "#referral_url" do
- it do
- lambda { subject.referral_url }.should raise_error(Whois::PropertyNotSupported)
- end
- end
- describe "#referral_whois" do
- it do
- lambda { subject.referral_whois }.should raise_error(Whois::PropertyNotSupported)
- end
- end
- describe "#status" do
- it do
- subject.status.should == :available
- end
- end
- describe "#available?" do
- it do
- subject.available?.should == true
- end
- end
- describe "#registered?" do
- it do
- subject.registered?.should == false
- end
- end
- describe "#created_on" do
- it do
- lambda { subject.created_on }.should raise_error(Whois::PropertyNotSupported)
- end
- end
- describe "#updated_on" do
- it do
- lambda { subject.updated_on }.should raise_error(Whois::PropertyNotSupported)
- end
- end
- describe "#expires_on" do
- it do
- lambda { subject.expires_on }.should raise_error(Whois::PropertyNotSupported)
- end
- end
- describe "#registrar" do
- it do
- lambda { subject.registrar }.should raise_error(Whois::PropertyNotSupported)
- end
- end
- describe "#registrant_contacts" do
- it do
- lambda { subject.registrant_contacts }.should raise_error(Whois::PropertyNotSupported)
- end
- end
- describe "#admin_contacts" do
- it do
- lambda { subject.admin_contacts }.should raise_error(Whois::PropertyNotSupported)
- end
- end
- describe "#technical_contacts" do
- it do
- lambda { subject.technical_contacts }.should raise_error(Whois::PropertyNotSupported)
- end
- end
- describe "#nameservers" do
- it do
- lambda { subject.nameservers }.should raise_error(Whois::PropertyNotSupported)
- end
- end
-end
Oops, something went wrong.

0 comments on commit 7c7fe74

Please sign in to comment.