Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Updated .au TLD parser from whois.ausregistry.net.au to whois.audns.n…

…et.au (closes #27)
  • Loading branch information...
commit ac0360e803892ff3a5aa0ebb82c826bdb5ed17bc 1 parent 86ebbdb
@weppos authored
View
2  CHANGELOG.rdoc
@@ -20,6 +20,8 @@
* CHANGED: Updated .sa TLD parser from saudinic.net.sa to whois.nic.net.sa (closes #29)
+* CHANGED: Updated .au TLD parser from whois.ausregistry.net.au to whois.audns.net.au (closes #27)
+
== Release 1.2.1
View
71 lib/whois/answer/parser/whois.audns.net.au.rb
@@ -0,0 +1,71 @@
+#
+# = Ruby Whois
+#
+# An intelligent pure Ruby WHOIS client and parser.
+#
+#
+# Category:: Net
+# Package:: Whois
+# Author:: Simone Carletti <weppos@weppos.net>
+# License:: MIT License
+#
+#--
+#
+#++
+
+
+require 'whois/answer/parser/base'
+
+
+module Whois
+ class Answer
+ class Parser
+
+ #
+ # = whois.audns.net.au parser
+ #
+ # Parser for the whois.audns.net.au server.
+ #
+ # NOTE: This parser is just a stub and provides only a few basic methods
+ # to check for domain availability and get domain status.
+ # Please consider to contribute implementing missing methods.
+ # See WhoisNicIt parser for an explanation of all available methods
+ # and examples.
+ #
+ class WhoisAudnsNetAu < Base
+
+ property_supported :status do
+ @status ||= if content_for_scanner =~ /Status:\s+(.*)\n/
+ $1
+ end
+ end
+
+ property_supported :available? do
+ @available ||= (content_for_scanner.strip == "No Data Found")
+ end
+
+ property_supported :registered? do
+ !available?
+ end
+
+
+ property_not_supported :created_on
+
+ property_supported :updated_on do
+ @updated_on ||= if content_for_scanner =~ /Last Modified:\s+(.*)\n/
+ Time.parse($1)
+ end
+ end
+
+ property_not_supported :expires_on
+
+
+ property_supported :nameservers do
+ @nameservers ||= content_for_scanner.scan(/Name Server:\s+(.+)\n/).flatten
+ end
+
+ end
+
+ end
+ end
+end
View
42 lib/whois/answer/parser/whois.ausregistry.net.au.rb
@@ -14,7 +14,7 @@
#++
-require 'whois/answer/parser/base'
+require 'whois/answer/parser/whois.audns.net.au'
module Whois
@@ -25,45 +25,9 @@ class Parser
# = whois.ausregistry.net.au parser
#
# Parser for the whois.ausregistry.net.au server.
+ # Aliases the whois.audns.net.au.
#
- # NOTE: This parser is just a stub and provides only a few basic methods
- # to check for domain availability and get domain status.
- # Please consider to contribute implementing missing methods.
- # See WhoisNicIt parser for an explanation of all available methods
- # and examples.
- #
- class WhoisAusregistryNetAu < Base
-
- property_supported :status do
- @status ||= if content_for_scanner =~ /Status:\s+(.*)\n/
- $1
- end
- end
-
- property_supported :available? do
- @available ||= (content_for_scanner.strip == "No Data Found")
- end
-
- property_supported :registered? do
- !available?
- end
-
-
- property_not_supported :created_on
-
- property_supported :updated_on do
- @updated_on ||= if content_for_scanner =~ /Last Modified:\s+(.*)\n/
- Time.parse($1)
- end
- end
-
- property_not_supported :expires_on
-
-
- property_supported :nameservers do
- @nameservers ||= content_for_scanner.scan(/Name Server:\s+(.+)\n/).flatten
- end
-
+ class WhoisAusregistryNetAu < WhoisAudnsNetAu
end
end
View
1  lib/whois/answer/parser/whois.cnnic.net.cn.rb
@@ -14,7 +14,6 @@
#++
-require 'whois/answer/parser/base'
require 'whois/answer/parser/whois.cnnic.cn'
View
2  test/list_tld
@@ -60,7 +60,7 @@ ar;;;
as;whois.nic.as;google.as;u34jedzcq.as
#Whois::Server.define :tld, ".priv.at", "whois.nic.priv.at"
at;whois.nic.at;google.at;u34jedzcq.at
-au;whois.ausregistry.net.au;google.com.au;u34jedzcq.com.au
+au;whois.audns.net.au;google.com.au;u34jedzcq.com.au
aw;;;
ax;;;
az;;;
View
0  ...es/whois.ausregistry.net.au/available.txt → ...esponses/whois.audns.net.au/available.txt
File renamed without changes
View
0  ...s/whois.ausregistry.net.au/registered.txt → ...sponses/whois.audns.net.au/registered.txt
File renamed without changes
View
70 test/whois/answer/parser/whois.audns.net.au_test.rb
@@ -0,0 +1,70 @@
+require 'test_helper'
+require 'whois/answer/parser/whois.audns.net.au'
+
+class AnswerParserWhoisAudnsNetAuTest < Whois::Answer::Parser::TestCase
+
+ def setup
+ @klass = Whois::Answer::Parser::WhoisAudnsNetAu
+ @host = "whois.audns.net.au"
+ end
+
+
+ def test_status
+ parser = @klass.new(load_part('/registered.txt'))
+ expected = "ok"
+ assert_equal expected, parser.status
+ assert_equal expected, parser.instance_eval { @status }
+
+ parser = @klass.new(load_part('/available.txt'))
+ expected = nil
+ assert_equal expected, parser.status
+ assert_equal expected, parser.instance_eval { @status }
+ end
+
+ def test_available?
+ assert !@klass.new(load_part('/registered.txt')).available?
+ assert @klass.new(load_part('/available.txt')).available?
+ end
+
+ def test_registered?
+ assert @klass.new(load_part('/registered.txt')).registered?
+ assert !@klass.new(load_part('/available.txt')).registered?
+ end
+
+
+ def test_created_on
+ assert_raise(Whois::PropertyNotSupported) { @klass.new(load_part('/registered.txt')).created_on }
+ assert_raise(Whois::PropertyNotSupported) { @klass.new(load_part('/available.txt')).created_on }
+ end
+
+ def test_updated_on
+ parser = @klass.new(load_part('/registered.txt'))
+ expected = Time.parse("2009-10-12 16:05:44 UTC")
+ assert_equal expected, parser.updated_on
+ assert_equal expected, parser.instance_eval { @updated_on }
+
+ parser = @klass.new(load_part('/available.txt'))
+ expected = nil
+ assert_equal expected, parser.updated_on
+ assert_equal expected, parser.instance_eval { @updated_on }
+ end
+
+ def test_expires_on
+ assert_raise(Whois::PropertyNotSupported) { @klass.new(load_part('/registered.txt')).expires_on }
+ assert_raise(Whois::PropertyNotSupported) { @klass.new(load_part('/available.txt')).expires_on }
+ end
+
+
+ def test_nameservers
+ parser = @klass.new(load_part('/registered.txt'))
+ expected = %w( ns1.google.com ns2.google.com ns3.google.com ns4.google.com )
+ assert_equal expected, parser.nameservers
+ assert_equal expected, parser.instance_eval { @nameservers }
+
+ parser = @klass.new(load_part('/available.txt'))
+ expected = %w()
+ assert_equal expected, parser.nameservers
+ assert_equal expected, parser.instance_eval { @nameservers }
+ end
+
+end
View
64 test/whois/answer/parser/whois.ausregistry.net.au_test.rb
@@ -1,70 +1,12 @@
require 'test_helper'
require 'whois/answer/parser/whois.ausregistry.net.au'
+require 'whois/answer/parser/whois.audns.net.au_test'
-class AnswerParserWhoisAusregistryNetAuTest < Whois::Answer::Parser::TestCase
+class AnswerParserWhoisAusregistryNetAuTest < AnswerParserWhoisAudnsNetAuTest
def setup
@klass = Whois::Answer::Parser::WhoisAusregistryNetAu
- @host = "whois.ausregistry.net.au"
- end
-
-
- def test_status
- parser = @klass.new(load_part('/registered.txt'))
- expected = "ok"
- assert_equal expected, parser.status
- assert_equal expected, parser.instance_eval { @status }
-
- parser = @klass.new(load_part('/available.txt'))
- expected = nil
- assert_equal expected, parser.status
- assert_equal expected, parser.instance_eval { @status }
- end
-
- def test_available?
- assert !@klass.new(load_part('/registered.txt')).available?
- assert @klass.new(load_part('/available.txt')).available?
- end
-
- def test_registered?
- assert @klass.new(load_part('/registered.txt')).registered?
- assert !@klass.new(load_part('/available.txt')).registered?
- end
-
-
- def test_created_on
- assert_raise(Whois::PropertyNotSupported) { @klass.new(load_part('/registered.txt')).created_on }
- assert_raise(Whois::PropertyNotSupported) { @klass.new(load_part('/available.txt')).created_on }
- end
-
- def test_updated_on
- parser = @klass.new(load_part('/registered.txt'))
- expected = Time.parse("2009-10-12 16:05:44 UTC")
- assert_equal expected, parser.updated_on
- assert_equal expected, parser.instance_eval { @updated_on }
-
- parser = @klass.new(load_part('/available.txt'))
- expected = nil
- assert_equal expected, parser.updated_on
- assert_equal expected, parser.instance_eval { @updated_on }
- end
-
- def test_expires_on
- assert_raise(Whois::PropertyNotSupported) { @klass.new(load_part('/registered.txt')).expires_on }
- assert_raise(Whois::PropertyNotSupported) { @klass.new(load_part('/available.txt')).expires_on }
- end
-
-
- def test_nameservers
- parser = @klass.new(load_part('/registered.txt'))
- expected = %w( ns1.google.com ns2.google.com ns3.google.com ns4.google.com )
- assert_equal expected, parser.nameservers
- assert_equal expected, parser.instance_eval { @nameservers }
-
- parser = @klass.new(load_part('/available.txt'))
- expected = %w()
- assert_equal expected, parser.nameservers
- assert_equal expected, parser.instance_eval { @nameservers }
+ @host = "whois.audns.net.au"
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.