Browse files

Merge branch 'master' into by_zone_whois

  • Loading branch information...
2 parents f64e656 + c5e2558 commit 89111f3b45e97d9da3efb83dc94f1459bacded94 @kliuchnikau kliuchnikau committed Mar 20, 2012
Showing with 4,334 additions and 1,415 deletions.
  1. +24 −3 CHANGELOG.md
  2. +1 −1 Gemfile.lock
  3. +4 −0 lib/whois/definitions/ipv4.rb
  4. +25 −25 lib/whois/definitions/tlds.rb
  5. +1 −1 lib/whois/record/parser/base.rb
  6. +1 −1 lib/whois/record/parser/base_afilias.rb
  7. +1 −1 lib/whois/record/parser/jobswhois.verisign-grs.com.rb
  8. +0 −66 lib/whois/record/parser/scanners/afilias.rb
  9. +0 −69 lib/whois/record/parser/scanners/ast.rb
  10. +0 −85 lib/whois/record/parser/scanners/base.rb
  11. +0 −108 lib/whois/record/parser/scanners/iana.rb
  12. +0 −122 lib/whois/record/parser/scanners/verisign.rb
  13. +0 −49 lib/whois/record/parser/scanners/whois.biz.rb
  14. +0 −52 lib/whois/record/parser/scanners/whois.centralnic.com.rb
  15. +0 −46 lib/whois/record/parser/scanners/whois.cnnic.cn.rb
  16. +0 −124 lib/whois/record/parser/scanners/whois.denic.de.rb
  17. +0 −180 lib/whois/record/parser/scanners/whois.nic.hu.rb
  18. +0 −111 lib/whois/record/parser/scanners/whois.nic.it.rb
  19. +0 −41 lib/whois/record/parser/scanners/whois.registry.qa.rb
  20. +0 −62 lib/whois/record/parser/scanners/whois.smallregistry.net.rb
  21. +0 −52 lib/whois/record/parser/scanners/whois.tld.ee.rb
  22. +81 −16 lib/whois/record/parser/whois.audns.net.au.rb
  23. +3 −3 lib/whois/record/parser/whois.biz.rb
  24. +1 −1 lib/whois/record/parser/whois.centralnic.com.rb
  25. +1 −1 lib/whois/record/parser/whois.cnnic.cn.rb
  26. +1 −1 lib/whois/record/parser/whois.crsnic.net.rb
  27. +1 −1 lib/whois/record/parser/whois.denic.de.rb
  28. +112 −0 lib/whois/record/parser/whois.dns.hr.rb
  29. +1 −1 lib/whois/record/parser/whois.dreamhost.com.rb
  30. +76 −0 lib/whois/record/parser/whois.fi.rb
  31. +3 −55 lib/whois/record/parser/whois.ficora.fi.rb
  32. +1 −1 lib/whois/record/parser/whois.iana.org.rb
  33. +135 −0 lib/whois/record/parser/whois.nc.rb
  34. +3 −57 lib/whois/record/parser/whois.net.ua.rb
  35. +1 −1 lib/whois/record/parser/whois.nic.cc.rb
  36. +1 −1 lib/whois/record/parser/whois.nic.hu.rb
  37. +1 −1 lib/whois/record/parser/whois.nic.it.rb
  38. +118 −0 lib/whois/record/parser/whois.nic.lk.rb
  39. +1 −1 lib/whois/record/parser/whois.nic.tv.rb
  40. +1 −1 lib/whois/record/parser/whois.registry.qa.rb
  41. +143 −0 lib/whois/record/parser/whois.rnids.rs.rb
  42. +1 −1 lib/whois/record/parser/whois.smallregistry.net.rb
  43. +1 −1 lib/whois/record/parser/whois.tld.ee.rb
  44. +75 −0 lib/whois/record/parser/whois.ua.rb
  45. +64 −0 lib/whois/record/scanners/afilias.rb
  46. +67 −0 lib/whois/record/scanners/ast.rb
  47. +83 −0 lib/whois/record/scanners/base.rb
  48. +106 −0 lib/whois/record/scanners/iana.rb
  49. +120 −0 lib/whois/record/scanners/verisign.rb
  50. +39 −0 lib/whois/record/scanners/whois.audns.net.au.rb
  51. +47 −0 lib/whois/record/scanners/whois.biz.rb
  52. +50 −0 lib/whois/record/scanners/whois.centralnic.com.rb
  53. +44 −0 lib/whois/record/scanners/whois.cnnic.cn.rb
  54. +122 −0 lib/whois/record/scanners/whois.denic.de.rb
  55. +39 −0 lib/whois/record/scanners/whois.dns.hr.rb
  56. +46 −0 lib/whois/record/scanners/whois.nc.rb
  57. +178 −0 lib/whois/record/scanners/whois.nic.hu.rb
  58. +109 −0 lib/whois/record/scanners/whois.nic.it.rb
  59. +39 −0 lib/whois/record/scanners/whois.registry.qa.rb
  60. +76 −0 lib/whois/record/scanners/whois.rnids.rs.rb
  61. +60 −0 lib/whois/record/scanners/whois.smallregistry.net.rb
  62. +50 −0 lib/whois/record/scanners/whois.tld.ee.rb
  63. +1 −1 lib/whois/version.rb
  64. +33 −0 spec/fixtures/responses/whois.audns.net.au/status_available.expected
  65. +53 −0 spec/fixtures/responses/whois.audns.net.au/status_registered.expected
  66. +54 −0 spec/fixtures/responses/whois.dns.hr/status_available.expected
  67. +1 −0 spec/fixtures/responses/whois.dns.hr/status_available.txt
  68. +67 −0 spec/fixtures/responses/whois.dns.hr/status_registered.expected
  69. +7 −0 spec/fixtures/responses/whois.dns.hr/status_registered.txt
  70. 0 spec/fixtures/responses/{whois.ficora.fi → whois.fi}/status_available.expected
  71. 0 spec/fixtures/responses/{whois.ficora.fi → whois.fi}/status_available.txt
  72. 0 spec/fixtures/responses/{whois.ficora.fi → whois.fi}/status_registered.expected
  73. 0 spec/fixtures/responses/{whois.ficora.fi → whois.fi}/status_registered.txt
  74. +1 −0 spec/fixtures/responses/whois.ficora.fi
  75. +55 −0 spec/fixtures/responses/whois.nc/status_available.expected
  76. +6 −0 spec/fixtures/responses/whois.nc/status_available.txt
  77. +76 −0 spec/fixtures/responses/whois.nc/status_registered.expected
  78. +24 −0 spec/fixtures/responses/whois.nc/status_registered.txt
  79. +1 −0 spec/fixtures/responses/whois.net.ua
  80. +25 −25 spec/fixtures/responses/whois.nic.it/status_registered.expected
  81. +55 −0 spec/fixtures/responses/whois.nic.lk/lk/status_available.expected
  82. +1 −0 spec/fixtures/responses/whois.nic.lk/lk/status_available.txt
  83. +70 −0 spec/fixtures/responses/whois.nic.lk/lk/status_registered.expected
  84. +24 −0 spec/fixtures/responses/whois.nic.lk/lk/status_registered.txt
  85. 0 spec/fixtures/responses/whois.nic.lk/xn--fzc2c9e2c/status_available.txt
  86. +18 −0 spec/fixtures/responses/whois.nic.lk/xn--fzc2c9e2c/status_registered.txt
  87. 0 spec/fixtures/responses/whois.nic.lk/xn--xkc2al3hye2a/status_available.txt
  88. +18 −0 spec/fixtures/responses/whois.nic.lk/xn--xkc2al3hye2a/status_registered.txt
  89. +57 −0 spec/fixtures/responses/whois.rnids.rs/status_available.expected
  90. +1 −0 spec/fixtures/responses/whois.rnids.rs/status_available.txt
  91. +94 −0 spec/fixtures/responses/whois.rnids.rs/status_registered.expected
  92. +44 −0 spec/fixtures/responses/whois.rnids.rs/status_registered.txt
  93. 0 spec/fixtures/responses/{whois.net.ua → whois.ua}/property_nameservers_uppercase.expected
  94. 0 spec/fixtures/responses/{whois.net.ua → whois.ua}/property_nameservers_uppercase.txt
  95. 0 spec/fixtures/responses/{whois.net.ua → whois.ua}/redirect_to_whois.in.ua.txt
  96. 0 spec/fixtures/responses/{whois.net.ua → whois.ua}/status_available.expected
  97. 0 spec/fixtures/responses/{whois.net.ua → whois.ua}/status_available.txt
  98. 0 spec/fixtures/responses/{whois.net.ua → whois.ua}/status_registered.expected
  99. 0 spec/fixtures/responses/{whois.net.ua → whois.ua}/status_registered.txt
  100. +15 −17 spec/tlds
  101. +47 −0 spec/whois/record/parser/responses/whois.audns.net.au/status_available_spec.rb
  102. +67 −0 spec/whois/record/parser/responses/whois.audns.net.au/status_registered_spec.rb
  103. +105 −0 spec/whois/record/parser/responses/whois.dns.hr/status_available_spec.rb
  104. +118 −0 spec/whois/record/parser/responses/whois.dns.hr/status_registered_spec.rb
  105. +60 −0 spec/whois/record/parser/responses/whois.fi/status_available_spec.rb
  106. +70 −0 spec/whois/record/parser/responses/whois.fi/status_registered_spec.rb
  107. +106 −0 spec/whois/record/parser/responses/whois.nc/status_available_spec.rb
  108. +127 −0 spec/whois/record/parser/responses/whois.nc/status_registered_spec.rb
  109. +25 −25 spec/whois/record/parser/responses/whois.nic.it/status_registered_spec.rb
  110. +106 −0 spec/whois/record/parser/responses/whois.nic.lk/lk/status_available_spec.rb
  111. +121 −0 spec/whois/record/parser/responses/whois.nic.lk/lk/status_registered_spec.rb
  112. +108 −0 spec/whois/record/parser/responses/whois.rnids.rs/status_available_spec.rb
  113. +145 −0 spec/whois/record/parser/responses/whois.rnids.rs/status_registered_spec.rb
  114. +36 −0 spec/whois/record/parser/responses/whois.ua/property_nameservers_uppercase_spec.rb
  115. +60 −0 spec/whois/record/parser/responses/whois.ua/status_available_spec.rb
  116. +70 −0 spec/whois/record/parser/responses/whois.ua/status_registered_spec.rb
  117. +4 −4 whois.gemspec
View
27 CHANGELOG.md
@@ -1,19 +1,40 @@
# Changelog
-## master
+## Master
-* SERVER: .KP TLD no longer provides public WHOIS interface (GH-52).
+* NEW: Added full whois.audns.net.au parser.
-* SERVER: Added the following new IDN TLDs:
+* CHANGED: Moved scanners from Whois::Record::Parser::Scanners to Whois::Record::Scanners.
+
+
+## Release 2.4.0
+
+* SERVER: Removed .KP (GH-52), .GP (GH-44) TLD servers.
+
+* SERVER: Updated .CV, .FI (GH-133), .GF, .MQ, .UA (GH-153), .XN-MGBAYH7GPA, .XN--FZC2C9E2C, .XN--XKC2AL3HYE2A TLD servers.
+
+* SERVER: Added the following new IDN TLD servers:
* .XN--80AO21A (.ҚАЗ, Kazakhstan)
+* SERVER: Updated ipv4 allocations.
+
+* SERVER: Added .RS, .LK, .HR (GH-122), .NC (GH-109) TLD server.
+
* NEW: Added full whois.dreamhost.com parser.
* NEW: Added ability to check for an unavailable response with Whois::Record#response_unavailable?.
* NEW: whois.nic.uk now understands reserved domains.
+* NEW: Added full whois.rnids.rs parser.
+
+* NEW: Added full whois.nic.lk parser.
+
+* NEW: Added full whois.dns.hr parser (GH-122).
+
+* NEW: Added full whois.nc parser (GH-109).
+
* CHANGED: Placed "core_ext" under "whois" namespace (GH-149).
* CHANGED: Whois::Client#query is no longer case sensitive (GH-151).
View
2 Gemfile.lock
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
- whois (2.3.0)
+ whois (2.4.0)
GEM
remote: http://rubygems.org/
View
4 lib/whois/definitions/ipv4.rb
@@ -72,6 +72,8 @@
Whois::Server.define :ipv4, "151.64.0.0/11", "whois.ripe.net"
Whois::Server.define :ipv4, "151.96.0.0/14", "whois.ripe.net"
Whois::Server.define :ipv4, "151.100.0.0/16", "whois.ripe.net"
+Whois::Server.define :ipv4, "153.128.0.0/9", "whois.nic.ad.jp"
+Whois::Server.define :ipv4, "153.0.0.0/8", "whois.apnic.net"
Whois::Server.define :ipv4, "154.0.0.0/8", "whois.afrinic.net"
Whois::Server.define :ipv4, "155.232.0.0/13", "whois.afrinic.net"
Whois::Server.define :ipv4, "155.240.0.0/16", "whois.afrinic.net"
@@ -88,6 +90,7 @@
Whois::Server.define :ipv4, "163.195.0.0/16", "whois.afrinic.net"
Whois::Server.define :ipv4, "163.196.0.0/14", "whois.afrinic.net"
Whois::Server.define :ipv4, "163.200.0.0/14", "whois.afrinic.net"
+Whois::Server.define :ipv4, "163.0.0.0/8", "whois.apnic.net"
Whois::Server.define :ipv4, "164.0.0.0/11", "whois.ripe.net"
Whois::Server.define :ipv4, "164.32.0.0/13", "whois.ripe.net"
Whois::Server.define :ipv4, "164.40.0.0/16", "whois.ripe.net"
@@ -100,6 +103,7 @@
Whois::Server.define :ipv4, "169.208.0.0/12", "whois.apnic.net"
Whois::Server.define :ipv4, "171.16.0.0/12", "whois.ripe.net"
Whois::Server.define :ipv4, "171.32.0.0/15", "whois.ripe.net"
+Whois::Server.define :ipv4, "171.0.0.0/8", "whois.apnic.net"
Whois::Server.define :ipv4, "175.192.0.0/10", "whois.nic.or.kr"
Whois::Server.define :ipv4, "175.0.0.0/8", "whois.apnic.net"
Whois::Server.define :ipv4, "176.0.0.0/8", "whois.ripe.net"
View
50 lib/whois/definitions/tlds.rb
@@ -89,7 +89,7 @@
Whois::Server.define :tld, ".bz", "whois.afilias-grs.info", { :adapter => Whois::Server::Adapters::Afilias }
Whois::Server.define :tld, ".co.ca", "whois.co.ca"
Whois::Server.define :tld, ".ca", "whois.cira.ca"
-Whois::Server.define :tld, ".cc", "whois.nic.cc", { :adapter => Whois::Server::Adapters::Verisign}
+Whois::Server.define :tld, ".cc", "whois.nic.cc", { :adapter => Whois::Server::Adapters::Verisign }
Whois::Server.define :tld, ".cd", "whois.nic.cd"
Whois::Server.define :tld, ".cf", nil, { :adapter => Whois::Server::Adapters::None }
Whois::Server.define :tld, ".cg", nil, { :web => "http://www.nic.cg/cgi-bin/whois.pl", :adapter => Whois::Server::Adapters::Web }
@@ -102,14 +102,14 @@
Whois::Server.define :tld, ".cn", "whois.cnnic.cn"
Whois::Server.define :tld, ".co", "whois.nic.co"
Whois::Server.define :tld, ".cr", nil, { :web => "http://www.nic.cr/niccr_publico/showRegistroDominiosScreen.do", :adapter => Whois::Server::Adapters::Web }
-Whois::Server.define :tld, ".cu", nil, { :adapter => Whois::Server::Adapters::Web, :web => "http://www.nic.cu/"}
-Whois::Server.define :tld, ".cv", nil, { :adapter => Whois::Server::Adapters::None }
+Whois::Server.define :tld, ".cu", nil, { :adapter => Whois::Server::Adapters::Web, :web => "http://www.nic.cu/" }
+Whois::Server.define :tld, ".cv", nil, { :adapter => Whois::Server::Adapters::Web, :web => "http://www.dns.cv/" }
Whois::Server.define :tld, ".cx", "whois.nic.cx"
Whois::Server.define :tld, ".cy", nil, { :web => "http://www.nic.cy/nslookup/online_database.php", :adapter => Whois::Server::Adapters::Web }
Whois::Server.define :tld, ".cz", "whois.nic.cz"
Whois::Server.define :tld, ".de", "whois.denic.de", { :adapter => Whois::Server::Adapters::Formatted, :format => "-T dn,ace %s"}
-Whois::Server.define :tld, ".dj", nil, { :adapter => Whois::Server::Adapters::Web, :web => "http://www.nic.dj/whois.php"}
-Whois::Server.define :tld, ".dk", "whois.dk-hostmaster.dk", { :adapter => Whois::Server::Adapters::Formatted, :format => "--show-handles %s"}
+Whois::Server.define :tld, ".dj", nil, { :adapter => Whois::Server::Adapters::Web, :web => "http://www.nic.dj/whois.php" }
+Whois::Server.define :tld, ".dk", "whois.dk-hostmaster.dk", { :adapter => Whois::Server::Adapters::Formatted, :format => "--show-handles %s" }
Whois::Server.define :tld, ".dm", "whois.nic.dm"
Whois::Server.define :tld, ".do", nil, { :web => "http://www.nic.do/whois-h.php3", :adapter => Whois::Server::Adapters::Web }
Whois::Server.define :tld, ".dz", "whois.nic.dz"
@@ -120,7 +120,7 @@
Whois::Server.define :tld, ".es", nil, { :web => "https://www.nic.es/", :adapter => Whois::Server::Adapters::Web }
Whois::Server.define :tld, ".et", nil, { :adapter => Whois::Server::Adapters::None }
Whois::Server.define :tld, ".eu", "whois.eu"
-Whois::Server.define :tld, ".fi", "whois.ficora.fi"
+Whois::Server.define :tld, ".fi", "whois.fi"
Whois::Server.define :tld, ".fj", "whois.usp.ac.fj"
Whois::Server.define :tld, ".fk", nil, { :adapter => Whois::Server::Adapters::None }
Whois::Server.define :tld, ".fm", nil, { :web => "http://www.dot.fm/whois.html", :adapter => Whois::Server::Adapters::Web }
@@ -140,26 +140,26 @@
Whois::Server.define :tld, ".ga", nil, { :adapter => Whois::Server::Adapters::None }
Whois::Server.define :tld, ".gb", nil, { :adapter => Whois::Server::Adapters::None }
Whois::Server.define :tld, ".gd", "whois.adamsnames.tc"
-Whois::Server.define :tld, ".ge", nil, { :web => "http://www.registration.ge/", :adapter => Whois::Server::Adapters::Web }
-Whois::Server.define :tld, ".gf", nil, { :web => "http://www.nic.gf/?id=whois", :adapter => Whois::Server::Adapters::Web }
+Whois::Server.define :tld, ".ge", nil, { :adapter => Whois::Server::Adapters::Web, :web => "http://www.registration.ge/" }
+Whois::Server.define :tld, ".gf", nil, { :adapter => Whois::Server::Adapters::Web, :web => "https://www.dom-enic.com/whois.html" }
Whois::Server.define :tld, ".gg", "whois.gg"
-Whois::Server.define :tld, ".gh", nil, { :web => "http://www.nic.gh/customer/search_c.htm", :adapter => Whois::Server::Adapters::Web }
+Whois::Server.define :tld, ".gh", nil, { :adapter => Whois::Server::Adapters::Web, :web => "http://www.nic.gh/customer/search_c.htm" }
Whois::Server.define :tld, ".gi", "whois.afilias-grs.info", { :adapter => Whois::Server::Adapters::Afilias }
Whois::Server.define :tld, ".gl", "whois.nic.gl"
-Whois::Server.define :tld, ".gm", nil, { :adapter => Whois::Server::Adapters::Web, :web => "http://www.nic.gm/htmlpages/whois.htm"}
+Whois::Server.define :tld, ".gm", nil, { :adapter => Whois::Server::Adapters::Web, :web => "http://www.nic.gm/htmlpages/whois.htm" }
Whois::Server.define :tld, ".gn", nil, { :adapter => Whois::Server::Adapters::None }
-Whois::Server.define :tld, ".gp", "whois.nic.gp"
+Whois::Server.define :tld, ".gp", nil, { :adapter => Whois::Server::Adapters::None }
Whois::Server.define :tld, ".gq", nil, { :adapter => Whois::Server::Adapters::None }
-Whois::Server.define :tld, ".gr", nil, { :adapter => Whois::Server::Adapters::Web, :web => "https://grweb.ics.forth.gr/whois_en.jsp"}
+Whois::Server.define :tld, ".gr", nil, { :adapter => Whois::Server::Adapters::Web, :web => "https://grweb.ics.forth.gr/whois_en.jsp" }
Whois::Server.define :tld, ".gs", "whois.nic.gs"
-Whois::Server.define :tld, ".gt", nil, { :adapter => Whois::Server::Adapters::Web, :web => "http://www.gt/whois.html"}
-Whois::Server.define :tld, ".gu", nil, { :adapter => Whois::Server::Adapters::Web, :web => "http://gadao.gov.gu/domainsearch.htm"}
+Whois::Server.define :tld, ".gt", nil, { :adapter => Whois::Server::Adapters::Web, :web => "http://www.gt/whois.html" }
+Whois::Server.define :tld, ".gu", nil, { :adapter => Whois::Server::Adapters::Web, :web => "http://gadao.gov.gu/domainsearch.htm" }
Whois::Server.define :tld, ".gw", nil, { :adapter => Whois::Server::Adapters::None }
Whois::Server.define :tld, ".gy", "whois.registry.gy"
Whois::Server.define :tld, ".hk", "whois.hkirc.hk"
Whois::Server.define :tld, ".hm", "whois.registry.hm"
Whois::Server.define :tld, ".hn", "whois.afilias-grs.info", { :adapter => Whois::Server::Adapters::Afilias }
-Whois::Server.define :tld, ".hr", nil, { :web => "http://www.dns.hr/pretrazivanje.html", :adapter => Whois::Server::Adapters::Web }
+Whois::Server.define :tld, ".hr", "whois.dns.hr"
Whois::Server.define :tld, ".ht", "whois.nic.ht"
Whois::Server.define :tld, ".hu", "whois.nic.hu"
Whois::Server.define :tld, ".id", "whois.pandi.or.id"
@@ -191,7 +191,7 @@
Whois::Server.define :tld, ".lb", nil, { :adapter => Whois::Server::Adapters::Web, :web => "http://www.aub.edu.lb/lbdr/"}
Whois::Server.define :tld, ".lc", "whois.afilias-grs.info", { :adapter => Whois::Server::Adapters::Afilias }
Whois::Server.define :tld, ".li", "whois.nic.li"
-Whois::Server.define :tld, ".lk", nil, { :adapter => Whois::Server::Adapters::None }
+Whois::Server.define :tld, ".lk", "whois.nic.lk"
Whois::Server.define :tld, ".lr", nil, { :adapter => Whois::Server::Adapters::None }
Whois::Server.define :tld, ".ls", nil, { :adapter => Whois::Server::Adapters::Web, :web => "http://www.co.ls/co.asp"}
Whois::Server.define :tld, ".lt", "whois.domreg.lt"
@@ -204,13 +204,13 @@
Whois::Server.define :tld, ".me", "whois.meregistry.net"
Whois::Server.define :tld, ".mg", "whois.nic.mg"
Whois::Server.define :tld, ".mh", nil, { :adapter => Whois::Server::Adapters::None }
-Whois::Server.define :tld, ".mk", nil, { :web => "http://dns.marnet.net.mk/registar.php", :adapter => Whois::Server::Adapters::Web }
+Whois::Server.define :tld, ".mk", nil, { :adapter => Whois::Server::Adapters::Web, :web => "http://dns.marnet.net.mk/registar.php" }
Whois::Server.define :tld, ".ml", nil, { :adapter => Whois::Server::Adapters::None }
Whois::Server.define :tld, ".mm", nil, { :adapter => Whois::Server::Adapters::None }
Whois::Server.define :tld, ".mn", "whois.afilias-grs.info", { :adapter => Whois::Server::Adapters::Afilias }
Whois::Server.define :tld, ".mo", nil, { :web => "http://www.monic.net.mo/", :adapter => Whois::Server::Adapters::Web }
Whois::Server.define :tld, ".mp", nil, { :adapter => Whois::Server::Adapters::None }
-Whois::Server.define :tld, ".mq", nil, { :adapter => Whois::Server::Adapters::None }
+Whois::Server.define :tld, ".mq", nil, { :adapter => Whois::Server::Adapters::Web, :web => "https://www.dom-enic.com/whois.html" }
Whois::Server.define :tld, ".mr", nil, { :adapter => Whois::Server::Adapters::None }
Whois::Server.define :tld, ".ms", "whois.nic.ms"
Whois::Server.define :tld, ".mt", nil, { :web => "https://www.nic.org.mt/dotmt/", :adapter => Whois::Server::Adapters::Web }
@@ -221,7 +221,7 @@
Whois::Server.define :tld, ".my", "whois.domainregistry.my"
Whois::Server.define :tld, ".mz", nil, { :adapter => Whois::Server::Adapters::None }
Whois::Server.define :tld, ".na", "whois.na-nic.com.na"
-Whois::Server.define :tld, ".nc", nil, { :web => "http://www.domaine.nc/en/whois.html", :adapter => Whois::Server::Adapters::Web }
+Whois::Server.define :tld, ".nc", "whois.nc"
Whois::Server.define :tld, ".ne", nil, { :adapter => Whois::Server::Adapters::None }
Whois::Server.define :tld, ".nf", "whois.nic.net.nf"
Whois::Server.define :tld, ".ng", "whois.nic.net.ng"
@@ -251,7 +251,7 @@
Whois::Server.define :tld, ".qa", "whois.registry.qa"
Whois::Server.define :tld, ".re", "whois.nic.fr"
Whois::Server.define :tld, ".ro", "whois.rotld.ro"
-Whois::Server.define :tld, ".rs", nil, { :web => "http://www.nic.rs/en/whois", :adapter => Whois::Server::Adapters::Web }
+Whois::Server.define :tld, ".rs", "whois.rnids.rs"
Whois::Server.define :tld, ".edu.ru", "whois.informika.ru"
Whois::Server.define :tld, ".ru", "whois.tcinet.ru"
Whois::Server.define :tld, ".rw", nil, { :adapter => Whois::Server::Adapters::Web, :web => "http://www.nic.rw/cgi-bin/whois.pl"}
@@ -272,7 +272,7 @@
Whois::Server.define :tld, ".sr", nil, { :adapter => Whois::Server::Adapters::None }
Whois::Server.define :tld, ".st", "whois.nic.st"
Whois::Server.define :tld, ".su", "whois.tcinet.ru"
-Whois::Server.define :tld, ".sv", nil, { :web => "http://www.uca.edu.sv/dns/", :adapter => Whois::Server::Adapters::Web }
+Whois::Server.define :tld, ".sv", nil, { :adapter => Whois::Server::Adapters::Web, :web => "http://www.uca.edu.sv/dns/" }
Whois::Server.define :tld, ".sy", nil, { :adapter => Whois::Server::Adapters::None }
Whois::Server.define :tld, ".sz", nil, { :adapter => Whois::Server::Adapters::None }
Whois::Server.define :tld, ".tc", "whois.adamsnames.tc"
@@ -293,7 +293,7 @@
Whois::Server.define :tld, ".tw", "whois.twnic.net.tw"
Whois::Server.define :tld, ".tz", "whois.tznic.or.tz"
Whois::Server.define :tld, ".in.ua", "whois.in.ua"
-Whois::Server.define :tld, ".ua", "whois.net.ua"
+Whois::Server.define :tld, ".ua", "whois.ua"
Whois::Server.define :tld, ".ug", "whois.co.ug"
Whois::Server.define :tld, ".ac.uk", "whois.ja.net"
Whois::Server.define :tld, ".bl.uk", nil, { :adapter => Whois::Server::Adapters::None }
@@ -338,15 +338,15 @@
Whois::Server.define :tld, ".xn--fiqs8s", "cwhois.cnnic.cn"
Whois::Server.define :tld, ".xn--fiqz9s", "cwhois.cnnic.cn"
Whois::Server.define :tld, ".xn--fpcrj9c3d", nil, { :adapter => Whois::Server::Adapters::None }
-Whois::Server.define :tld, ".xn--fzc2c9e2c", nil, { :adapter => Whois::Server::Adapters::None }
+Whois::Server.define :tld, ".xn--fzc2c9e2c", "whois.nic.lk"
Whois::Server.define :tld, ".xn--gecrj9c", nil, { :adapter => Whois::Server::Adapters::None }
Whois::Server.define :tld, ".xn--h2brj9c", nil, { :adapter => Whois::Server::Adapters::None }
Whois::Server.define :tld, ".xn--j6w193g", "whois.hkirc.hk"
Whois::Server.define :tld, ".xn--kprw13d", "whois.twnic.net.tw"
Whois::Server.define :tld, ".xn--kpry57d", "whois.twnic.net.tw"
Whois::Server.define :tld, ".xn--lgbbat1ad8j", "whois.nic.dz"
Whois::Server.define :tld, ".xn--mgbaam7a8h", "whois.aeda.net.ae"
-Whois::Server.define :tld, ".xn--mgbayh7gpa", nil, { :adapter => Whois::Server::Adapters::None }
+Whois::Server.define :tld, ".xn--mgbayh7gpa", nil, { :adapter => Whois::Server::Adapters::Web, :web => "http://idn.jo/whois_a.aspx" }
Whois::Server.define :tld, ".xn--mgbbh1a71e", nil, { :adapter => Whois::Server::Adapters::None }
Whois::Server.define :tld, ".xn--mgbc0a9azcg", nil, { :adapter => Whois::Server::Adapters::None }
Whois::Server.define :tld, ".xn--mgberp4a5d4ar", "whois.nic.net.sa"
@@ -357,7 +357,7 @@
Whois::Server.define :tld, ".xn--s9brj9c", nil, { :adapter => Whois::Server::Adapters::None }
Whois::Server.define :tld, ".xn--wgbh1c", "whois.dotmasr.eg"
Whois::Server.define :tld, ".xn--wgbl6a", "whois.registry.qa"
-Whois::Server.define :tld, ".xn--xkc2al3hye2a", nil, { :adapter => Whois::Server::Adapters::None }
+Whois::Server.define :tld, ".xn--xkc2al3hye2a", "whois.nic.lk"
Whois::Server.define :tld, ".xn--xkc2dl3a5ee0h", nil, { :adapter => Whois::Server::Adapters::None }
Whois::Server.define :tld, ".xn--yfro4i67o", "whois.sgnic.sg"
Whois::Server.define :tld, ".xn--ygbi2ammx", "whois.pnina.ps"
View
2 lib/whois/record/parser/base.rb
@@ -11,7 +11,7 @@
require 'whois/record/contact'
require 'whois/record/registrar'
require 'whois/record/nameserver'
-require 'whois/record/parser/scanners/ast'
+require 'whois/record/scanners/ast'
module Whois
View
2 lib/whois/record/parser/base_afilias.rb
@@ -8,7 +8,7 @@
require 'whois/record/parser/base'
-require 'whois/record/parser/scanners/afilias'
+require 'whois/record/scanners/afilias'
module Whois
View
2 lib/whois/record/parser/jobswhois.verisign-grs.com.rb
@@ -8,7 +8,7 @@
require 'whois/record/parser/base'
-require 'whois/record/parser/scanners/verisign'
+require 'whois/record/scanners/verisign'
module Whois
View
66 lib/whois/record/parser/scanners/afilias.rb
@@ -1,66 +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/scanners/base'
-
-
-module Whois
- class Record
- class Parser
- module Scanners
-
- # Scanner for the Afilias record.
- class Afilias < Base
-
- self.tokenizers += [
- :skip_empty_line,
- :scan_available,
- :scan_reserved,
- :scan_throttled,
- :scan_disclaimer,
- :scan_keyvalue,
- ]
-
-
- tokenizer :scan_available do
- if @input.scan(/^NOT FOUND\n/)
- @ast["status:available"] = true
- end
- end
-
- # .XXX
- tokenizer :scan_reserved do
- if @input.scan(/^Reserved by ICM Registry\n/)
- @ast["status:reserved"] = true
- end
- end
-
- # .ORG
- tokenizer :scan_throttled do
- if @input.match?(/^WHOIS LIMIT EXCEEDED/)
- @ast["response:throttled"] = true
- @input.skip(/^.+\n/)
- end
- end
-
- tokenizer :scan_disclaimer do
- if @input.pos == 0 && @input.match?(/^(.+\n){3,}\n/)
- lines = []
- while @input.scan(/^(.+)\n/)
- lines << @input[1].strip
- end
- @ast["property:disclaimer"] = lines.join(" ")
- end
- end
- end
-
- end
- end
- end
-end
View
69 lib/whois/record/parser/scanners/ast.rb
@@ -1,69 +0,0 @@
-#--
-# Ruby Whois
-#
-# An intelligent pure Ruby WHOIS client and parser.
-#
-# Copyright (c) 2009-2012 Simone Carletti <weppos@weppos.net>
-#++
-
-
-require 'strscan'
-
-
-module Whois
- class Record
- class Parser
- module Scanners
-
- # The Ast module tries to emulate a super-simple Abstract Syntax Tree structure
- # including method for accessing ast nodes.
- #
- # == Usage
- #
- # Include the Ast module and provide a <tt>parse</tt> instance method.
- # <tt>parse</tt> should returns a Hash representing the AST.
- #
- # def parse
- # Scanner.new.parse
- # end
- # # => { "created_on" => "2009-12-12", ... }
- #
- # Now you can access the AST using the <tt>node</tt> method.
- #
- # node "created_on"
- # # => "2009-12-12"
- #
- # node? "created_on"
- # # => true
- #
- # node? "created_at"
- # # => false
- #
- module Ast
-
- def node(key)
- if block_given?
- value = ast[key]
- value = yield(value) unless value.nil?
- value
- else
- ast[key]
- end
- end
-
- def node?(key)
- !ast[key].nil?
- end
-
- private
-
- def ast
- @ast ||= parse
- end
-
- end
-
- end
- end
- end
-end
View
85 lib/whois/record/parser/scanners/base.rb
@@ -1,85 +0,0 @@
-#--
-# Ruby Whois
-#
-# An intelligent pure Ruby WHOIS client and parser.
-#
-# Copyright (c) 2009-2012 Simone Carletti <weppos@weppos.net>
-#++
-
-
-module Whois
- class Record
- class Parser
- module Scanners
-
- class Base
-
- class_attribute :tokenizers
- self.tokenizers = []
-
- def self.tokenizer(name, &block)
- define_method(name, &block)
- end
-
-
- def initialize(content)
- @input = StringScanner.new(content)
- end
-
- def parse
- # The temporary store.
- # Scanners may use this to store pointers, states or other flags.
- @tmp = {}
-
- # A super-simple AST store.
- @ast = {}
-
- tokenize until @input.eos?
-
- @ast
- end
-
-
- tokenizer :skip_empty_line do
- @input.skip(/^\n/)
- end
-
- tokenizer :skip_newline do
- @input.skip(/\n/)
- end
-
- tokenizer :scan_keyvalue do
- if @input.scan(/(.+?):(.*?)\n/)
- key, value = @input[1].strip, @input[2].strip
- if @ast[key].nil?
- @ast[key] = value
- else
- @ast[key] = [@ast[key]] unless @ast[key].is_a?(Array)
- @ast[key] << value
- end
- end
- end
-
- private
-
- def tokenize
- tokenizers.each do |tokenizer|
- return if send(tokenizer)
- end
- unexpected_token
- end
-
- def unexpected_token
- error!("Unexpected token")
- end
-
- def error!(message)
- raise ParserError, "#{message}: #{@input.peek(@input.string.length)}"
- end
-
- end
-
- end
- end
- end
-end
View
108 lib/whois/record/parser/scanners/iana.rb
@@ -1,108 +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/scanners/base'
-
-
-module Whois
- class Record
- class Parser
- module Scanners
-
- class Iana < Base
-
- self.tokenizers += [
- :skip_empty_line,
- :scan_disclaimer,
- :scan_section,
- ]
-
-
- tokenizer :scan_disclaimer do
- if @input.match?(/^\%(.*?)\n/)
- disclaimer = []
- while @input.scan(/\%(.*?)\n/)
- matched = @input[1].strip
- disclaimer << matched if matched =~ /\w+/
- end
- @ast["Disclaimer"] = disclaimer.join(" ")
- end
- end
-
- tokenizer :scan_section do
- if @input.scan(/^(.+):(.+)\n/)
-
- # Adapt the section's name depending on the first line
- section = case @input[1].strip
- when 'contact'
- @input[2].strip # use the contact type name as identifier
- when 'created', 'changed'
- 'dates'
- when 'nserver'
- 'nameservers'
- else
- @input[1].strip # Default name is the first label found
- end
-
- content = parse_section_pairs
- @input.match?(/\n+/) || error("Unexpected end of section")
- @ast[section] = content
- end
- end
-
-
- private
-
- def parse_section_pairs
- # Sets by default the firsts values found in the section parsing bellow
- section_name, section_value = @input[1].strip, @input[2].strip
- #contents = {section_name => section_value}
-
- contents = {}
-
- while content = parse_section_pair
- contents.merge!(content)
- end
-
- if contents.has_key? section_name
- contents[section_name].insert(0, "#{section_value}\n")
- else
- contents[section_name] = section_value
- end
-
- if !contents.empty?
- contents
- else
- false
- end
- end
-
- def parse_section_pair
- if @input.scan(/^(.+):\s*(.+)\n/)
- key = @input[1].strip
- values = [@input[2].strip]
-
- while value = parse_section_pair_newlinevalue(key)
- values << value
- end
- { key => values.join("\n") }
- end
- end
-
- def parse_section_pair_newlinevalue(key)
- if @input.scan(/^#{key}:\s*(.+)\n/)
- @input[1].strip
- end
- end
-
- end
- end
- end
- end
-end
View
122 lib/whois/record/parser/scanners/verisign.rb
@@ -1,122 +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/scanners/base'
-
-
-module Whois
- class Record
- class Parser
- module Scanners
-
- class Verisign < Base
-
- self.tokenizers += [
- :skip_empty_line,
- :scan_response_unavailable,
- :scan_available,
- :scan_disclaimer,
- :scan_notice,
- :scan_keyvalue_indented,
- :skip_ianaservice,
- :skip_lastupdate,
- :skip_fuffa,
- ]
-
-
- tokenizer :scan_response_unavailable do
- # Check if the string starts with /*
- # If it does, match until the end of all /* lines
- # or the end of the file and check for the content.
- #
- # Flag the block as visited to force the scanner to ignore this tokenizer
- # if already used and the content didn't match the unavailable message.
- if @input.match?(/^\*\n/) && !visited?
- p = /^[^\*]|\z/
- y = @input.check_until(p) =~ /^\* Sorry, the Whois database is currently down/
-
- if y
- @input.skip_until(p)
- @ast["response:unavailable"] = true
- else
- visited!
- end
- end
- end
-
- tokenizer :scan_available do
- if @input.scan(/No match for "(.+?)"\.\n/)
- @ast["Domain Name"] = @input[1].strip
- end
- end
-
- tokenizer :scan_disclaimer do
- if @input.match?(/^TERMS OF USE:/)
- lines = []
- while @input.scan(/(.+)\n/)
- lines << @input[1].strip
- end
- @ast["Disclaimer"] = lines.join(" ")
- end
- end
-
- tokenizer :scan_notice do
- if @input.match?(/^NOTICE:/)
- lines = []
- while @input.scan(/(.+)\n/)
- lines << @input[1].strip
- end
- @ast["Notice"] = lines.join(" ")
- end
- end
-
- tokenizer :scan_keyvalue_indented do
- if @input.scan(/\s+(.+?):(.*?)\n/)
- key, value = @input[1].strip, @input[2].strip
- if @ast[key].nil?
- @ast[key] = value
- else
- @ast[key] = [@ast[key]] unless @ast[key].is_a?(Array)
- @ast[key] << value
- end
- end
- end
-
- tokenizer :skip_lastupdate do
- @input.skip(/>>>(.+?)<<<\n/)
- end
-
- tokenizer :skip_fuffa do
- @input.scan(/^\S(.+)(?:\n|\z)/)
- end
-
- tokenizer :skip_ianaservice do
- if @input.match?(/IANA Whois Service/)
- @ast["IANA"] = true
- @input.terminate
- end
- end
-
- private
-
- def visited?
- !!@tmp["visited:#{@input.pos}"]
- end
-
- def visited!
- @tmp["visited:#{@input.pos}"] = true
- nil
- end
-
- end
-
- end
- end
- end
-end
View
49 lib/whois/record/parser/scanners/whois.biz.rb
@@ -1,49 +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/scanners/base'
-
-
-module Whois
- class Record
- class Parser
- module Scanners
-
- class WhoisBiz < Base
-
- self.tokenizers += [
- :skip_empty_line,
- :scan_available,
- :scan_keyvalue,
- :skip_lastupdate,
- :skip_fuffa,
- ]
-
-
- tokenizer :scan_available do
- if @input.scan(/^Not found: (.+)\n/)
- @ast["Domain Name"] = @input[1]
- @ast["status:available"] = true
- end
- end
-
- tokenizer :skip_lastupdate do
- @input.skip(/>>>(.+?)<<<\n/)
- end
-
- tokenizer :skip_fuffa do
- @input.scan(/^\S(.+)\n/)
- end
-
- end
-
- end
- end
- end
-end
View
52 lib/whois/record/parser/scanners/whois.centralnic.com.rb
@@ -1,52 +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/scanners/base'
-
-
-module Whois
- class Record
- class Parser
- module Scanners
-
- # Scanner for the whois.centralnic.com record.
- #
- # @since 2.3.0
- class WhoisCentralnicCom < Base
-
- self.tokenizers += [
- :skip_empty_line,
- :scan_available,
- :scan_disclaimer,
- :scan_keyvalue,
- ]
-
-
- tokenizer :scan_available do
- if @input.skip(/^DOMAIN NOT FOUND\n/)
- @ast["status:available"] = true
- end
- end
-
- tokenizer :scan_disclaimer do
- if @input.match?(/^\S([^:]+)\n/)
- lines = []
- while @input.scan(/(.+)\n/)
- lines << @input[1].strip
- end
- @ast["field:disclaimer"] = lines.join(" ")
- end
- end
-
- end
-
- end
- end
- end
-end
View
46 lib/whois/record/parser/scanners/whois.cnnic.cn.rb
@@ -1,46 +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/scanners/base'
-
-
-module Whois
- class Record
- class Parser
- module Scanners
-
- # Scanner for the whois.cnnic.cn record.
- class WhoisCnnicCn < Base
-
- self.tokenizers += [
- :skip_empty_line,
- :scan_reserved,
- :scan_available,
- :scan_keyvalue,
- ]
-
-
- tokenizer :scan_available do
- if @input.scan(/^no matching record/)
- @ast["status:available"] = true
- end
- end
-
- tokenizer :scan_reserved do
- if @input.scan(/^the domain you want to register is reserved/)
- @ast["status:reserved"] = true
- end
- end
-
- end
-
- end
- end
- end
-end
View
124 lib/whois/record/parser/scanners/whois.denic.de.rb
@@ -1,124 +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/scanners/base'
-
-
-module Whois
- class Record
- class Parser
- module Scanners
-
- class WhoisDenicDe < Base
-
- self.tokenizers += [
- :skip_empty_line,
- :scan_response_throttled,
- :scan_disclaimer,
- :scan_invalid,
- :scan_available,
- :scan_pair,
- :scan_contact,
- :skip_db_time,
- ]
-
-
- # Version 1.11.0, 1.10.0
- tokenizer :scan_available do
- if @input.match?(/% Object ".+" not found in database\n/)
- while @input.skip(/%(.*)\n/)
- end
- @ast["status:available"] = true
- end
- end
-
- # Version 1.11.0, 1.10.0
- tokenizer :scan_invalid do
- if @input.match?(/% ".+" is not a valid domain name\n/)
- @input.scan(/% "(.+?)" is not a valid domain name\n/)
- @ast["Domain"] = @input[1]
- @ast["status:invalid"] = true
- end
- end
-
- tokenizer :scan_response_throttled do
- if @input.match?(/^% Error: 55000000002/)
- @ast["response:throttled"] = true
- @input.skip(/^.+\n/)
- end
- end
-
- tokenizer :scan_disclaimer do
- if @input.match?(/% Copyright \(c\) *\d{4} by DENIC\n/)
- @input.scan_until(/% Terms and Conditions of Use\n/)
- lines = []
- while @input.match?(/%/) && @input.scan(/%(.*)\n/)
- lines << @input[1].strip unless @input[1].strip == ""
- end
- @ast["Disclaimer"] = lines.join(" ")
- end
- end
-
- tokenizer :scan_pair do
- parse_pair(@ast)
- end
-
- tokenizer :scan_contact do
- if @input.scan(/\[(.*)\]\n/)
- contact_name = @input[1]
- contact = {}
- while parse_pair(contact)
- end
- @ast[contact_name] = {
- "id" => nil,
- "name" => contact['Name'],
- "organization" => contact['Organisation'],
- "address" => contact['Address'],
- "city" => contact['City'],
- # 1.10.0, 1.11.0 || 2.0
- "zip" => contact['Pcode'] || contact['PostalCode'],
- "state" => nil,
- "country" => contact['Country'],
- "country_code" => contact['CountryCode'],
- "phone" => contact['Phone'],
- "fax" => contact['Fax'],
- "email" => contact['Email'],
- "created_on" => nil,
- "updated_on" => contact['Changed']
- }
- end
- end
-
- # Version 2.0
- tokenizer :skip_db_time do
- @input.skip(/^% DB time is (.+)\n/)
- end
-
-
- private
-
- def parse_pair(store)
- if @input.scan(/([^ \[]*):(.*)\n/)
- key, value = @input[1].strip, @input[2].strip
- if store[key].nil?
- store[key] = value
- else
- store[key].is_a?(Array) || store[key] = [store[key]]
- store[key] << value
- end
- store
- end
- end
-
- end
-
- end
- end
- end
-end
View
180 lib/whois/record/parser/scanners/whois.nic.hu.rb
@@ -1,180 +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/scanners/base'
-
-
-module Whois
- class Record
- class Parser
- module Scanners
-
- class WhoisNicHu < Base
-
- self.tokenizers += [
- :scan_version,
- :scan_disclaimer,
- :scan_domain,
- :scan_available,
- :scan_in_progress,
-
- # v2.0
- :scan_moreinfo,
-
- # v1.99
- :scan_domain_data,
- :scan_contacts,
-
- :skip_empty_line,
- ]
-
-
- # FIXME: Requires UTF-8 Encoding (see #11)
- tokenizer :scan_available do
- if @input.match?(/Nincs (.*?) \/ No match\n/)
- @input.scan(/Nincs (.*?) \/ No match\n/)
- @ast["status:available"] = true
- end
- end
-
- # FIXME: Requires UTF-8 Encoding (see #11)
- tokenizer :scan_in_progress do
- if @input.match?(/(.*?) folyamatban \/ Registration in progress\n/)
- @input.scan(/(.*?) folyamatban \/ Registration in progress\n/)
- @ast["status:inprogress"] = true
- end
- end
-
- tokenizer :scan_disclaimer do
- if @input.match?(/^Rights.*\n/)
- lines = @input.scan_until(/^\n/)
- @ast["field:disclaimer"] = lines.strip
- end
- end
-
- tokenizer :scan_domain do
- if @input.match?(/^domain:\s+(.*)\n/) && @input.scan(/^domain:\s+(.*?)\n/)
- @ast["field:domain"] = @input[1].strip
- end
- end
-
- # FIXME: Requires UTF-8 Encoding (see #11)
- tokenizer :scan_moreinfo do
- if @input.match?(/Tov.* ld\.:\n/)
- @ast["field:moreinfo"] = @input.scan_until(/^\n/)
- end
- end
-
- tokenizer :scan_version do
- if @input.match?(/% Whois server .*\n/)
- @input.scan(/% Whois server ([\w\d\.]*).*?\n/)
- @ast["field:version"] = @input[1]
- end
- end
-
- tokenizer :scan_domain_data do
- if @input.match?(/(.+?):\s+(.*)\n/)
- while @input.scan(/(.+?):\s+(.*)\n/)
- key, value = @input[1].strip, @input[2].strip
- if key == 'person'
- @ast['name'] = value
- elsif key == 'org'
- if value =~ /org_name_hun:\s+(.*)\Z/
- @ast['name'] = $1
- elsif value =~ /org_name_eng:\s+(.*)\Z/
- @ast['org'] = $1
- elsif value != 'Private person'
- contact['org'] = value
- end
- elsif @ast[key].nil?
- @ast[key] = value
- elsif @ast[key].is_a? Array
- @ast[key] << value
- else
- @ast[key] = [@ast[key], value].flatten
- end
- end
- true
- end
- end
-
- tokenizer :scan_contacts do
- if @input.match?(/\n(person|org):/)
- @input.scan(/\n/)
- while @input.match?(/(.+?):\s+(.*)\n/)
- parse_contact
- end
- true
- end
- end
-
-
- private
-
- def parse_contact
- contact ||= {}
- while @input.scan(/(.+?):\s+(.*)\n/)
- key, value = @input[1].strip, @input[2].strip
- if key == 'hun-id'
- a1 = contact['address'][1].split(/\s/)
- zip = a1.shift
- city = a1.join(' ')
- # we should keep the old values if this is an already
- # defined contact
- if @ast[value].nil?
- @ast[value] = {
- "id" => value,
- "name" => contact['name'],
- "organization" => contact['org'],
- "address" => contact['address'][0],
- "city" => city,
- "zip" => zip,
- "country_code" => contact['address'][2],
- "phone" => contact['phone'],
- "fax" => contact['fax-no'],
- "email" => contact['e-mail']
- }
- else
- @ast[value]["id"] ||= value
- @ast[value]["name"] ||= contact['name']
- @ast[value]["organization"] ||= contact['org']
- @ast[value]["address"] ||= contact['address'][0]
- @ast[value]["city"] ||= city
- @ast[value]["zip"] ||= zip
- @ast[value]["country_code"] ||= contact['address'][2]
- @ast[value]["phone"] ||= contact['phone']
- @ast[value]["fax"] ||= contact['fax-no']
- @ast[value]["email"] ||= contact['e-mail']
- end
- contact = {}
- elsif key == 'person'
- contact['name'] = value
- elsif key == 'org'
- if value =~ /org_name_hun:\s+(.*)\Z/
- contact['name'] = $1
- elsif value =~ /org_name_eng:\s+(.*)\Z/
- contact['org'] = $1
- else
- contact['org'] = value
- end
- elsif key == 'address' && !contact['address'].nil?
- contact['address'] = [contact['address'], value].flatten
- else
- contact[key] = value
- end
- end
- true
- end
-
- end
-
- end
- end
- end
-end
View
111 lib/whois/record/parser/scanners/whois.nic.it.rb
@@ -1,111 +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/scanners/base'
-
-
-module Whois
- class Record
- class Parser
- module Scanners
-
- class WhoisNicIt < Base
-
- self.tokenizers += [
- :skip_empty_line,
- :scan_response_unavailable,
- :scan_disclaimer,
- :scan_keyvalue,
- :scan_section,
- ]
-
-
- tokenizer :scan_response_unavailable do
- if @input.scan(/Service temporarily unavailable\.\n/)
- @ast["response:unavailable"] = true
- end
- end
-
- tokenizer :scan_disclaimer do
- if @input.match?(/\*(.*?)\*\n/)
- disclaimer = []
- while @input.scan(/\*(.*?)\*\n/)
- matched = @input[1].strip
- disclaimer << matched if matched =~ /\w+/
- end
- @ast["Disclaimer"] = disclaimer.join(" ")
- end
- end
-
- tokenizer :scan_section do
- if @input.scan(/([^:]+?)\n/)
- section = @input[1].strip
- content = parse_section_pairs ||
- parse_section_items
- @input.match?(/\n+/) || error!("Unexpected end of section")
- @ast[section] = content
- end
- end
-
-
- private
-
- def parse_section_items
- if @input.match?(/(\s+)([^:]+?)\n/)
- items = []
- indentation = @input[1].length
- while item = parse_section_items_item(indentation)
- items << item
- end
- items
- end
- end
-
- def parse_section_items_item(indentation)
- if @input.scan(/\s{#{indentation}}(.+)\n/)
- @input[1]
- end
- end
-
- def parse_section_pairs
- contents = {}
- while content = parse_section_pair
- contents.merge!(content)
- end
- if !contents.empty?
- contents
- else
- false
- end
- end
-
- def parse_section_pair
- if @input.scan(/(\s+)(.+?):(\s+)(.*?)\n/)
- key = @input[2].strip
- values = [@input[4].strip]
- indentation = @input[1].length + @input[2].length + 1 + @input[3].length
- while value = parse_section_pair_newlinevalue(indentation)
- values << value
- end
- { key => values.join("\n") }
- end
- end
-
- def parse_section_pair_newlinevalue(indentation)
- if @input.scan(/\s{#{indentation}}(.+)\n/)
- @input[1]
- end
- end
-
- end
-
- end
- end
- end
-end
View
41 lib/whois/record/parser/scanners/whois.registry.qa.rb
@@ -1,41 +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/scanners/base'
-
-
-module Whois
- class Record
- class Parser
- module Scanners
-
- # Scanner for the whois.registry.qa record.
- #
- # @since 2.1.0
- class WhoisRegistryQa < Base
-
- self.tokenizers += [
- :skip_empty_line,
- :scan_available,
- :scan_keyvalue,
- ]
-
-
- tokenizer :scan_available do
- if @input.scan(/^No Data Found\n/)
- @ast["status:available"] = true
- end
- end
-
- end
-
- end
- end
- end
-end
View
62 lib/whois/record/parser/scanners/whois.smallregistry.net.rb
@@ -1,62 +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/scanners/base'
-
-
-module Whois
- class Record
- class Parser
- module Scanners
-
- class WhoisSmallregistryNet < Base
-
- self.tokenizers += [
- :scan_yaml_header,
- :scan_disclaimer,
- :scan_request_time,
- :scan_available,
- :scan_body,
- ]
-
- tokenizer :scan_yaml_header do
- # skip the YAML prelude
- @input.scan(/^---.*\n/)
- end
-
- tokenizer :scan_disclaimer do
- if @input.match?(/^#/) && disclaimer = @input.scan_until(/^#\n/)
- @ast["field:disclaimer"] = disclaimer
- end
- end
-
- tokenizer :scan_request_time do
- if @input.scan(/^# (\d+-\d+-\d+T.*)\n/)
- @ast["field:request_time"] = @input[1].strip
- end
- end
-
- tokenizer :scan_available do
- if @input.scan(/^# Object not found.*\n/)
- @ast["status:available"] = true
- end
- end
-
- tokenizer :scan_body do
- str = @input.rest
- str.gsub!(/ (![\w]+) \n/, " \n") # remove custom types
- @ast.merge! YAML.load(str)
- @input.terminate
- end
-
- end
- end
- end
- end
-end
View
52 lib/whois/record/parser/scanners/whois.tld.ee.rb
@@ -1,52 +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/scanners/base'
-
-
-module Whois
- class Record
- class Parser
- module Scanners
-
- # Scanner for the whois.tld.ee record.
- #
- # @todo This is an incomplete scanner, it skips all the properties
- # except contacts.
- class WhoisTldEe < Base
-
- self.tokenizers += [
- :scan_contact,
- :todo_content,
- ]
-
-
- tokenizer :scan_contact do
- if @input.scan(/contact:\s+(.*)\n/)
- section = @input[1].strip
- content = {}
-
- while @input.scan(/(.*?):\s+(.*?)\n/)
- content[@input[1]] = @input[2]
- end
-
- @ast[section] = content
- end
- end
-
- tokenizer :todo_content do
- @input.scan(/(.*)\n/)
- end
-
- end
-
- end
- end
- end
-end
View
97 lib/whois/record/parser/whois.audns.net.au.rb
@@ -8,36 +8,48 @@
require 'whois/record/parser/base'
+require 'whois/record/scanners/whois.audns.net.au.rb'
module Whois
class Record
class Parser
- #
- # = whois.audns.net.au parser
- #
# Parser for the whois.audns.net.au server.
+ #
+ # @see Whois::Record::Parser::Example
+ # The Example parser for the list of all available methods.
#
- # 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.
- #
+ # @since RELEASE
class WhoisAudnsNetAu < Base
+ include Scanners::Ast
+
+ property_not_supported :disclaimer
+
+
+ property_supported :domain do
+ node("Domain Name")
+ end
+
+ property_not_supported :domain_id
+
+
+ property_not_supported :referral_whois
+
+ property_not_supported :referral_url
+
# == Values for Status
#
# @see http://www.auda.org.au/policies/auda-2002-28/
# @see http://www.auda.org.au/policies/auda-2006-07/
#
property_supported :status do
- content_for_scanner.scan(/Status:\s+(.+?)\n/).flatten
+ Array.wrap(node("Status"))
end
property_supported :available? do
- (content_for_scanner.strip == "No Data Found")
+ !!node("status:available")
end
property_supported :registered? do
@@ -48,17 +60,70 @@ class WhoisAudnsNetAu < Base
property_not_supported :created_on
property_supported :updated_on do
- if content_for_scanner =~ /Last Modified:\s+(.+)\n/
- Time.parse($1)
- end
+ node("Last Modified") { |value| Time.parse(value) }
end
property_not_supported :expires_on
+ property_supported :registrar do
+ node("Registrar ID") do |str|
+ Record::Registrar.new(
+ :id => str,
+ :name => node("Registrar Name")
+ )
+ end
+ end
+
+
+ property_supported :registrant_contacts do
+ contact = build_contact("Registrant Contact", Record::Contact::TYPE_REGISTRANT)
+ contact.organization = node("Registrant") if contact
+ contact
+ end
+
+ property_not_supported :admin_contacts
+
+ property_supported :technical_contacts do
+ build_contact("Tech Contact", Record::Contact::TYPE_TECHNICAL)
+ end
+
+
property_supported :nameservers do
- content_for_scanner.scan(/Name Server:\s+(.+)\n/).flatten.map do |name|
- Record::Nameserver.new(name)
+ Array.wrap(node("Name Server")).map do |name|
+ Record::Nameserver.new(:name => name)
+ end
+ end
+
+
+ # Initializes a new {Scanners::WhoisAudnsNetAu} instance
+ # passing the {#content_for_scanner}
+ # and calls +parse+ on it.
+ #
+ # @return [Hash]
+ def parse
+ Scanners::WhoisAudnsNetAu.new(content_for_scanner).parse
+ end
+
+
+ private
+
+ def build_contact(element, type)
+ node("#{element} ID") do |str|
+ Record::Contact.new(
+ :type => type,
+ :id => str,
+ :name => node("#{element} Name"),
+ :organization => nil,
+ :address => nil,
+ :city => nil,
+ :zip => nil,
+ :state => nil,
+ :country => nil,
+ :phone => nil,
+ :fax => nil,
+ :email => nil
+ )
end
end
View
6 lib/whois/record/parser/whois.biz.rb
@@ -8,7 +8,7 @@
require 'whois/record/parser/base'
-require 'whois/record/parser/scanners/whois.biz.rb'
+require 'whois/record/scanners/whois.biz.rb'
module Whois
@@ -66,7 +66,7 @@ class WhoisBiz < Base
property_supported :registrar do
- node("Sponsoring Registrar") do |raw|
+ node("Sponsoring Registrar") do |str|
Record::Registrar.new(
:id => node("Sponsoring Registrar IANA ID"),
:name => node("Sponsoring Registrar")
@@ -108,7 +108,7 @@ def parse
private
def build_contact(element, type)
- node("#{element} ID") do |raw|
+ node("#{element} ID") do |str|
Record::Contact.new(
:type => type,
:id => node("#{element} ID"),
View
2 lib/whois/record/parser/whois.centralnic.com.rb
@@ -8,7 +8,7 @@
require 'whois/record/parser/base'
-require 'whois/record/parser/scanners/whois.centralnic.com.rb'
+require 'whois/record/scanners/whois.centralnic.com.rb'
module Whois
View
2 lib/whois/record/parser/whois.cnnic.cn.rb
@@ -8,7 +8,7 @@
require 'whois/record/parser/base'
-require 'whois/record/parser/scanners/whois.cnnic.cn.rb'
+require 'whois/record/scanners/whois.cnnic.cn.rb'
module Whois
View
2 lib/whois/record/parser/whois.crsnic.net.rb
@@ -8,7 +8,7 @@
require 'whois/record/parser/base'
-require 'whois/record/parser/scanners/verisign'
+require 'whois/record/scanners/verisign'
module Whois
View
2 lib/whois/record/parser/whois.denic.de.rb
@@ -8,7 +8,7 @@
require 'whois/record/parser/base'
-require 'whois/record/parser/scanners/whois.denic.de.rb'
+require 'whois/record/scanners/whois.denic.de.rb'
module Whois
View
112 lib/whois/record/parser/whois.dns.hr.rb
@@ -0,0 +1,112 @@
+#--
+# Ruby Whois
+#
+# An intelligent pure Ruby WHOIS client and parser.
+#
+# Copyright (c) 2009-2012 Simone Carletti <weppos@weppos.net>
+#++
+
+
+require 'whois/record/parser/base'
+require 'whois/record/scanners/whois.dns.hr.rb'
+
+
+module Whois
+ class Record
+ class Parser
+
+ # Parser for the whois.dns.hr server.
+ #
+ # @see Whois::Record::Parser::Example
+ # The Example parser for the list of all available methods.
+ #
+ # @since 2.4.0
+ class WhoisDnsHr < Base
+ include Scanners::Ast
+
+ property_not_supported :disclaimer
+
+
+ property_supported :domain do
+ node("domain")
+ end
+
+ 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
+ !!node("status:available")
+ end
+
+ property_supported :registered? do
+ !available?
+ end
+
+
+ property_not_supported :created_on
+
+ property_not_supported :updated_on
+
+ property_supported :expires_on do
+ node("expires") { |value| Time.parse(value) }
+ end
+
+
+ property_not_supported :registrar
+
+
+ property_supported :registrant_contacts do
+ node("descr") do |array|
+ fuffa, zip, city = array[2].match(/([\d\s]+) (.+)/).to_a
+ Record::Contact.new(
+ :type => Whois::Record::Contact::TYPE_REGISTRANT,
+ :id => nil,
+ :name => array[0],
+ :organization => nil,
+ :address => array[1],
+ :city => city,
+ :zip => zip,
+ :state => nil,
+ :country => nil,
+ :phone => nil,
+ :fax => nil,
+ :email => nil
+ )
+ end
+ end
+
+ property_not_supported :admin_contacts
+
+ property_not_supported :technical_contacts
+
+
+ property_not_supported :nameservers
+
+
+ # Initializes a new {Scanners::WhoisDnsHr} instance
+ # passing the {#content_for_scanner}
+ # and calls +parse+ on it.
+ #
+ # @return [Hash]
+ def parse
+ Scanners::WhoisDnsHr.new(content_for_scanner).parse
+ end
+
+ end
+
+ end
+ end
+end
View
2 lib/whois/record/parser/whois.dreamhost.com.rb
@@ -19,7 +19,7 @@ class Parser
# @see Whois::Record::Parser::Example
# The Example parser for the list of all available methods.
#
- # @since NEXT_RELEASE
+ # @since 2.4.0
class WhoisDreamhostCom < Base
property_not_supported :status
View
76 lib/whois/record/parser/whois.fi.rb
@@ -0,0 +1,76 @@
+#--
+# 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
+
+ # Parser for the whois.fi 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 Whois::Record::Parser::Example
+ # The Example parser for the list of all available methods.
+ #
+ # @since 2.4.0
+ class WhoisFi < Base
+
+ property_supported :status do
+ if content_for_scanner =~ /status:\s+(.+?)\n/
+ case $1.downcase
+ when "granted"
+ :registered
+ else
+ Whois.bug!(ParserError, "Unknown status `#{$1}'.")
+ end
+ else
+ :available
+ end
+ end
+
+ property_supported :available? do
+ (status == :available)
+ end
+
+ property_supported :registered? do
+ !available?
+ end
+
+
+ property_supported :created_on do
+ if content_for_scanner =~ /created:\s+(.+)\n/
+ Time.parse($1)
+ end
+ end
+
+ property_not_supported :updated_on
+
+ property_supported :expires_on do
+ if content_for_scanner =~ /expires:\s+(.+)\n/
+ Time.parse($1)
+ end
+ end
+
+
+ property_supported :nameservers do
+ content_for_scanner.scan(/nserver:\s+(.+)\n/).flatten.map do |line|
+ Record::Nameserver.new(line.split(" ").first)
+ end
+ end
+
+ end
+
+ end
+ end
+end
View
58 lib/whois/record/parser/whois.ficora.fi.rb
@@ -7,69 +7,17 @@
#++
-require 'whois/record/parser/base'
+require 'whois/record/parser/whois.fi'
module Whois
class Record