Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added support for 'nameservers' property for all existing parsers.

  • Loading branch information...
commit e70b10e21b4be1879aa0e4b96376259667eb0570 1 parent e091219
Simone Carletti authored
Showing with 1,039 additions and 106 deletions.
  1. +18 −16 CHANGELOG.rdoc
  2. +11 −2 lib/whois/answer/parser/NOTES.txt
  3. +6 −0 lib/whois/answer/parser/jobswhois.verisign-grs.com.rb
  4. +5 −0 lib/whois/answer/parser/whois.aero.rb
  5. +5 −0 lib/whois/answer/parser/whois.afilias-grs.info.rb
  6. +1 −1  lib/whois/answer/parser/whois.afilias.info.rb
  7. +5 −0 lib/whois/answer/parser/whois.biz.rb
  8. +10 −0 lib/whois/answer/parser/whois.cat.rb
  9. +8 −0 lib/whois/answer/parser/whois.cira.ca.rb
  10. +9 −1 lib/whois/answer/parser/whois.domain-registry.nl.rb
  11. +7 −2 lib/whois/answer/parser/whois.domainregistry.ie.rb
  12. +5 −0 lib/whois/answer/parser/whois.dotmobiregistry.net.rb
  13. +9 −1 lib/whois/answer/parser/whois.educause.edu.rb
  14. +3 −0  lib/whois/answer/parser/whois.eu.org.rb
  15. +3 −5 lib/whois/answer/parser/whois.eu.rb
  16. +5 −0 lib/whois/answer/parser/whois.iana.org.rb
  17. +6 −1 lib/whois/answer/parser/whois.isnic.is.rb
  18. +10 −0 lib/whois/answer/parser/whois.museum.rb
  19. +1 −1  lib/whois/answer/parser/whois.nic-se.se.rb
  20. +6 −1 lib/whois/answer/parser/whois.nic.asia.rb
  21. +6 −0 lib/whois/answer/parser/whois.nic.cc.rb
  22. +9 −1 lib/whois/answer/parser/whois.nic.cd.rb
  23. +9 −1 lib/whois/answer/parser/whois.nic.ch.rb
  24. +6 −1 lib/whois/answer/parser/whois.nic.coop.rb
  25. +6 −1 lib/whois/answer/parser/whois.nic.fr.rb
  26. +9 −1 lib/whois/answer/parser/whois.nic.gl.rb
  27. +4 −1 lib/whois/answer/parser/whois.nic.gov.rb
  28. +6 −1 lib/whois/answer/parser/whois.nic.im.rb
  29. +3 −0  lib/whois/answer/parser/whois.nic.io.rb
  30. +9 −1 lib/whois/answer/parser/whois.nic.ly.rb
  31. +9 −1 lib/whois/answer/parser/whois.nic.mu.rb
  32. +4 −1 lib/whois/answer/parser/whois.nic.name.rb
  33. +1 −1  lib/whois/answer/parser/whois.nic.nu.rb
  34. +9 −1 lib/whois/answer/parser/whois.nic.tl.rb
  35. +6 −1 lib/whois/answer/parser/whois.nic.travel.rb
  36. +1 −1  lib/whois/answer/parser/whois.nic.tv.rb
  37. +9 −1 lib/whois/answer/parser/whois.nic.uk.rb
  38. +6 −1 lib/whois/answer/parser/whois.nic.us.rb
  39. +1 −1  lib/whois/answer/parser/whois.nic.ve.rb
  40. +1 −1  lib/whois/answer/parser/whois.norid.no.rb
  41. +9 −1 lib/whois/answer/parser/whois.register.bg.rb
  42. +4 −1 lib/whois/answer/parser/whois.registro.br.rb
  43. +12 −1 lib/whois/answer/parser/whois.ripe.net.rb
  44. +6 −1 lib/whois/answer/parser/whois.ripn.net.rb
  45. +6 −1 lib/whois/answer/parser/whois.rotld.ro.rb
  46. +9 −1 lib/whois/answer/parser/whois.samoanic.ws.rb
  47. +9 −1 lib/whois/answer/parser/whois.za.net.rb
  48. +9 −1 lib/whois/answer/parser/whois.za.org.rb
  49. +13 −0 test/answer/parser/jobswhois.verisign-grs.com_test.rb
  50. +14 −1 test/answer/parser/whois.aero_test.rb
  51. +91 −0 test/answer/parser/whois.afilias-grs.info_test.rb
  52. +13 −0 test/answer/parser/whois.biz_test.rb
  53. +13 −0 test/answer/parser/whois.cat_test.rb
  54. +14 −1 test/answer/parser/whois.cira.ca_test.rb
  55. +2 −2 test/answer/parser/whois.denic.de_test.rb
  56. +14 −1 test/answer/parser/whois.domain-registry.nl_test.rb
  57. +13 −0 test/answer/parser/whois.domainregistry.ie_test.rb
  58. +13 −0 test/answer/parser/whois.dotmobiregistry.net_test.rb
  59. +13 −0 test/answer/parser/whois.educause.edu_test.rb
  60. +7 −1 test/answer/parser/whois.eu.org_test.rb
  61. +1 −1  test/answer/parser/whois.eu_test.rb
  62. +15 −1 test/answer/parser/whois.iana.org_test.rb
  63. +13 −0 test/answer/parser/whois.isnic.is_test.rb
  64. +13 −0 test/answer/parser/whois.museum_test.rb
  65. +2 −2 test/answer/parser/whois.nic.ac_test.rb
  66. +14 −1 test/answer/parser/whois.nic.asia_test.rb
  67. +14 −1 test/answer/parser/whois.nic.cc_test.rb
  68. +14 −1 test/answer/parser/whois.nic.cd_test.rb
  69. +15 −2 test/answer/parser/whois.nic.ch_test.rb
  70. +13 −0 test/answer/parser/whois.nic.coop_test.rb
  71. +65 −0 test/answer/parser/whois.nic.fr_test.rb
  72. +15 −2 test/answer/parser/whois.nic.gl_test.rb
  73. +8 −2 test/answer/parser/whois.nic.gov_test.rb
  74. +14 −1 test/answer/parser/whois.nic.im_test.rb
  75. +7 −1 test/answer/parser/whois.nic.io_test.rb
  76. +1 −1  test/answer/parser/whois.nic.it_test.rb
  77. +15 −2 test/answer/parser/whois.nic.ly_test.rb
  78. +26 −0 test/answer/parser/whois.nic.mu_test.rb
  79. +7 −1 test/answer/parser/whois.nic.name_test.rb
  80. +14 −1 test/answer/parser/whois.nic.tl_test.rb
  81. +14 −1 test/answer/parser/whois.nic.travel_test.rb
  82. +14 −1 test/answer/parser/whois.nic.uk_test.rb
  83. +14 −1 test/answer/parser/whois.nic.us_test.rb
  84. +1 −1  test/answer/parser/whois.norid.no_test.rb
  85. +3 −3 test/answer/parser/whois.publicinterestregistry.net_test.rb
  86. +15 −2 test/answer/parser/whois.register.bg_test.rb
  87. +7 −1 test/answer/parser/whois.registro.br_test.rb
  88. +65 −2 test/answer/parser/whois.ripe.net_test.rb
  89. +27 −1 test/answer/parser/whois.ripn.net_test.rb
  90. +15 −2 test/answer/parser/whois.rotld.ro_test.rb
  91. +14 −1 test/answer/parser/whois.samoanic.ws_test.rb
  92. +15 −2 test/answer/parser/whois.za.net_test.rb
  93. +15 −2 test/answer/parser/whois.za.org_test.rb
  94. +1 −1  test/server/adapters/none_test.rb
  95. +2 −2 test/testcases/responses/whois.registro.br/registered.txt
34 CHANGELOG.rdoc
View
@@ -4,6 +4,8 @@
* ADDED: Added simple .ve TLD parser (whois.nic.ve).
+* ADDED: Added support for 'nameservers' property for all existing parsers.
+
* FIXED: With some .eu domains, whois.eu parser returns invalid values for nameservers.
* CHANGED: jobswhois.verisign-grs.com now correctly raises PropertyNotSupported when a property is not supported.
@@ -44,10 +46,10 @@
== Release 1.0.4
-* FIXED: Normalize 'nameservers' property return value. Always return an Array even if there's no nameserver.
-
* ADDED: Added Symbol.to_proc core extension to ensure compatibility with Ruby 1.8.6.
+* FIXED: Normalize 'nameservers' property return value. Always return an Array even if there's no nameserver.
+
* CHANGED: Suppress Japanese output for the .js TLD [axic]
@@ -59,18 +61,18 @@
* SERVER: Updated web address for the .co TLD (closes #13)
-* FIXED: The whois.nic.it parser extracts the wrong Contact country_code property [axic]
-
-* FIXED: With some .de domains, whois.denic.de parser returns invalid values for nameservers (closes #14)
-
-* FIXED: whois.crsnic.net crashes with reserved IANA domains (ex y.com)
-
* ADDED: Support for 'Contact#zip' property for the whois.nic.it parser [axic]
* ADDED: Support for 'nameservers' property for the whois.adamsnames.tc parser.
* ADDED: Compatibility with semver.org
+* FIXED: The whois.nic.it parser extracts the wrong Contact country_code property [axic]
+
+* FIXED: With some .de domains, whois.denic.de parser returns invalid values for nameservers (closes #14)
+
+* FIXED: whois.crsnic.net crashes with reserved IANA domains (ex y.com)
+
== Release 1.0.2
@@ -100,14 +102,6 @@
* SERVER: .dk TLD server requires --show-handles option (closes REDMINE-426)
-* FIXED: Whois hosts containing a - are not correctly converted into a Ruby class, ex. whois.domain-registry.nl (closes REDMINE-389)
-
-* FIXED: In case of exception, the CLI doesn't exit nicely (closes REDMINE-333)
-
-* FIXED: Some tests are not compatible with Ruby 1.9
-
-* FIXED: Flagged created_on and expires_on properties as not supported for .de TLD.
-
* ADDED: Simple .at TLD parser.
* ADDED: Simple .be TLD parser.
@@ -200,6 +194,14 @@
* ADDED: Whois::WebInterfaceError now exposes #url attribute.
+* FIXED: Whois hosts containing a - are not correctly converted into a Ruby class, ex. whois.domain-registry.nl (closes REDMINE-389)
+
+* FIXED: In case of exception, the CLI doesn't exit nicely (closes REDMINE-333)
+
+* FIXED: Some tests are not compatible with Ruby 1.9
+
+* FIXED: Flagged created_on and expires_on properties as not supported for .de TLD.
+
* CHANGED: All not supported properties now raise a PropertyNotSupported error instead of returning nil.
* CHANGED: Depending on where you ask for a property, the library now returns the most expected value according to property status.
13 lib/whois/answer/parser/NOTES.txt
View
@@ -1,3 +1,12 @@
.us == .biz == .travel
-.mobi == .info (afilias)
- (afilias)
+
+== afilias
+
+whois.dotmobyregistry.net (.mobi)
+whois.afilias.info (.info)
+whois.afilias-grs.info (.bz, .gi, .hn, .lc, .mn, .sc, .vc)
+whois.aero (.aero)
+
+
+whois.museum (.museum)
+whois.cat (.cat)
6 lib/whois/answer/parser/jobswhois.verisign-grs.com.rb
View
@@ -84,6 +84,12 @@ class JobswhoisVerisignGrsCom < Base
end
+ property_supported :nameservers do
+ @nameservers ||= node("Name Server") { |values| [*values].map(&:downcase) }
+ @nameservers ||= []
+ end
+
+
protected
def parse
5 lib/whois/answer/parser/whois.aero.rb
View
@@ -67,6 +67,11 @@ class WhoisAero < Base
end
end
+
+ property_supported :nameservers do
+ @nameservers ||= content_for_scanner.scan(/Name Server:([^\s]*)\n/).flatten.map(&:downcase)
+ end
+
end
end
5 lib/whois/answer/parser/whois.afilias-grs.info.rb
View
@@ -65,6 +65,11 @@ class WhoisAfiliasGrsInfo < Base
end
end
+
+ property_supported :nameservers do
+ @nameservers ||= content_for_scanner.scan(/Name Server:([^\s]*)\n/).flatten.map(&:downcase)
+ end
+
end
end
2  lib/whois/answer/parser/whois.afilias.info.rb
View
@@ -67,7 +67,7 @@ class WhoisAfiliasInfo < Base
property_supported :nameservers do
- @nameservers ||= content_for_scanner.scan(/Name Server:([^ ]*?)\n/).flatten.map(&:downcase)
+ @nameservers ||= content_for_scanner.scan(/Name Server:([^\s]*)\n/).flatten.map(&:downcase)
end
end
5 lib/whois/answer/parser/whois.biz.rb
View
@@ -65,6 +65,11 @@ class WhoisBiz < Base
end
end
+
+ property_supported :nameservers do
+ @nameservers ||= content_for_scanner.scan(/Name Server:\s+(.*)\n/).flatten.map(&:downcase)
+ end
+
end
end
10 lib/whois/answer/parser/whois.cat.rb
View
@@ -67,6 +67,16 @@ class WhoisCat < Base
end
end
+ # Nameservers are listed in the following formats:
+ #
+ # Name Server: dns2.gencat.cat 83.247.132.4
+ # Name Server: dns.gencat.net
+ #
+ # In both cases, always return only the name.
+ property_supported :nameservers do
+ @nameservers ||= content_for_scanner.scan(/Name Server:\s+(.*)\n/).flatten.map { |value| value.split(" ").first }
+ end
+
end
end
8 lib/whois/answer/parser/whois.cira.ca.rb
View
@@ -70,6 +70,14 @@ class WhoisCiraCa < Base
end
end
+
+ property_supported :nameservers do
+ @nameservers ||= if content_for_scanner =~ /Name servers:\n((?:\s+([^\s]+)\s+([^\s]+)\n)+)/
+ $1.split("\n").map { |value| value.split(" ").first }
+ end
+ @nameservers ||= []
+ end
+
end
end
10 lib/whois/answer/parser/whois.domain-registry.nl.rb
View
@@ -65,8 +65,16 @@ class WhoisDomainRegistryNl < Base
property_not_supported :expires_on
+
+ property_supported :nameservers do
+ @nameservers ||= if content_for_scanner =~ /Domain nameservers:\n((.+\n)+)\n/
+ $1.split("\n").map(&:strip)
+ end
+ @nameservers ||= []
+ end
+
end
end
end
-end
+end
9 lib/whois/answer/parser/whois.domainregistry.ie.rb
View
@@ -54,15 +54,20 @@ class WhoisDomainregistryIe < Base
property_not_supported :created_on
property_not_supported :updated_on
-
+
property_supported :expires_on do
@expires_on ||= if content_for_scanner =~ /renewal:\s+(.*)\n/
Time.parse($1)
end
end
+
+ property_supported :nameservers do
+ @nameservers ||= content_for_scanner.scan(/nserver:\s+(.+)\n/).flatten
+ end
+
end
end
end
-end
+end
5 lib/whois/answer/parser/whois.dotmobiregistry.net.rb
View
@@ -65,6 +65,11 @@ class WhoisDotmobiregistryNet < Base
end
end
+
+ property_supported :nameservers do
+ @nameservers ||= content_for_scanner.scan(/Name Server:([^\s]*)\n/).flatten.map(&:downcase)
+ end
+
end
end
10 lib/whois/answer/parser/whois.educause.edu.rb
View
@@ -69,8 +69,16 @@ class WhoisEducauseEdu < Base
end
end
+
+ property_supported :nameservers do
+ @nameservers ||= if content_for_scanner =~ /Name Servers: \n((.+\n)+)\n/
+ $1.split("\n").map { |value| value.split(" ").first.downcase }
+ end
+ @nameservers ||= []
+ end
+
end
end
end
-end
+end
3  lib/whois/answer/parser/whois.eu.org.rb
View
@@ -57,6 +57,9 @@ class WhoisEuOrg < Base
property_not_supported :expires_on
+
+ property_not_supported :nameservers
+
end
end
8 lib/whois/answer/parser/whois.eu.rb
View
@@ -70,10 +70,8 @@ class WhoisEu < Base
#
# In both cases, always return only the name.
property_supported :nameservers do
- @nameservers ||= if content_for_scanner =~ (/Nameservers:\n((?:\t.*\n)+)/)
- $1.split("\n").map do |value|
- value.strip.split(" ").first
- end
+ @nameservers ||= if content_for_scanner =~ /Nameservers:\n((.+\n)+)\n/
+ $1.split("\n").map { |value| value.strip.split(" ").first }
end
@nameservers ||= []
end
@@ -82,4 +80,4 @@ class WhoisEu < Base
end
end
-end
+end
5 lib/whois/answer/parser/whois.iana.org.rb
View
@@ -65,6 +65,11 @@ class WhoisIanaOrg < Base
property_not_supported :expires_on
+
+ property_supported :nameservers do
+ @nameservers ||= content_for_scanner.scan(/Nameserver:\s(.*)\n/).flatten.map { |value| value.chomp(".") }
+ end
+
end
end
7 lib/whois/answer/parser/whois.isnic.is.rb
View
@@ -65,8 +65,13 @@ class WhoisIsnicIs < Base
end
end
+
+ property_supported :nameservers do
+ @nameservers ||= content_for_scanner.scan(/nserver:\s+(.+)\n/).flatten
+ end
+
end
end
end
-end
+end
10 lib/whois/answer/parser/whois.museum.rb
View
@@ -69,6 +69,16 @@ class WhoisMuseum < Base
end
end
+ # Nameservers are listed in the following formats:
+ #
+ # Name Server: nic.frd.se
+ # Name Server: nic.museum 130.242.24.5
+ #
+ # In both cases, always return only the name.
+ property_supported :nameservers do
+ @nameservers ||= content_for_scanner.scan(/Name Server:\s+(.*)\n/).flatten.map { |value| value.split(" ").first }
+ end
+
end
end
2  lib/whois/answer/parser/whois.nic-se.se.rb
View
@@ -75,7 +75,7 @@ class WhoisNicSeSe < Base
#
# In both cases, always return only the name.
property_supported :nameservers do
- @nameservers ||= content_for_scanner.scan(/nserver:\s+(.*)\n/).flatten.map { |value| value.split(" ").first }
+ @nameservers ||= content_for_scanner.scan(/nserver:\s+(.+)\n/).flatten.map { |value| value.split(" ").first }
end
end
7 lib/whois/answer/parser/whois.nic.asia.rb
View
@@ -67,8 +67,13 @@ class WhoisNicAsia < Base
end
end
+
+ property_supported :nameservers do
+ @nameservers ||= content_for_scanner.scan(/Nameservers:([^\s]+)\n/).flatten.map(&:downcase)
+ end
+
end
end
end
-end
+end
6 lib/whois/answer/parser/whois.nic.cc.rb
View
@@ -84,6 +84,12 @@ class WhoisNicCc < Base
end
+ property_supported :nameservers do
+ @nameservers ||= node("Name Server") { |values| [*values].map(&:downcase) }
+ @nameservers ||= []
+ end
+
+
protected
def parse
10 lib/whois/answer/parser/whois.nic.cd.rb
View
@@ -61,8 +61,16 @@ class WhoisNicCd < Base
end
end
+
+ property_supported :nameservers do
+ @nameservers ||= if content_for_scanner =~ /Name Servers:\n((.+\n)+)\n/
+ $1.split("\n").map { |value| value.strip.downcase }
+ end
+ @nameservers ||= []
+ end
+
end
end
end
-end
+end
10 lib/whois/answer/parser/whois.nic.ch.rb
View
@@ -57,8 +57,16 @@ class WhoisNicCh < Base
property_not_supported :expires_on
+
+ property_supported :nameservers do
+ @nameservers ||= if content_for_scanner =~ /Name servers:\n((.+\n)+)(?:\n|\z)/
+ $1.split("\n")
+ end
+ @nameservers ||= []
+ end
+
end
end
end
-end
+end
7 lib/whois/answer/parser/whois.nic.coop.rb
View
@@ -67,8 +67,13 @@ class WhoisNicCoop < Base
end
end
+
+ property_supported :nameservers do
+ @nameservers ||= content_for_scanner.scan(/Host Name:\s+(.+)\n/).flatten
+ end
+
end
end
end
-end
+end
7 lib/whois/answer/parser/whois.nic.fr.rb
View
@@ -67,8 +67,13 @@ class WhoisNicFr < Base
property_not_supported :expires_on
+
+ property_supported :nameservers do
+ @nameservers ||= content_for_scanner.scan(/nserver:\s+(.+)\n/).flatten.map { |value| value.split(" ").first }
+ end
+
end
end
end
-end
+end
10 lib/whois/answer/parser/whois.nic.gl.rb
View
@@ -70,8 +70,16 @@ class WhoisNicGl < Base
end
end
+
+ property_supported :nameservers do
+ @nameservers ||= if content_for_scanner =~ /Name Servers:\n((.+\n)+)\n/
+ $1.split("\n").map { |value| value.strip.downcase }
+ end
+ @nameservers ||= []
+ end
+
end
end
end
-end
+end
5 lib/whois/answer/parser/whois.nic.gov.rb
View
@@ -55,8 +55,11 @@ class WhoisNicGov < Base
property_not_supported :expires_on
+
+ property_not_supported :nameservers
+
end
end
end
-end
+end
7 lib/whois/answer/parser/whois.nic.im.rb
View
@@ -61,8 +61,13 @@ class WhoisNicIm < Base
end
end
+
+ property_supported :nameservers do
+ @nameservers ||= content_for_scanner.scan(/Name Server:\s(.*)\n/).flatten.map { |value| value.chomp(".") }
+ end
+
end
end
end
-end
+end
3  lib/whois/answer/parser/whois.nic.io.rb
View
@@ -57,6 +57,9 @@ class WhoisNicIo < Base
property_not_supported :expires_on
+
+ property_not_supported :nameservers
+
end
end
10 lib/whois/answer/parser/whois.nic.ly.rb
View
@@ -69,8 +69,16 @@ class WhoisNicLy < Base
end
end
+
+ property_supported :nameservers do
+ @nameservers ||= if content_for_scanner =~ /Domain servers in listed order:\n((.+\n)+)\n/
+ $1.split("\n").map(&:strip)
+ end
+ @nameservers ||= []
+ end
+
end
end
end
-end
+end
10 lib/whois/answer/parser/whois.nic.mu.rb
View
@@ -70,8 +70,16 @@ class WhoisNicMu < Base
end
end
+
+ property_supported :nameservers do
+ @nameservers ||= if content_for_scanner =~ /Name Servers:\n((.+\n)+)\n/
+ $1.split("\n").map(&:strip)
+ end
+ @nameservers ||= []
+ end
+
end
end
end
-end
+end
5 lib/whois/answer/parser/whois.nic.name.rb
View
@@ -57,8 +57,11 @@ class WhoisNicName < Base
property_not_supported :expires_on
+
+ property_not_supported :nameservers
+
end
end
end
-end
+end
2  lib/whois/answer/parser/whois.nic.nu.rb
View
@@ -69,7 +69,7 @@ class WhoisNicNu < Base
property_supported :nameservers do
- @nameservers ||= if content =~ /Domain servers in listed order:(.*)Owner and Administrative Contact information for domains/m
+ @nameservers ||= if content_for_scanner =~ /Domain servers in listed order:(.*)Owner and Administrative Contact information for domains/m
$1.split.map(&:strip)
end
@nameservers ||= []
10 lib/whois/answer/parser/whois.nic.tl.rb
View
@@ -69,8 +69,16 @@ class WhoisNicTl < Base
end
end
+
+ property_supported :nameservers do
+ @nameservers ||= if content_for_scanner =~ /Name Servers:\n((.+\n)+)\n/
+ $1.split("\n").map(&:strip)
+ end
+ @nameservers ||= []
+ end
+
end
end
end
-end
+end
7 lib/whois/answer/parser/whois.nic.travel.rb
View
@@ -65,8 +65,13 @@ class WhoisNicTravel < Base
end
end
+
+ property_supported :nameservers do
+ @nameservers ||= content_for_scanner.scan(/Name Server:\s+(.+)\n/).flatten.map(&:downcase)
+ end
+
end
end
end
-end
+end
2  lib/whois/answer/parser/whois.nic.tv.rb
View
@@ -86,7 +86,7 @@ class WhoisNicTv < Base
property_supported :nameservers do
- @nameservers ||= node("Name Server") { |raw| raw.map(&:downcase) }
+ @nameservers ||= node("Name Server") { |values| [*values].map(&:downcase) }
@nameservers ||= []
end
10 lib/whois/answer/parser/whois.nic.uk.rb
View
@@ -68,6 +68,14 @@ class WhoisNicUk < Base
end
+ property_supported :nameservers do
+ @nameservers ||= if content_for_scanner =~ /Name servers:\n((.+\n)+)\n/
+ $1.split("\n").map { |value| value.split(" ").first.downcase }
+ end
+ @nameservers ||= []
+ end
+
+
def valid?
!invalid?
end
@@ -80,4 +88,4 @@ def invalid?
end
end
-end
+end
7 lib/whois/answer/parser/whois.nic.us.rb
View
@@ -65,8 +65,13 @@ class WhoisNicUs < Base
end
end
+
+ property_supported :nameservers do
+ @nameservers ||= content_for_scanner.scan(/Name Server:\s+(.+)\n/).flatten.map(&:downcase)
+ end
+
end
end
end
-end
+end
2  lib/whois/answer/parser/whois.nic.ve.rb
View
@@ -75,4 +75,4 @@ class WhoisNicVe < Base
end
end
-end
+end
2  lib/whois/answer/parser/whois.norid.no.rb
View
@@ -69,4 +69,4 @@ class WhoisNoridNo < Base
end
end
-end
+end
10 lib/whois/answer/parser/whois.register.bg.rb
View
@@ -67,8 +67,16 @@ class WhoisRegisterBg < Base
end
end
+
+ property_supported :nameservers do
+ @nameservers ||= if content_for_scanner =~ /NAME SERVER INFORMATION:\n((.+\n)+)\s+\n/
+ $1.split("\n").map(&:strip)
+ end
+ @nameservers ||= []
+ end
+
end
end
end
-end
+end
5 lib/whois/answer/parser/whois.registro.br.rb
View
@@ -57,8 +57,11 @@ class WhoisRegistroBr < Base
property_not_supported :expires_on
+
+ property_not_supported :nameservers
+
end
end
end
-end
+end
13 lib/whois/answer/parser/whois.ripe.net.rb
View
@@ -57,8 +57,19 @@ class WhoisRipeNet < Base
property_not_supported :expires_on
+
+ # Nameservers are listed in the following formats:
+ #
+ # nserver: ns.nic.mc
+ # nserver: ns.nic.mc 195.78.6.131
+ #
+ # In both cases, always return only the name.
+ property_supported :nameservers do
+ @nameservers ||= content_for_scanner.scan(/nserver:\s+(.+)\n/).flatten.map { |value| value.split(" ").first.downcase }
+ end
+
end
end
end
-end
+end
7 lib/whois/answer/parser/whois.ripn.net.rb
View
@@ -65,8 +65,13 @@ class WhoisRipnNet < Base
end
end
+
+ property_supported :nameservers do
+ @nameservers ||= content_for_scanner.scan(/nserver:\s+(.+)\n/).flatten.map { |value| value.chomp(".") }
+ end
+
end
end
end
-end
+end
7 lib/whois/answer/parser/whois.rotld.ro.rb
View
@@ -57,8 +57,13 @@ class WhoisRotldRo < Base
property_not_supported :expires_on
+
+ property_supported :nameservers do
+ @nameservers ||= content_for_scanner.scan(/Name Server:\s+(.+)\n/).flatten
+ end
+
end
end
end
-end
+end
10 lib/whois/answer/parser/whois.samoanic.ws.rb
View
@@ -69,8 +69,16 @@ class WhoisSamoanicWs < Base
end
end
+
+ property_supported :nameservers do
+ @nameservers ||= if content_for_scanner =~ /Current Nameservers:\n\n((.+\n)+)\n/
+ $1.split("\n").map { |value| value.strip.downcase }
+ end
+ @nameservers ||= []
+ end
+
end
end
end
-end
+end
10 lib/whois/answer/parser/whois.za.net.rb
View
@@ -65,8 +65,16 @@ class WhoisZaNet < Base
property_not_supported :expires_on
+
+ property_supported :nameservers do
+ @nameservers ||= if content_for_scanner =~ /Domain Name Servers listed in order:\n\n((.+\n)+)\n/
+ $1.split("\n").map(&:strip).reject(&:empty?).compact
+ end
+ @nameservers ||= []
+ end
+
end
end
end
-end
+end
10 lib/whois/answer/parser/whois.za.org.rb
View
@@ -65,8 +65,16 @@ class WhoisZaOrg < Base
property_not_supported :expires_on
+
+ property_supported :nameservers do
+ @nameservers ||= if content_for_scanner =~ /Domain Name Servers listed in order:\n\n((.+\n)+)\n/
+ $1.split("\n").map(&:strip).reject(&:empty?).compact
+ end
+ @nameservers ||= []
+ end
+
end
end
end
-end
+end
13 test/answer/parser/jobswhois.verisign-grs.com_test.rb
View
@@ -117,4 +117,17 @@ def test_registrar
@klass.new(load_part('/available.txt')).registrar
end
+
+ def test_nameservers
+ parser = @klass.new(load_part('/registered.txt'))
+ expected = %w( ns2.registry.jobs ns1.registry.jobs )
+ 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
15 test/answer/parser/whois.aero_test.rb
View
@@ -22,8 +22,8 @@ def test_available?
end
def test_registered?
- assert !@klass.new(load_part('/available.txt')).registered?
assert @klass.new(load_part('/registered.txt')).registered?
+ assert !@klass.new(load_part('/available.txt')).registered?
end
@@ -48,4 +48,17 @@ def test_expires_on
@klass.new(load_part('/available.txt')).expires_on
end
+
+ def test_nameservers
+ parser = @klass.new(load_part('/registered.txt'))
+ expected = %w( dns2.srilankan.aero dns1.srilankan.aero s1.ns.slt.lk s2.ns.slt.lk )
+ 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
91 test/answer/parser/whois.afilias-grs.info_test.rb
View
@@ -51,6 +51,19 @@ def test_expires_on
@klass.new(load_part('/bz/available.txt')).expires_on
end
+
+ def test_nameservers
+ parser = @klass.new(load_part('/bz/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('/bz/available.txt'))
+ expected = %w()
+ assert_equal expected, parser.nameservers
+ assert_equal expected, parser.instance_eval { @nameservers }
+ end
+
end
class AnswerParserWhoisAfiliasGrsInfoGiTest < AnswerParserWhoisAfiliasGrsInfoTest
@@ -94,6 +107,19 @@ def test_expires_on
@klass.new(load_part('/gi/available.txt')).expires_on
end
+
+ def test_nameservers
+ parser = @klass.new(load_part('/gi/registered.txt'))
+ expected = %w( ns1-a.sapphire.gi ns2-a.sapphire.gi )
+ assert_equal expected, parser.nameservers
+ assert_equal expected, parser.instance_eval { @nameservers }
+
+ parser = @klass.new(load_part('/gi/available.txt'))
+ expected = %w()
+ assert_equal expected, parser.nameservers
+ assert_equal expected, parser.instance_eval { @nameservers }
+ end
+
end
class AnswerParserWhoisAfiliasGrsInfoHnTest < AnswerParserWhoisAfiliasGrsInfoTest
@@ -137,6 +163,19 @@ def test_expires_on
@klass.new(load_part('/hn/available.txt')).expires_on
end
+
+ def test_nameservers
+ parser = @klass.new(load_part('/hn/registered.txt'))
+ expected = %w( ns1.google.com ns2.google.com )
+ assert_equal expected, parser.nameservers
+ assert_equal expected, parser.instance_eval { @nameservers }
+
+ parser = @klass.new(load_part('/hn/available.txt'))
+ expected = %w()
+ assert_equal expected, parser.nameservers
+ assert_equal expected, parser.instance_eval { @nameservers }
+ end
+
end
class AnswerParserWhoisAfiliasGrsInfoLcTest < AnswerParserWhoisAfiliasGrsInfoTest
@@ -180,6 +219,19 @@ def test_expires_on
@klass.new(load_part('/lc/available.txt')).expires_on
end
+
+ def test_nameservers
+ parser = @klass.new(load_part('/lc/registered.txt'))
+ expected = %w( ns1.nic.ag ns.patricklay.com )
+ assert_equal expected, parser.nameservers
+ assert_equal expected, parser.instance_eval { @nameservers }
+
+ parser = @klass.new(load_part('/lc/available.txt'))
+ expected = %w()
+ assert_equal expected, parser.nameservers
+ assert_equal expected, parser.instance_eval { @nameservers }
+ end
+
end
class AnswerParserWhoisAfiliasGrsInfoMnTest < AnswerParserWhoisAfiliasGrsInfoTest
@@ -223,6 +275,19 @@ def test_expires_on
@klass.new(load_part('/mn/available.txt')).expires_on
end
+
+ def test_nameservers
+ parser = @klass.new(load_part('/mn/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('/mn/available.txt'))
+ expected = %w()
+ assert_equal expected, parser.nameservers
+ assert_equal expected, parser.instance_eval { @nameservers }
+ end
+
end
class AnswerParserWhoisAfiliasGrsInfoScTest < AnswerParserWhoisAfiliasGrsInfoTest
@@ -266,6 +331,19 @@ def test_expires_on
@klass.new(load_part('/sc/available.txt')).expires_on
end
+
+ def test_nameservers
+ parser = @klass.new(load_part('/sc/registered.txt'))
+ expected = %w( ns1.google.com ns2.google.com )
+ assert_equal expected, parser.nameservers
+ assert_equal expected, parser.instance_eval { @nameservers }
+
+ parser = @klass.new(load_part('/sc/available.txt'))
+ expected = %w()
+ assert_equal expected, parser.nameservers
+ assert_equal expected, parser.instance_eval { @nameservers }
+ end
+
end
class AnswerParserWhoisAfiliasGrsInfoVcTest < AnswerParserWhoisAfiliasGrsInfoTest
@@ -309,4 +387,17 @@ def test_expires_on
@klass.new(load_part('/vc/available.txt')).expires_on
end
+
+ def test_nameservers
+ parser = @klass.new(load_part('/vc/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('/vc/available.txt'))
+ expected = %w()
+ assert_equal expected, parser.nameservers
+ assert_equal expected, parser.instance_eval { @nameservers }
+ end
+
end
13 test/answer/parser/whois.biz_test.rb
View
@@ -48,4 +48,17 @@ def test_expires_on
@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
13 test/answer/parser/whois.cat_test.rb
View
@@ -48,4 +48,17 @@ def test_expires_on
@klass.new(load_part('/available.txt')).expires_on
end
+
+ def test_nameservers
+ parser = @klass.new(load_part('/registered.txt'))
+ expected = %w( dns2.gencat.cat dns.gencat.net )
+ 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
15 test/answer/parser/whois.cira.ca_test.rb
View
@@ -22,8 +22,8 @@ def test_available?
end
def test_registered?
- assert !@klass.new(load_part('/available.txt')).registered?
assert @klass.new(load_part('/registered.txt')).registered?
+ assert !@klass.new(load_part('/available.txt')).registered?
end
@@ -48,4 +48,17 @@ def test_expires_on
@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
4 test/answer/parser/whois.denic.de_test.rb
View
@@ -93,13 +93,13 @@ def test_status
end
def test_registered?
- assert !@klass.new(load_part('/available.txt')).registered?
assert @klass.new(load_part('/registered.txt')).registered?
+ assert !@klass.new(load_part('/available.txt')).registered?
end
def test_available?
- assert @klass.new(load_part('/available.txt')).available?
assert !@klass.new(load_part('/registered.txt')).available?
+ assert @klass.new(load_part('/available.txt')).available?
end
15 test/answer/parser/whois.domain-registry.nl_test.rb
View
@@ -46,4 +46,17 @@ def test_expires_on
assert_raise(Whois::PropertyNotSupported) { @klass.new(load_part('/available.txt')).expires_on }
end
-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
13 test/answer/parser/whois.domainregistry.ie_test.rb
View
@@ -44,4 +44,17 @@ def test_expires_on
@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 )
+ 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
13 test/answer/parser/whois.dotmobiregistry.net_test.rb
View
@@ -48,4 +48,17 @@ def test_expires_on
@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
13 test/answer/parser/whois.educause.edu_test.rb
View
@@ -48,4 +48,17 @@ def test_expires_on
@klass.new(load_part('/available.txt')).expires_on
end
+
+ def test_nameservers
+ parser = @klass.new(load_part('/registered.txt'))
+ expected = %w( ns3.educause.edu ns4.educause.edu ns5.educause.edu )
+ 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
8 test/answer/parser/whois.eu.org_test.rb
View
@@ -22,8 +22,8 @@ def test_available?
end
def test_registered?
- assert !@klass.new(load_part('/available.txt')).registered?
assert @klass.new(load_part('/registered.txt')).registered?
+ assert !@klass.new(load_part('/available.txt')).registered?
end
@@ -42,4 +42,10 @@ def test_expires_on
assert_raise(Whois::PropertyNotSupported) { @klass.new(load_part('/available.txt')).expires_on }
end
+
+ def test_nameservers
+ assert_raise(Whois::PropertyNotSupported) { @klass.new(load_part('/registered.txt')).nameservers }
+ assert_raise(Whois::PropertyNotSupported) { @klass.new(load_part('/available.txt')).nameservers }
+ end
+
end
2  test/answer/parser/whois.eu_test.rb
View
@@ -22,8 +22,8 @@ def test_available?
end
def test_registered?
- assert !@klass.new(load_part('/available.txt')).registered?
assert @klass.new(load_part('/registered.txt')).registered?
+ assert !@klass.new(load_part('/available.txt')).registered?
end
16 test/answer/parser/whois.iana.org_test.rb
View
@@ -22,8 +22,8 @@ def test_available?
end
def test_registered?
- assert !@klass.new(load_part('/available.txt')).registered?
assert @klass.new(load_part('/registered.txt')).registered?
+ assert !@klass.new(load_part('/available.txt')).registered?
end
@@ -46,4 +46,18 @@ def test_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( max.nra.nato.int ns1.cs.uc1.ac.uk ns1.drenet.dnd.ca relay.mod.uk maxima.nra.nato.int ns.namsa.nato.int ns.saclantc.nato.int ns.nc3a.nato.int )
+ 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
13 test/answer/parser/whois.isnic.is_test.rb
View
@@ -46,4 +46,17 @@ def test_expires_on
@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 )
+ 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
13 test/answer/parser/whois.museum_test.rb
View
@@ -48,4 +48,17 @@ def test_expires_on
@klass.new(load_part('/available.txt')).expires_on
end
+
+ def test_nameservers
+ parser = @klass.new(load_part('/registered.txt'))
+ expected = %w( nic.frd.se nic.museum )
+ 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
4 test/answer/parser/whois.nic.ac_test.rb
View
@@ -45,8 +45,8 @@ def test_available?
end
def test_registered?
- assert !@klass.new(load_part('/available.txt')).registered?
assert @klass.new(load_part('/registered.txt')).registered?
+ assert !@klass.new(load_part('/available.txt')).registered?
end
@@ -123,4 +123,4 @@ def test_unchanged?
assert !parser_a1.unchanged?(parser_r1)
end
-end
+end
15 test/answer/parser/whois.nic.asia_test.rb
View
@@ -48,4 +48,17 @@ def test_expires_on
@klass.new(load_part('/available.txt')).expires_on
end
-end
+
+ def test_nameservers
+ parser = @klass.new(load_part('/registered.txt'))
+ expected = %w( ns1.dotasia.org ns2.dotasia.org )
+ 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
15 test/answer/parser/whois.nic.cc_test.rb
View
@@ -117,4 +117,17 @@ def test_registrar
@klass.new(load_part('/available.txt')).registrar
end
-end
+
+ def test_nameservers
+ parser = @klass.new(load_part('/registered.txt'))
+ expected = %w( ns2.google.com ns1.google.com ns4.google.com ns3.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
15 test/answer/parser/whois.nic.cd_test.rb
View
@@ -46,4 +46,17 @@ def test_expires_on
@klass.new(load_part('/available.txt')).expires_on
end
-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
17 test/answer/parser/whois.nic.ch_test.rb
View
@@ -22,8 +22,8 @@ def test_available?
end
def test_registered?
- assert !@klass.new(load_part('/available.txt')).registered?
assert @klass.new(load_part('/registered.txt')).registered?
+ assert !@klass.new(load_part('/available.txt')).registered?
end
@@ -42,4 +42,17 @@ def test_expires_on
assert_raise(Whois::PropertyNotSupported) { @klass.new(load_part('/available.txt')).expires_on }
end
-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
13 test/answer/parser/whois.nic.coop_test.rb
View
@@ -48,4 +48,17 @@ def test_expires_on
@klass.new(load_part('/available.txt')).expires_on
end
+
+ def test_nameservers
+ parser = @klass.new(load_part('/registered.txt'))
+ expected = %w( ns1.calgarycoop.net ns2.calgarycoop.net )
+ 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
65 test/answer/parser/whois.nic.fr_test.rb
View
@@ -49,6 +49,19 @@ def test_expires_on
assert_raise(Whois::PropertyNotSupported) { @klass.new(load_part('/fr/available.txt')).expires_on }
end
+
+ def test_nameservers
+ parser = @klass.new(load_part('/fr/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('/fr/available.txt'))
+ expected = %w()
+ assert_equal expected, parser.nameservers
+ assert_equal expected, parser.instance_eval { @nameservers }
+ end
+
end
class AnswerParserWhoisNicFrPmTest < AnswerParserWhoisNicFrTest
@@ -90,6 +103,19 @@ def test_expires_on
assert_raise(Whois::PropertyNotSupported) { @klass.new(load_part('/pm/available.txt')).expires_on }
end
+
+ def test_nameservers
+ parser = @klass.new(load_part('/pm/registered.txt'))
+ expected = %w( ns1.nic.fr ns2.nic.fr ns3.nic.fr )
+ assert_equal expected, parser.nameservers
+ assert_equal expected, parser.instance_eval { @nameservers }
+
+ parser = @klass.new(load_part('/pm/available.txt'))
+ expected = %w()
+ assert_equal expected, parser.nameservers
+ assert_equal expected, parser.instance_eval { @nameservers }
+ end
+
end
class AnswerParserWhoisNicFrReTest < AnswerParserWhoisNicFrTest
@@ -131,6 +157,19 @@ def test_expires_on
assert_raise(Whois::PropertyNotSupported) { @klass.new(load_part('/re/available.txt')).expires_on }
end
+
+ def test_nameservers
+ parser = @klass.new(load_part('/pm/registered.txt'))
+ expected = %w( ns1.nic.fr ns2.nic.fr ns3.nic.fr )
+ assert_equal expected, parser.nameservers
+ assert_equal expected, parser.instance_eval { @nameservers }
+
+ parser = @klass.new(load_part('/pm/available.txt'))
+ expected = %w()
+ assert_equal expected, parser.nameservers
+ assert_equal expected, parser.instance_eval { @nameservers }
+ end
+
end
class AnswerParserWhoisNicFrWfTest < AnswerParserWhoisNicFrTest
@@ -172,6 +211,19 @@ def test_expires_on
assert_raise(Whois::PropertyNotSupported) { @klass.new(load_part('/wf/available.txt')).expires_on }
end
+
+ def test_nameservers
+ parser = @klass.new(load_part('/wf/registered.txt'))
+ expected = %w( ns1.nic.fr ns2.nic.fr ns3.nic.fr )
+ assert_equal expected, parser.nameservers
+ assert_equal expected, parser.instance_eval { @nameservers }
+
+ parser = @klass.new(load_part('/wf/available.txt'))
+ expected = %w()
+ assert_equal expected, parser.nameservers
+ assert_equal expected, parser.instance_eval { @nameservers }
+ end
+
end
class AnswerParserWhoisNicFrYtTest < AnswerParserWhoisNicFrTest
@@ -213,4 +265,17 @@ def test_expires_on
assert_raise(Whois::PropertyNotSupported) { @klass.new(load_part('/yt/available.txt')).expires_on }
end
+
+ def test_nameservers
+ parser = @klass.new(load_part('/yt/registered.txt'))
+ expected = %w( ns1.nic.fr ns2.nic.fr ns3.nic.fr )
+ assert_equal expected, parser.nameservers
+ assert_equal expected, parser.instance_eval { @nameservers }
+
+ parser = @klass.new(load_part('/yt/available.txt'))
+ expected = %w()
+ assert_equal expected, parser.nameservers
+ assert_equal expected, parser.instance_eval { @nameservers }
+ end
+
end
17 test/answer/parser/whois.nic.gl_test.rb
View
@@ -22,8 +22,8 @@ def test_available?
end
def test_registered?
- assert !@klass.new(load_part('/available.txt')).registered?
assert @klass.new(load_part('/registered.txt')).registered?
+ assert !@klass.new(load_part('/available.txt')).registered?
end
@@ -48,4 +48,17 @@ def test_expires_on
@klass.new(load_part('/available.txt')).expires_on
end
-end
+
+ def test_nameservers
+ parser = @klass.new(load_part('/registered.txt'))
+ expected = %w( ns1.google.com ns2.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
10 test/answer/parser/whois.nic.gov_test.rb
View
@@ -22,8 +22,8 @@ def test_available?
end
def test_registered?
- assert !@klass.new(load_part('/available.txt')).registered?
assert @klass.new(load_part('/registered.txt')).registered?
+ assert !@klass.new(load_part('/available.txt')).registered?
end
@@ -42,4 +42,10 @@ def test_expires_on
assert_raise(Whois::PropertyNotSupported) { @klass.new(load_part('/available.txt')).expires_on }
end
-end
+
+ def test_nameservers
+ assert_raise(Whois::PropertyNotSupported) { @klass.new(load_part('/registered.txt')).nameservers }
+ assert_raise(Whois::PropertyNotSupported) { @klass.new(load_part('/available.txt')).nameservers }
+ end
+
+end
15 test/answer/parser/whois.nic.im_test.rb
View
@@ -44,4 +44,17 @@ def test_expires_on
@klass.new(load_part('/available.txt')).expires_on
end
-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
8 test/answer/parser/whois.nic.io_test.rb
View
@@ -42,4 +42,10 @@ def test_expires_on
assert_raise(Whois::PropertyNotSupported) { @klass.new(load_part('/available.txt')).expires_on }
end
-end
+
+ def test_nameservers
+ assert_raise(Whois::PropertyNotSupported) { @klass.new(load_part('/registered.txt')).nameservers }
+ assert_raise(Whois::PropertyNotSupported) { @klass.new(load_part('/available.txt')).nameservers }
+ end
+
+end
2  test/answer/parser/whois.nic.it_test.rb
View
@@ -46,8 +46,8 @@ def test_available?
end
def test_registered?
- assert !@klass.new(load_part('/available.txt')).registered?
assert @klass.new(load_part('/registered.txt')).registered?
+ assert !@klass.new(load_part('/available.txt')).registered?
end
17 test/answer/parser/whois.nic.ly_test.rb
View
@@ -22,8 +22,8 @@ def test_available?
end
def test_registered?
- assert !@klass.new(load_part('/available.txt')).registered?
assert @klass.new(load_part('/registered.txt')).registered?
+ assert !@klass.new(load_part('/available.txt')).registered?
end
@@ -48,4 +48,17 @@ def test_expires_on
@klass.new(load_part('/available.txt')).expires_on
end
-end
+
+ def test_nameservers
+ parser = @klass.new(load_part('/registered.txt'))
+ expected = %w( ns2.google.com ns1.google.com ns4.google.com ns3.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
26 test/answer/parser/whois.nic.mu_test.rb
View
@@ -51,6 +51,19 @@ def test_expires_on
@klass.new(load_part('/ki/available.txt')).expires_on
end
+
+ def test_nameservers
+ parser = @klass.new(load_part('/ki/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('/ki/available.txt'))
+ expected = %w()
+ assert_equal expected, parser.nameservers
+ assert_equal expected, parser.instance_eval { @nameservers }
+ end
+
end
class AnswerParserWhoisNicMuMuTest < AnswerParserWhoisNicMuTest
@@ -94,4 +107,17 @@ def test_expires_on
@klass.new(load_part('/mu/available.txt')).expires_on
end
+
+ def test_nameservers
+ parser = @klass.new(load_part('/mu/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('/mu/available.txt'))
+ expected = %w()
+ assert_equal expected, parser.nameservers
+ assert_equal expected, parser.instance_eval { @nameservers }
+ end
+
end
8 test/answer/parser/whois.nic.name_test.rb
View
@@ -22,8 +22,8 @@ def test_available?
end
def test_registered?
- assert !@klass.new(load_part('/available.txt')).registered?
assert @klass.new(load_part('/registered.txt')).registered?
+ assert !@klass.new(load_part('/available.txt')).registered?
end
@@ -42,4 +42,10 @@ def test_expires_on
assert_raise(Whois::PropertyNotSupported) { @klass.new(load_part('/available.txt')).expires_on }
end
+
+ def test_expires_on
+ assert_raise(Whois::PropertyNotSupported) { @klass.new(load_part('/registered.txt')).nameservers }
+ assert_raise(Whois::PropertyNotSupported) { @klass.new(load_part('/available.txt')).nameservers }
+ end
+
end
15 test/answer/parser/whois.nic.tl_test.rb
View
@@ -48,4 +48,17 @@ def test_expires_on
@klass.new(load_part('/available.txt')).expires_on
end
-end
+
+ def test_nameservers
+ parser = @klass.new(load_part('/registered.txt'))
+ expected = %w( ns1.google.com ns2.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
15 test/answer/parser/whois.nic.travel_test.rb
View
@@ -48,4 +48,17 @@ def test_expires_on
@klass.new(load_part('/available.txt')).expires_on
end
-end
+
+ def test_nameservers
+ parser = @klass.new(load_part('/registered.txt'))
+ expected = %w( netsys.com ns01-mia.theglobe.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
15 test/answer/parser/whois.nic.uk_test.rb
View
@@ -60,4 +60,17 @@ def test_expires_on
@klass.new(load_part('/available.txt')).expires_on
end
-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
15 test/answer/parser/whois.nic.us_test.rb
View
@@ -48,4 +48,17 @@ def test_expires_on
@klass.new(load_part('/available.txt')).expires_on
end
-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
2  test/answer/parser/whois.norid.no_test.rb
View
@@ -46,4 +46,4 @@ def test_expires_on
assert_raise(Whois::PropertyNotSupported) { @klass.new(load_part('/available.txt')).expires_on }
end
-end
+end
6 test/answer/parser/whois.publicinterestregistry.net_test.rb
View
@@ -45,10 +45,10 @@ def test_domain
end
def test_domain_id
- assert_equal nil,
- @klass.new(load_part('/available.txt')).domain_id
assert_equal "D2244233-LROR",
@klass.new(load_part('/registered.txt')).domain_id
+ assert_equal nil,
+ @klass.new(load_part('/available.txt')).domain_id
end
@@ -65,8 +65,8 @@ def test_available?
end
def test_registered?
- assert !@klass.new(load_part('/available.txt')).registered?
assert @klass.new(load_part('/registered.txt')).registered?
+ assert !@klass.new(load_part('/available.txt')).registered?
end
17 test/answer/parser/whois.register.bg_test.rb
View
@@ -22,8 +22,8 @@ def test_available?
end
def test_registered?
- assert !@klass.new(load_part('/available.txt')).registered?
assert @klass.new(load_part('/registered.txt')).registered?
+ assert !@klass.new(load_part('/available.txt')).registered?
end
@@ -46,4 +46,17 @@ def test_expires_on
@klass.new(load_part('/available.txt')).expires_on
end
-end
+
+ def test_nameservers
+ parser = @klass.new(load_part('/registered.txt'))
+ expected = %w( ns4.google.com ns1.google.com ns3.google.com ns2.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
8 test/answer/parser/whois.registro.br_test.rb
View
@@ -22,8 +22,8 @@ def test_available?
end
def test_registered?
- assert !@klass.new(load_part('/available.txt')).registered?
assert @klass.new(load_part('/registered.txt')).registered?
+ assert !@klass.new(load_part('/available.txt')).registered?
end
@@ -42,4 +42,10 @@ def test_expires_on
assert_raise(Whois::PropertyNotSupported) { @klass.new(load_part('/available.txt')).expires_on }
end
+
+ def test_nameservers
+ assert_raise(Whois::PropertyNotSupported) { @klass.new(load_part('/registered.txt')).nameservers }
+ assert_raise(Whois::PropertyNotSupported) { @klass.new(load_part('/available.txt')).nameservers }
+ end
+
end
67 test/answer/parser/whois.ripe.net_test.rb
View
@@ -9,7 +9,6 @@ def setup
@host = "whois.ripe.net"
end
-
def test_true
assert true
end
@@ -51,6 +50,19 @@ def test_expires_on
assert_raise(Whois::PropertyNotSupported) { @klass.new(load_part('/fo/available.txt')).expires_on }
end
+
+ def test_nameservers
+ parser = @klass.new(load_part('/fo/registered.txt'))
+ expected = %w( ns3.zoneedit.com ns4.zoneedit.com )
+ assert_equal expected, parser.nameservers
+ assert_equal expected, parser.instance_eval { @nameservers }
+
+ parser = @klass.new(load_part('/fo/available.txt'))
+ expected = %w()
+ assert_equal expected, parser.nameservers
+ assert_equal expected, parser.instance_eval { @nameservers }
+ end
+
end
class AnswerParserWhoisRipeNetGmTest < AnswerParserWhoisRipeNetTest
@@ -88,6 +100,19 @@ def test_expires_on
assert_raise(Whois::PropertyNotSupported) { @klass.new(load_part('/gm/available.txt')).expires_on }
end
+
+ def test_nameservers
+ parser = @klass.new(load_part('/gm/registered.txt'))
+ expected = %w( ns1.commit.gm ns1.sol.no )
+ assert_equal expected, parser.nameservers
+ assert_equal expected, parser.instance_eval { @nameservers }
+
+ parser = @klass.new(load_part('/gm/available.txt'))
+ expected = %w()
+ assert_equal expected, parser.nameservers
+ assert_equal expected, parser.instance_eval { @nameservers }
+ end
+
end
class AnswerParserWhoisRipeNetMcTest < AnswerParserWhoisRipeNetTest
@@ -125,6 +150,19 @@ def test_expires_on
assert_raise(Whois::PropertyNotSupported) { @klass.new(load_part('/mc/available.txt')).expires_on }
end
+
+ def test_nameservers
+ parser = @klass.new(load_part('/mc/registered.txt'))
+ expected = %w( ns.nic.mc bow.rain.fr ns.ripe.net )
+ assert_equal expected, parser.nameservers
+ assert_equal expected, parser.instance_eval { @nameservers }
+
+ parser = @klass.new(load_part('/mc/available.txt'))
+ expected = %w()
+ assert_equal expected, parser.nameservers
+ assert_equal expected, parser.instance_eval { @nameservers }
+ end
+
end
class AnswerParserWhoisRipeNetSmTest < AnswerParserWhoisRipeNetTest
@@ -162,6 +200,19 @@ def test_expires_on
assert_raise(Whois::PropertyNotSupported) { @klass.new(load_part('/sm/available.txt')).expires_on }
end
+
+ def test_nameservers
+ parser = @klass.new(load_part('/sm/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('/sm/available.txt'))
+ expected = %w()
+ assert_equal expected, parser.nameservers
+ assert_equal expected, parser.instance_eval { @nameservers }
+ end
+
end
class AnswerParserWhoisRipeNetVaTest < AnswerParserWhoisRipeNetTest
@@ -199,5 +250,17 @@ def test_expires_on
assert_raise(Whois::PropertyNotSupported) { @klass.new(load_part('/va/available.txt')).expires_on }
end
-end
+ def test_nameservers
+ parser = @klass.new(load_part('/va/registered.txt'))
+ expected = %w( john.vatican.va ns2.nic.it seth.namex.it osiris.namex.it michael.vatican.va )
+ assert_equal expected, parser.nameservers
+ assert_equal expected, parser.instance_eval { @nameservers }
+
+ parser = @klass.new(load_part('/va/available.txt'))
+ expected = %w()
+ assert_equal expected, parser.nameservers
+ assert_equal expected, parser.instance_eval { @nameservers }
+ end
+
+end
28 test/answer/parser/whois.ripn.net_test.rb
View
@@ -49,6 +49,19 @@ def test_expires_on
@klass.new(load_part('/ru/available.txt')).expires_on
end
+
+ def test_nameservers
+ parser = @klass.new(load_part('/ru/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('/ru/available.txt'))
+ expected = %w()
+ assert_equal expected, parser.nameservers
+ assert_equal expected, parser.instance_eval { @nameservers }
+ end
+
end
@@ -91,4 +104,17 @@ def test_expires_on
@klass.new(load_part('/su/available.txt')).expires_on
end
-end
+
+ def test_nameservers
+ parser = @klass.new(load_part('/su/registered.txt'))
+ expected = %w( ns1073.hostgator.com ns1074.hostgator.com )
+ assert_equal expected, parser.nameservers
+ assert_equal expected, parser.instance_eval { @nameservers }
+
+ parser = @klass.new(load_part('/su/available.txt'))
+ expected = %w()
+ assert_equal expected, parser.nameservers
+ assert_equal expected, parser.instance_eval { @nameservers }
+ end
+
+end
17 test/answer/parser/whois.rotld.ro_test.rb
View
@@ -22,8 +22,8 @@ def test_available?
end
def test_registered?
- assert !@klass.new(load_part('/available.txt')).registered?
assert @klass.new(load_part('/registered.txt')).registered?
+ assert !@klass.new(load_part('/available.txt')).registered?
end
@@ -42,4 +42,17 @@ def test_expires_on
assert_raise(Whois::PropertyNotSupported) { @klass.new(load_part('/available.txt')).expires_on }
end
-end
+