Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add support for registrar property in .ca names.

  • Loading branch information...
commit d0b7f630691f61101b3fec4521fffdf46708b44f 1 parent dea9050
@aeden aeden authored
View
6 lib/whois/answer/parser/whois.cira.ca.rb
@@ -82,6 +82,12 @@ class WhoisCiraCa < Base
end
end
+ property_supported :registrar do
+ @registrar ||= if content_for_scanner =~ /Registrar:\n.*Name:\s+([^\s]+)/
+ Whois::Answer::Registrar.new(:name => $1, :organization => $1)
+ end
+ end
+
end
end
View
2  lib/whois/version.rb
@@ -19,7 +19,7 @@ module Whois
module Version
MAJOR = 1
MINOR = 3
- PATCH = 2
+ PATCH = 3
BUILD = nil
STRING = [MAJOR, MINOR, PATCH, BUILD].compact.join(".")
View
48 test/testcases/responses/whois.cira.ca/property_registrar.txt
@@ -0,0 +1,48 @@
+Domain name: google.ca
+Domain status: EXIST
+Domain number: 273289
+Approval date: 2000/10/03
+Renewal date: 2011/04/28
+Updated date: 2009/05/27
+
+Registrar:
+ Name: Webnames.ca Inc.
+ Number: 70
+
+Registrant:
+ Name: Google Inc.
+ Number: 853723
+
+Administrative contact:
+ Name: Rose Hagan
+ Job Title:
+ Postal address: Google Inc.
+ 130 King St. W., Suite 1800
+ Toronto ON M5X 1E3 Canada
+ Phone: 1 416 8653361
+ Fax: 1 416 9456616
+ Email: dns-admin@google.com
+
+Technical contact:
+ Name: Rose Hagan
+ Job Title:
+ Postal address: Google Inc.
+ 1600 Amphitheatre Parkway
+ Mountain View CA 94043 United States
+ Phone: 1 650 2530000
+ Fax: 1 650 6188571
+ Email: dns-admin@google.com
+
+Name servers:
+ ns1.google.com 216.239.32.10
+ ns2.google.com 216.239.34.10
+ ns3.google.com 216.239.36.10
+ ns4.google.com 216.239.38.10
+
+% WHOIS look-up made at 2009-12-23 13:52:54 (GMT)
+%
+% Use of CIRA's WHOIS service is governed by the Terms of Use in its Legal
+% Notice, available at http://www.cira.ca/legal-notice/?lang=en
+%
+% (c) 2007 Canadian Internet Registration Authority, (http://www.cira.ca/)
+
View
2  test/whois/answer/parser/jobswhois.verisign-grs.com_test.rb
@@ -158,4 +158,4 @@ def test_nameservers
assert_equal expected, parser.instance_eval { @nameservers }
end
-end
+end
View
27 test/whois/answer/parser/whois.cira.ca_test.rb
@@ -95,4 +95,31 @@ def test_nameservers
assert_equal expected, parser.instance_eval { @nameservers }
end
+ def test_registrar_with_registered
+ parser = @klass.new(load_part('/registered.txt'))
+ expected = parser.registrar
+ assert_equal expected, parser.registrar
+ assert_equal expected, parser.instance_eval { @registrar }
+
+ assert_instance_of Whois::Answer::Registrar, expected
+ assert_equal "Webnames.ca", expected.name
+ end
+
+ def test_registrar_with_available
+ parser = @klass.new(load_part('/available.txt'))
+ expected = nil
+ assert_equal expected, parser.registrar
+ assert_equal expected, parser.instance_eval { @registrar }
+ end
+
+ def test_registrar
+ parser = @klass.new(load_part('/property_registrar.txt'))
+ result = parser.registrar
+
+ assert_instance_of Whois::Answer::Registrar, result
+ assert_equal nil, result.id
+ assert_equal "Webnames.ca", result.name
+ assert_equal "Webnames.ca", result.organization
+ #assert_equal "http://www.encirca.com", result.url
+ end
end
Please sign in to comment.
Something went wrong with that request. Please try again.