Permalink
Browse files

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

  • Loading branch information...
1 parent e091219 commit e70b10e21b4be1879aa0e4b96376259667eb0570 @weppos committed Mar 16, 2010
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
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.
@@ -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)
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -57,6 +57,9 @@ class WhoisEuOrg < Base
property_not_supported :expires_on
+
+ property_not_supported :nameservers
+
end
end
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
Oops, something went wrong.

0 comments on commit e70b10e

Please sign in to comment.