Skip to content
Browse files

Standardized #status property for the

following parsers (references #5)
  * whois.aero
  * whois.aeda.net.ae
  * whois.audns.net.au
  * whois.cat
  * whois.cctld.uz
  * whois.co.ug
  * whois.denic.de
  * whois.dk-hostmaster.dk
  * whois.dns.be
  * whois.dns.lu
  * whois.dns.pt
  * whois.domainregistry.ie
  * whois.in.ua
  * whois.jprs.jp
  * whois.net.ua
  * whois.nic-se.se
  * whois.nic.am
  * whois.nic.asia
  * whois.nic.at
  * whois.nic.coop
  * whois.nic.fr
  * whois.nic.ht
  * whois.nic.kz
  * whois.nic.la
  * whois.nic.mu
  * whois.nic.nu
  * whois.nic.org.uy
  * whois.nic.travel
  * whois.nic.uk
  * whois.nic.ve
  * whois.norid.no
  * whois.register.bg
  * whois.registry.in
  * whois.rotld.ro
  * whois.srs.net.nz

Property cache is missing
for some parsers (references #18)
  • Loading branch information...
1 parent 470e536 commit d25e86982776789526194caf561b3713fcb43c42 @weppos committed Oct 19, 2010
Showing with 2,106 additions and 710 deletions.
  1. +38 −5 CHANGELOG.rdoc
  2. +2 −2 lib/whois/answer/parser/jobswhois.verisign-grs.com.rb
  3. +2 −2 lib/whois/answer/parser/whois.afilias-grs.info.rb
  4. +3 −3 lib/whois/answer/parser/whois.afilias.info.rb
  5. +10 −4 lib/whois/answer/parser/whois.audns.net.au.rb
  6. +2 −2 lib/whois/answer/parser/whois.biz.rb
  7. +8 −2 lib/whois/answer/parser/whois.cat.rb
  8. +8 −2 lib/whois/answer/parser/whois.cctld.uz.rb
  9. +2 −2 lib/whois/answer/parser/whois.cnnic.cn.rb
  10. +9 −1 lib/whois/answer/parser/whois.co.ug.rb
  11. +3 −3 lib/whois/answer/parser/whois.crsnic.net.rb
  12. +15 −1 lib/whois/answer/parser/whois.denic.de.rb
  13. +10 −4 lib/whois/answer/parser/whois.dk-hostmaster.dk.rb
  14. +10 −3 lib/whois/answer/parser/whois.dns.be.rb
  15. +8 −2 lib/whois/answer/parser/whois.dns.lu.rb
  16. +8 −2 lib/whois/answer/parser/whois.dns.pt.rb
  17. +6 −2 lib/whois/answer/parser/whois.domainregistry.ie.rb
  18. +2 −2 lib/whois/answer/parser/whois.dot.tk.rb
  19. +2 −2 lib/whois/answer/parser/whois.dotmobiregistry.net.rb
  20. +3 −3 lib/whois/answer/parser/whois.educause.edu.rb
  21. +3 −3 lib/whois/answer/parser/whois.eu.org.rb
  22. +3 −3 lib/whois/answer/parser/whois.eu.rb
  23. +2 −2 lib/whois/answer/parser/whois.ficora.fi.rb
  24. +2 −2 lib/whois/answer/parser/whois.gg.rb
  25. +2 −2 lib/whois/answer/parser/whois.hkirc.hk.rb
  26. +8 −2 lib/whois/answer/parser/whois.in.ua.rb
  27. +3 −3 lib/whois/answer/parser/whois.isnic.is.rb
  28. +2 −2 lib/whois/answer/parser/whois.je.rb
  29. +10 −3 lib/whois/answer/parser/whois.jprs.jp.rb
  30. +2 −2 lib/whois/answer/parser/whois.museum.rb
  31. +8 −2 lib/whois/answer/parser/whois.net.ua.rb
  32. +11 −5 lib/whois/answer/parser/whois.nic-se.se.rb
  33. +2 −2 lib/whois/answer/parser/whois.nic.ac.rb
  34. +2 −2 lib/whois/answer/parser/whois.nic.ag.rb
  35. +10 −4 lib/whois/answer/parser/whois.nic.am.rb
  36. +2 −2 lib/whois/answer/parser/whois.nic.as.rb
  37. +10 −4 lib/whois/answer/parser/whois.nic.asia.rb
  38. +2 −2 lib/whois/answer/parser/whois.nic.at.rb
  39. +4 −4 lib/whois/answer/parser/whois.nic.cc.rb
  40. +3 −3 lib/whois/answer/parser/whois.nic.cd.rb
  41. +10 −4 lib/whois/answer/parser/whois.nic.coop.rb
  42. +2 −2 lib/whois/answer/parser/whois.nic.dz.rb
  43. +8 −4 lib/whois/answer/parser/whois.nic.fr.rb
  44. +1 −1 lib/whois/answer/parser/whois.nic.gs.rb
  45. +10 −3 lib/whois/answer/parser/whois.nic.ht.rb
  46. +2 −2 lib/whois/answer/parser/whois.nic.im.rb
  47. +2 −2 lib/whois/answer/parser/whois.nic.io.rb
  48. +7 −1 lib/whois/answer/parser/whois.nic.kz.rb
  49. +8 −2 lib/whois/answer/parser/whois.nic.la.rb
  50. +3 −3 lib/whois/answer/parser/whois.nic.ly.rb
  51. +8 −6 lib/whois/answer/parser/whois.nic.mu.rb
  52. +9 −3 lib/whois/answer/parser/whois.nic.nu.rb
  53. +8 −2 lib/whois/answer/parser/whois.nic.org.uy.rb
  54. +0 −1 lib/whois/answer/parser/whois.nic.sn.rb
  55. +2 −2 lib/whois/answer/parser/whois.nic.st.rb
  56. +2 −2 lib/whois/answer/parser/whois.nic.tel.rb
  57. +2 −2 lib/whois/answer/parser/whois.nic.tl.rb
  58. +11 −3 lib/whois/answer/parser/whois.nic.travel.rb
  59. +2 −2 lib/whois/answer/parser/whois.nic.tv.rb
  60. +10 −4 lib/whois/answer/parser/whois.nic.uk.rb
  61. +2 −2 lib/whois/answer/parser/whois.nic.us.rb
  62. +8 −2 lib/whois/answer/parser/whois.nic.ve.rb
  63. +3 −3 lib/whois/answer/parser/whois.norid.no.rb
  64. +2 −2 lib/whois/answer/parser/whois.publicinterestregistry.net.rb
  65. +10 −4 lib/whois/answer/parser/whois.register.bg.rb
  66. +11 −3 lib/whois/answer/parser/whois.registry.in.rb
  67. +2 −2 lib/whois/answer/parser/whois.registrypro.pro.rb
  68. +2 −2 lib/whois/answer/parser/whois.ripe.net.rb
  69. +3 −3 lib/whois/answer/parser/whois.ripn.net.rb
  70. +10 −4 lib/whois/answer/parser/whois.rotld.ro.rb
  71. +2 −2 lib/whois/answer/parser/whois.samoanic.ws.rb
  72. +13 −6 lib/whois/answer/parser/whois.srs.net.nz.rb
  73. +2 −2 lib/whois/answer/parser/whois.usp.ac.fj.rb
  74. +3 −3 lib/whois/answer/parser/whois.za.net.rb
  75. +4 −4 lib/whois/answer/parser/whois.za.org.rb
  76. +18 −4 test/whois/answer/parser/jobswhois.verisign-grs.com_test.rb
  77. +126 −28 test/whois/answer/parser/whois.afilias-grs.info_test.rb
  78. +19 −5 test/whois/answer/parser/whois.afilias.info_test.rb
  79. +20 −6 test/whois/answer/parser/whois.audns.net.au_test.rb
  80. +18 −4 test/whois/answer/parser/whois.biz_test.rb
  81. +3 −3 test/whois/answer/parser/whois.cat_test.rb
  82. +2 −2 test/whois/answer/parser/whois.cctld.uz_test.rb
  83. +18 −4 test/whois/answer/parser/whois.cnnic.cn_test.rb
  84. +3 −2 test/whois/answer/parser/whois.co.ug_test.rb
  85. +18 −4 test/whois/answer/parser/whois.crsnic.net_test.rb
  86. +7 −7 test/whois/answer/parser/whois.denic.de_test.rb
  87. +28 −9 test/whois/answer/parser/whois.dk-hostmaster.dk_test.rb
  88. +3 −3 test/whois/answer/parser/whois.dns.be_test.rb
  89. +3 −3 test/whois/answer/parser/whois.dns.lu_test.rb
  90. +2 −2 test/whois/answer/parser/whois.dns.pt_test.rb
  91. +1 −1 test/whois/answer/parser/whois.domainregistry.ie_test.rb
  92. +18 −4 test/whois/answer/parser/whois.dot.tk_test.rb
  93. +19 −5 test/whois/answer/parser/whois.dotmobiregistry.net_test.rb
  94. +28 −9 test/whois/answer/parser/whois.educause.edu_test.rb
  95. +28 −9 test/whois/answer/parser/whois.eu.org_test.rb
  96. +28 −9 test/whois/answer/parser/whois.eu_test.rb
  97. +18 −4 test/whois/answer/parser/whois.hkirc.hk_test.rb
  98. +2 −2 test/whois/answer/parser/whois.in.ua_test.rb
  99. +28 −9 test/whois/answer/parser/whois.isnic.is_test.rb
  100. +40 −12 test/whois/answer/parser/whois.jprs.jp_test.rb
  101. +1 −1 test/whois/answer/parser/whois.meregistry.net_test.rb
  102. +28 −9 test/whois/answer/parser/whois.museum_test.rb
  103. +2 −2 test/whois/answer/parser/whois.net.ua_test.rb
  104. +21 −7 test/whois/answer/parser/whois.nic-se.se_test.rb
  105. +18 −4 test/whois/answer/parser/whois.nic.ac_test.rb
  106. +18 −4 test/whois/answer/parser/whois.nic.ag_test.rb
  107. +20 −6 test/whois/answer/parser/whois.nic.am_test.rb
  108. +18 −4 test/whois/answer/parser/whois.nic.as_test.rb
  109. +20 −6 test/whois/answer/parser/whois.nic.asia_test.rb
  110. +28 −9 test/whois/answer/parser/whois.nic.at_test.rb
  111. +1 −1 test/whois/answer/parser/whois.nic.bo_test.rb
  112. +18 −4 test/whois/answer/parser/whois.nic.cc_test.rb
  113. +18 −4 test/whois/answer/parser/whois.nic.cd_test.rb
  114. +28 −9 test/whois/answer/parser/whois.nic.coop_test.rb
  115. +135 −40 test/whois/answer/parser/whois.nic.fr_test.rb
  116. +2 −2 test/whois/answer/parser/whois.nic.ht_test.rb
  117. +36 −12 test/whois/answer/parser/whois.nic.im_test.rb
  118. +27 −8 test/whois/answer/parser/whois.nic.io_test.rb
  119. +2 −2 test/whois/answer/parser/whois.nic.kz_test.rb
  120. +2 −2 test/whois/answer/parser/whois.nic.la_test.rb
  121. +27 −8 test/whois/answer/parser/whois.nic.ly_test.rb
  122. +54 −16 test/whois/answer/parser/whois.nic.mu_test.rb
  123. +1 −1 test/whois/answer/parser/whois.nic.mx_test.rb
  124. +28 −9 test/whois/answer/parser/whois.nic.nu_test.rb
  125. +2 −2 test/whois/answer/parser/whois.nic.org.uy_test.rb
  126. +18 −4 test/whois/answer/parser/whois.nic.st_test.rb
  127. +28 −9 test/whois/answer/parser/whois.nic.tel_test.rb
  128. +18 −4 test/whois/answer/parser/whois.nic.tl_test.rb
  129. +27 −8 test/whois/answer/parser/whois.nic.travel_test.rb
  130. +18 −4 test/whois/answer/parser/whois.nic.tv_test.rb
  131. +27 −8 test/whois/answer/parser/whois.nic.uk_test.rb
  132. +18 −4 test/whois/answer/parser/whois.nic.us_test.rb
  133. +2 −2 test/whois/answer/parser/whois.nic.ve_test.rb
  134. +27 −8 test/whois/answer/parser/whois.norid.no_test.rb
  135. +18 −4 test/whois/answer/parser/whois.publicinterestregistry.net_test.rb
  136. +27 −8 test/whois/answer/parser/whois.register.bg_test.rb
  137. +20 −6 test/whois/answer/parser/whois.registry.in_test.rb
  138. +29 −15 test/whois/answer/parser/whois.registrypro.pro_test.rb
  139. +135 −40 test/whois/answer/parser/whois.ripe.net_test.rb
  140. +36 −8 test/whois/answer/parser/whois.ripn.net_test.rb
  141. +20 −6 test/whois/answer/parser/whois.rotld.ro_test.rb
  142. +27 −8 test/whois/answer/parser/whois.samoanic.ws_test.rb
  143. +42 −12 test/whois/answer/parser/whois.srs.net.nz_test.rb
  144. +45 −16 test/whois/answer/parser/whois.za.net_test.rb
  145. +45 −16 test/whois/answer/parser/whois.za.org_test.rb
View
43 CHANGELOG.rdoc
@@ -2,11 +2,44 @@
== master
-* CHANGED: Standardized whois.aero #status property,
- it now returns symbols instead of strings.
-
-* CHANGED: Standardized whois.aeda.net.ae #status property,
- it now returns symbols instead of strings.
+* CHANGED: Standardized #status property for the following parsers (#5)
+ * whois.aero
+ * whois.aeda.net.ae
+ * whois.audns.net.au
+ * whois.cat
+ * whois.cctld.uz
+ * whois.co.ug
+ * whois.denic.de
+ * whois.dk-hostmaster.dk
+ * whois.dns.be
+ * whois.dns.lu
+ * whois.dns.pt
+ * whois.domainregistry.ie
+ * whois.in.ua
+ * whois.jprs.jp
+ * whois.net.ua
+ * whois.nic-se.se
+ * whois.nic.am
+ * whois.nic.asia
+ * whois.nic.at
+ * whois.nic.coop
+ * whois.nic.fr
+ * whois.nic.ht
+ * whois.nic.kz
+ * whois.nic.la
+ * whois.nic.mu
+ * whois.nic.nu
+ * whois.nic.org.uy
+ * whois.nic.travel
+ * whois.nic.uk
+ * whois.nic.ve
+ * whois.norid.no
+ * whois.register.bg
+ * whois.registry.in
+ * whois.rotld.ro
+ * whois.srs.net.nz
+
+* FIXED: Property cache is missing for some parsers (#18)
== Release 1.3.10
View
4 lib/whois/answer/parser/jobswhois.verisign-grs.com.rb
@@ -58,11 +58,11 @@ class JobswhoisVerisignGrsCom < Base
end
property_supported :available? do
- node("Registrar").nil?
+ @available ||= node("Registrar").nil?
end
property_supported :registered? do
- !available?
+ @registered ||= !available?
end
View
4 lib/whois/answer/parser/whois.afilias-grs.info.rb
@@ -39,11 +39,11 @@ class WhoisAfiliasGrsInfo < Base
end
property_supported :available? do
- @available ||= (content_for_scanner.strip == "NOT FOUND")
+ @available ||= (content_for_scanner.strip == "NOT FOUND")
end
property_supported :registered? do
- !available?
+ @registered ||= !available?
end
View
6 lib/whois/answer/parser/whois.afilias.info.rb
@@ -35,15 +35,15 @@ class Parser
class WhoisAfiliasInfo < Base
property_supported :status do
- @status ||= content_for_scanner.scan(/Status:(.*?)\n/).flatten
+ @status ||= content_for_scanner.scan(/Status:(.+?)\n/).flatten
end
property_supported :available? do
- @available ||= (content_for_scanner.strip == "NOT FOUND")
+ @available ||= (content_for_scanner.strip == "NOT FOUND")
end
property_supported :registered? do
- !available?
+ @registered ||= !available?
end
View
14 lib/whois/answer/parser/whois.audns.net.au.rb
@@ -35,17 +35,23 @@ class Parser
class WhoisAudnsNetAu < Base
property_supported :status do
- @status ||= if content_for_scanner =~ /Status:\s+(.*)\n/
- $1
+ @status ||= if content_for_scanner =~ /Status:\s+(.+?)\n/
+ case $1.downcase
+ when "ok" then :registered
+ else
+ Whois.bug!(ParserError, "Unknown status `#{$1}'.")
+ end
+ else
+ :available
end
end
property_supported :available? do
- @available ||= (content_for_scanner.strip == "No Data Found")
+ @available ||= (content_for_scanner.strip == "No Data Found")
end
property_supported :registered? do
- !available?
+ @registered ||= !available?
end
View
4 lib/whois/answer/parser/whois.biz.rb
@@ -39,11 +39,11 @@ class WhoisBiz < Base
end
property_supported :available? do
- @available ||= !!(content_for_scanner =~ /Not found:/)
+ @available ||= !!(content_for_scanner =~ /Not found:/)
end
property_supported :registered? do
- !available?
+ @registered ||= !available?
end
View
10 lib/whois/answer/parser/whois.cat.rb
@@ -35,8 +35,14 @@ class Parser
class WhoisCat < Base
property_supported :status do
- @status ||= if content_for_scanner =~ /Status:\s+(.*)\n/
- $1.downcase.to_sym
+ @status ||= if content_for_scanner =~ /Status:\s+(.+?)\n/
+ case $1.downcase
+ when "ok" then :registered
+ else
+ Whois.bug!(ParserError, "Unknown status `#{$1}'.")
+ end
+ else
+ :available
end
end
View
10 lib/whois/answer/parser/whois.cctld.uz.rb
@@ -35,8 +35,14 @@ class Parser
class WhoisCctldUz < Base
property_supported :status do
- @status ||= if content_for_scanner =~ /^Status: (.*)\n/
- $1
+ @status ||= if content_for_scanner =~ /^Status: (.+?)\n/
+ case $1.downcase
+ when "active" then :registered
+ else
+ Whois.bug!(ParserError, "Unknown status `#{$1}'.")
+ end
+ else
+ :available
end
end
View
4 lib/whois/answer/parser/whois.cnnic.cn.rb
@@ -39,11 +39,11 @@ class WhoisCnnicCn < Base
end
property_supported :available? do
- @available ||= (content_for_scanner.strip == "no matching record")
+ @available ||= (content_for_scanner.strip == "no matching record")
end
property_supported :registered? do
- !available?
+ @registered ||= !available?
end
View
10 lib/whois/answer/parser/whois.co.ug.rb
@@ -35,7 +35,15 @@ class Parser
class WhoisCoUg < Base
property_supported :status do
- @status ||= content_for_scanner[/^Status:\s+(.+)$/, 1]
+ @status ||= if content_for_scanner =~ /^Status:\s+(.+?)\n/
+ case $1.downcase
+ when "active" then :registered
+ else
+ Whois.bug!(ParserError, "Unknown status `#{$1}'.")
+ end
+ else
+ :available
+ end
end
property_supported :available? do
View
6 lib/whois/answer/parser/whois.crsnic.net.rb
@@ -55,15 +55,15 @@ class WhoisCrsnicNet < Base
property_supported :status do
- node("Status")
+ @status ||= node("Status")
end
property_supported :available? do
- node("Registrar").nil?
+ @available ||= node("Registrar").nil?
end
property_supported :registered? do
- !available?
+ @registered ||= !available?
end
View
16 lib/whois/answer/parser/whois.denic.de.rb
@@ -42,7 +42,21 @@ class WhoisDenicDe < Base
property_supported :status do
- @status ||= node("Status")
+ @status ||= if node("Status")
+ case node("Status")
+ when "connect" then :registered
+ when "free" then :available
+ when "invalid" then :invalid
+ else
+ Whois.bug!(ParserError, "Unknown status `#{$1}'.")
+ end
+ else
+ if version < "2.0"
+ :available
+ else
+ Whois.bug!(ParserError, "Unable to parse status.")
+ end
+ end
end
property_supported :available? do
View
14 lib/whois/answer/parser/whois.dk-hostmaster.dk.rb
@@ -35,17 +35,23 @@ class Parser
class WhoisDkHostmasterDk < Base
property_supported :status do
- @status ||= if content_for_scanner =~ /Status:\s+(.*)\n/
- $1.downcase.to_sym
+ @status ||= if content_for_scanner =~ /Status:\s+(.+?)\n/
+ case $1.downcase
+ when "active" then :registered
+ else
+ Whois.bug!(ParserError, "Unknown status `#{$1}'.")
+ end
+ else
+ :available
end
end
property_supported :available? do
- @available ||= !!(content_for_scanner =~ /No entries found for the selected source/)
+ @available ||= !!(content_for_scanner =~ /No entries found for the selected source/)
end
property_supported :registered? do
- !available?
+ @registered ||= !available?
end
View
13 lib/whois/answer/parser/whois.dns.be.rb
@@ -35,13 +35,20 @@ class Parser
class WhoisDnsBe < Base
property_supported :status do
- @status ||= if content_for_scanner =~ /Status:\s+(.+)\n/
- $1
+ @status ||= if content_for_scanner =~ /Status:\s+(.+?)\n/
+ case $1.downcase
+ when "registered" then :registered
+ when "free" then :available
+ else
+ Whois.bug!(ParserError, "Unknown status `#{$1}'.")
+ end
+ else
+ Whois.bug!(ParserError, "Unable to parse status.")
end
end
property_supported :available? do
- @available ||= (status == "FREE")
+ @available ||= (status == :available)
end
property_supported :registered? do
View
10 lib/whois/answer/parser/whois.dns.lu.rb
@@ -35,8 +35,14 @@ class Parser
class WhoisDnsLu < Base
property_supported :status do
- @status ||= if content_for_scanner =~ /domaintype:\s+(.*)\n/
- $1
+ @status ||= if content_for_scanner =~ /domaintype:\s+(.+)\n/
+ case $1.downcase
+ when "active" then :registered
+ else
+ Whois.bug!(ParserError, "Unknown status `#{$1}'.")
+ end
+ else
+ :available
end
end
View
10 lib/whois/answer/parser/whois.dns.pt.rb
@@ -35,8 +35,14 @@ class Parser
class WhoisDnsPt < Base
property_supported :status do
- @status ||= if content_for_scanner =~ / Status:\s+(.*)\n/
- $1
+ @status ||= if content_for_scanner =~ / Status:\s+(.+)\n/
+ case $1.downcase
+ when "active" then :registered
+ else
+ Whois.bug!(ParserError, "Unknown status `#{$1}'.")
+ end
+ else
+ :available
end
end
View
8 lib/whois/answer/parser/whois.domainregistry.ie.rb
@@ -35,8 +35,12 @@ class Parser
class WhoisDomainregistryIe < Base
property_supported :status do
- @status ||= if content_for_scanner =~ /status:\s+(.*)\n/
- $1.downcase.to_sym
+ @status ||= if content_for_scanner =~ /status:\s+(.+)\n/
+ case $1.downcase
+ when "active" then :registered
+ else
+ Whois.bug!(ParserError, "Unknown status `#{$1}'.")
+ end
else
:available
end
View
4 lib/whois/answer/parser/whois.dot.tk.rb
@@ -43,11 +43,11 @@ class WhoisDotTk < Base
end
property_supported :available? do
- @available ||= !!(content_for_scanner =~ /domain name not known/)
+ @available ||= !!(content_for_scanner =~ /domain name not known/)
end
property_supported :registered? do
- !available?
+ @registered ||= !available?
end
View
4 lib/whois/answer/parser/whois.dotmobiregistry.net.rb
@@ -39,11 +39,11 @@ class WhoisDotmobiregistryNet < Base
end
property_supported :available? do
- @available ||= (content_for_scanner =~ /Not found:/)
+ @available ||= !!(content_for_scanner =~ /Not found:/)
end
property_supported :registered? do
- !available?
+ @registered ||= !available?
end
View
6 lib/whois/answer/parser/whois.educause.edu.rb
@@ -35,19 +35,19 @@ class Parser
class WhoisEducauseEdu < Base
property_supported :status do
- if available?
+ @status ||= if available?
:available
else
:registered
end
end
property_supported :available? do
- @available ||= !!(content_for_scanner =~ /No Match/)
+ @available ||= !!(content_for_scanner =~ /No Match/)
end
property_supported :registered? do
- !available?
+ @registered ||= !available?
end
View
6 lib/whois/answer/parser/whois.eu.org.rb
@@ -35,19 +35,19 @@ class Parser
class WhoisEuOrg < Base
property_supported :status do
- if available?
+ @status ||= if available?
:available
else
:registered
end
end
property_supported :available? do
- @available ||= !!(content_for_scanner =~ /Key not found/)
+ @available ||= !!(content_for_scanner =~ /Key not found/)
end
property_supported :registered? do
- !available?
+ @registered ||= !available?
end
View
6 lib/whois/answer/parser/whois.eu.rb
@@ -35,19 +35,19 @@ class Parser
class WhoisEu < Base
property_supported :status do
- if available?
+ @status ||= if available?
:available
else
:registered
end
end
property_supported :available? do
- @available ||= !!(content_for_scanner =~ /Status:\s+AVAILABLE/)
+ @available ||= !!(content_for_scanner =~ /Status:\s+AVAILABLE/)
end
property_supported :registered? do
- !available?
+ @registered ||= !available?
end
View
4 lib/whois/answer/parser/whois.ficora.fi.rb
@@ -35,9 +35,9 @@ class Parser
class WhoisFicoraFi < Base
property_supported :status do
- @status ||= if content_for_scanner =~ /status:\s+(.*?)\n/
+ @status ||= if content_for_scanner =~ /status:\s+(.+?)\n/
case $1.downcase
- when "granted" then :registered
+ when "granted" then :registered
else
Whois.bug!(ParserError, "Unknown status `#{$1}'.")
end
View
4 lib/whois/answer/parser/whois.gg.rb
@@ -37,8 +37,8 @@ class WhoisGg < Base
property_supported :status do
@status ||= if content_for_scanner =~ /status:(.+?)\n/
case $1.downcase
- when "0" then :available
- when "1" then :registered
+ when "0" then :available
+ when "1" then :registered
else
Whois.bug!(ParserError, "Unknown status `#{$1}'.")
end
View
4 lib/whois/answer/parser/whois.hkirc.hk.rb
@@ -43,11 +43,11 @@ class WhoisHkircHk < Base
end
property_supported :available? do
- @available ||= (content_for_scanner.strip == "Domain Not Found")
+ @available ||= (content_for_scanner.strip == "Domain Not Found")
end
property_supported :registered? do
- !available?
+ @registered ||= !available?
end
View
10 lib/whois/answer/parser/whois.in.ua.rb
@@ -35,8 +35,14 @@ class Parser
class WhoisInUa < Base
property_supported :status do
- @status ||= if content_for_scanner =~ /status:\s+(.*)\n/
- $1.split("-").first
+ @status ||= if content_for_scanner =~ /status:\s+(.+?)\n/
+ case $1.split("-").first.downcase
+ when "ok" then :registered
+ else
+ Whois.bug!(ParserError, "Unknown status `#{$1}'.")
+ end
+ else
+ :available
end
end
View
6 lib/whois/answer/parser/whois.isnic.is.rb
@@ -35,19 +35,19 @@ class Parser
class WhoisIsnicIs < Base
property_supported :status do
- if available?
+ @status ||= if available?
:available
else
:registered
end
end
property_supported :available? do
- @available ||= !!(content_for_scanner =~ /No entries found for query/)
+ @available ||= !!(content_for_scanner =~ /No entries found for query/)
end
property_supported :registered? do
- !available?
+ @registered ||= !available?
end
View
4 lib/whois/answer/parser/whois.je.rb
@@ -37,8 +37,8 @@ class WhoisJe < Base
property_supported :status do
@status ||= if content_for_scanner =~ /status:(.+?)\n/
case $1.downcase
- when "0" then :available
- when "1" then :registered
+ when "0" then :available
+ when "1" then :registered
else
Whois.bug!(ParserError, "Unknown status `#{$1}'.")
end
View
13 lib/whois/answer/parser/whois.jprs.jp.rb
@@ -36,16 +36,23 @@ class WhoisJprsJp < Base
property_supported :status do
@status ||= if content_for_scanner =~ /\[Stat(?:us|e)\]\s+(.*)\n/
- $1
+ case $1.split(" ").first.downcase
+ when "active" then :registered
+ when "connected" then :registered
+ else
+ Whois.bug!(ParserError, "Unknown status `#{$1}'.")
+ end
+ else
+ :available
end
end
property_supported :available? do
- @available ||= !!(content_for_scanner =~ /No match!!/)
+ @available ||= !!(content_for_scanner =~ /No match!!/)
end
property_supported :registered? do
- !available?
+ @registered ||= !available?
end
View
4 lib/whois/answer/parser/whois.museum.rb
@@ -43,11 +43,11 @@ class WhoisMuseum < Base
end
property_supported :available? do
- @available ||= (content_for_scanner =~ /NOT FOUND/)
+ @available ||= !!(content_for_scanner =~ /NOT FOUND/)
end
property_supported :registered? do
- !available?
+ @registered ||= !available?
end
View
10 lib/whois/answer/parser/whois.net.ua.rb
@@ -35,8 +35,14 @@ class Parser
class WhoisNetUa < Base
property_supported :status do
- @status ||= if content_for_scanner =~ /status:\s+(.*)\n/
- $1.split("-").first
+ @status ||= if content_for_scanner =~ /status:\s+(.+?)\n/
+ case $1.downcase
+ when /^ok-until/ then :registered
+ else
+ Whois.bug!(ParserError, "Unknown status `#{$1}'.")
+ end
+ else
+ :available
end
end
View
16 lib/whois/answer/parser/whois.nic-se.se.rb
@@ -35,17 +35,23 @@ class Parser
class WhoisNicSeSe < Base
property_supported :status do
- @status ||= if content_for_scanner =~ /state:\s+(.*)\n/
- $1.downcase.to_sym
+ @status ||= if content_for_scanner =~ /state:\s+(.+?)\n/
+ case $1.downcase
+ when "active" then :registered
+ else
+ Whois.bug!(ParserError, "Unknown status `#{$1}'.")
+ end
+ else
+ :available
end
end
property_supported :available? do
- @available ||= !!(content_for_scanner =~ /" not found./)
+ @available ||= !!(content_for_scanner =~ /" not found./)
end
property_supported :registered? do
- !available?
+ @registered ||= !available?
end
@@ -82,4 +88,4 @@ class WhoisNicSeSe < Base
end
end
-end
+end
View
4 lib/whois/answer/parser/whois.nic.ac.rb
@@ -49,11 +49,11 @@ class WhoisNicAc < Base
end
property_supported :available? do
- @available ||= !(content_for_scanner =~ /Not available/)
+ @available ||= !(content_for_scanner =~ /Not available/)
end
property_supported :registered? do
- !available?
+ @registered ||= !available?
end
View
4 lib/whois/answer/parser/whois.nic.ag.rb
@@ -39,11 +39,11 @@ class WhoisNicAg < Base
end
property_supported :available? do
- @available ||= (content_for_scanner.strip == "NOT FOUND")
+ @available ||= (content_for_scanner.strip == "NOT FOUND")
end
property_supported :registered? do
- !available?
+ @registered ||= !available?
end
View
14 lib/whois/answer/parser/whois.nic.am.rb
@@ -35,17 +35,23 @@ class Parser
class WhoisNicAm < Base
property_supported :status do
- @status ||= if content_for_scanner =~ /\s+Status:\s+(.*)\n/
- $1
+ @status ||= if content_for_scanner =~ /\s+Status:\s+(.+)\n/
+ case $1.downcase
+ when "active" then :registered
+ else
+ Whois.bug!(ParserError, "Unknown status `#{$1}'.")
+ end
+ else
+ :available
end
end
property_supported :available? do
- @available ||= !!(content_for_scanner =~ /No match/)
+ @available ||= !!(content_for_scanner =~ /No match/)
end
property_supported :registered? do
- !available?
+ @registered ||= !available?
end
View
4 lib/whois/answer/parser/whois.nic.as.rb
@@ -43,11 +43,11 @@ class WhoisNicAs < Base
end
property_supported :available? do
- @available ||= !!(content_for_scanner =~ /Domain Not Found/)
+ @available ||= !!(content_for_scanner =~ /Domain Not Found/)
end
property_supported :registered? do
- !available?
+ @registered ||= !available?
end
View
14 lib/whois/answer/parser/whois.nic.asia.rb
@@ -35,17 +35,23 @@ class Parser
class WhoisNicAsia < Base
property_supported :status do
- @status ||= if content_for_scanner =~ /Domain Status:(.*?)\n/
- $1
+ @status ||= if content_for_scanner =~ /Domain Status:(.+?)\n/
+ case $1.downcase
+ when "ok" then :registered
+ else
+ Whois.bug!(ParserError, "Unknown status `#{$1}'.")
+ end
+ else
+ :available
end
end
property_supported :available? do
- @available ||= (content_for_scanner.strip == "NOT FOUND")
+ @available ||= (content_for_scanner.strip == "NOT FOUND")
end
property_supported :registered? do
- !available?
+ @registered ||= !available?
end
View
4 lib/whois/answer/parser/whois.nic.at.rb
@@ -43,11 +43,11 @@ class WhoisNicAt < Base
end
property_supported :available? do
- @available ||= !!(content_for_scanner =~ /% nothing found/)
+ @available ||= !!(content_for_scanner =~ /% nothing found/)
end
property_supported :registered? do
- !available?
+ @registered ||= !available?
end
View
8 lib/whois/answer/parser/whois.nic.cc.rb
@@ -52,15 +52,15 @@ class WhoisNicCc < Base
property_supported :status do
- node("Status")
+ @status ||= node("Status")
end
property_supported :available? do
- node("Registrar").nil?
+ @available ||= node("Registrar").nil?
end
property_supported :registered? do
- !available?
+ @registered ||= !available?
end
@@ -100,4 +100,4 @@ def parse
end
end
-end
+end
View
6 lib/whois/answer/parser/whois.nic.cd.rb
@@ -35,15 +35,15 @@ class Parser
class WhoisNicCd < Base
property_supported :status do
- content_for_scanner.scan(/\s+Domain Status:\s+(.*?)\n/).flatten
+ content_for_scanner.scan(/\s+Domain Status:\s+(.+?)\n/).flatten
end
property_supported :available? do
- @available ||= !!(content_for_scanner.strip == "Domain Not Found")
+ @available ||= !!(content_for_scanner.strip == "Domain Not Found")
end
property_supported :registered? do
- !available?
+ @registered ||= !available?
end
View
14 lib/whois/answer/parser/whois.nic.coop.rb
@@ -35,17 +35,23 @@ class Parser
class WhoisNicCoop < Base
property_supported :status do
- @status ||= if content_for_scanner =~ /Status:\s+(.*)\n/
- $1.downcase.to_sym
+ @status ||= if content_for_scanner =~ /Status:\s+(.+?)\n/
+ case $1.downcase
+ when "ok" then :registered
+ else
+ Whois.bug!(ParserError, "Unknown status `#{$1}'.")
+ end
+ else
+ :available
end
end
property_supported :available? do
- @available ||= !!(content_for_scanner =~ /No domain records were found to match/)
+ @available ||= !!(content_for_scanner =~ /No domain records were found to match/)
end
property_supported :registered? do
- !available?
+ @registered ||= !available?
end
View
4 lib/whois/answer/parser/whois.nic.dz.rb
@@ -35,9 +35,9 @@ class Parser
class WhoisNicDz < Base
property_supported :status do
- @status ||= if content_for_scanner =~ /ETAT:\.+(.*?)\n/
+ @status ||= if content_for_scanner =~ /ETAT:\.+(.+?)\n/
case $1.downcase
- when "actif" then :registered
+ when "actif" then :registered
else
Whois.bug!(ParserError, "Unknown status `#{$1}'.")
end
View
12 lib/whois/answer/parser/whois.nic.fr.rb
@@ -35,19 +35,23 @@ class Parser
class WhoisNicFr < Base
property_supported :status do
- @status ||= if content_for_scanner =~ /status:\s+(.*)\n/
- $1.downcase.to_sym
+ @status ||= if content_for_scanner =~ /status:\s+(.+)\n/
+ case $1.downcase
+ when "active" then :registered
+ else
+ Whois.bug!(ParserError, "Unknown status `#{$1}'.")
+ end
else
:available
end
end
property_supported :available? do
- @available ||= !!(content_for_scanner =~ /No entries found in the AFNIC Database/)
+ @available ||= !!(content_for_scanner =~ /No entries found in the AFNIC Database/)
end
property_supported :registered? do
- !available?
+ @registered ||= !available?
end
View
2 lib/whois/answer/parser/whois.nic.gs.rb
@@ -35,7 +35,7 @@ class Parser
class WhoisNicGs < Base
property_supported :status do
- @status ||= if content_for_scanner =~ /Status:\s+(.*?)\n/
+ @status ||= if content_for_scanner =~ /Status:\s+(.+?)\n/
case $1.downcase
when "active" then :registered
when "not registered" then :available
View
13 lib/whois/answer/parser/whois.nic.ht.rb
@@ -35,13 +35,20 @@ class Parser
class WhoisNicHt < Base
property_supported :status do
- @status ||= if content_for_scanner =~ /Status:\s+(.*)\n/
- $1
+ @status ||= if content_for_scanner =~ /Status:\s+(.+?)\n/
+ case $1.downcase
+ when "active" then :registered
+ when "not registered" then :available
+ else
+ Whois.bug!(ParserError, "Unknown status `#{$1}'.")
+ end
+ else
+ Whois.bug!(ParserError, "Unable to parse status.")
end
end
property_supported :available? do
- @available ||= (status == "Not Registered")
+ @available ||= (status == :available)
end
property_supported :registered? do
View
4 lib/whois/answer/parser/whois.nic.im.rb
@@ -43,11 +43,11 @@ class WhoisNicIm < Base
end
property_supported :available? do
- @available ||= !!(content_for_scanner =~ /was not found/)
+ @available ||= !!(content_for_scanner =~ /was not found/)
end
property_supported :registered? do
- !available?
+ @registered ||= !available?
end
View
4 lib/whois/answer/parser/whois.nic.io.rb
@@ -43,11 +43,11 @@ class WhoisNicIo < Base
end
property_supported :available? do
- @available ||= !!(content_for_scanner =~ /- Available/)
+ @available ||= !!(content_for_scanner =~ /- Available/)
end
property_supported :registered? do
- !available?
+ @registered ||= !available?
end
View
8 lib/whois/answer/parser/whois.nic.kz.rb
@@ -36,7 +36,13 @@ class WhoisNicKz < Base
property_supported :status do
@status ||= if content_for_scanner =~ /Domain status : (.*)\n/
- $1.strip
+ case $1.strip.downcase
+ when /^ok/ then :registered
+ else
+ Whois.bug!(ParserError, "Unknown status `#{$1}'.")
+ end
+ else
+ :available
end
end
View
10 lib/whois/answer/parser/whois.nic.la.rb
@@ -35,8 +35,14 @@ class Parser
class WhoisNicLa < Base
property_supported :status do
- @status ||= if content_for_scanner =~ /Status:(.*)\n/
- $1
+ @status ||= if content_for_scanner =~ /Status:(.+?)\n/
+ case $1.downcase
+ when "ok" then :registered
+ else
+ Whois.bug!(ParserError, "Unknown status `#{$1}'.")
+ end
+ else
+ :available
end
end
View
6 lib/whois/answer/parser/whois.nic.ly.rb
@@ -35,19 +35,19 @@ class Parser
class WhoisNicLy < Base
property_supported :status do
- if available?
+ @status ||= if available?
:available
else
:registered
end
end
property_supported :available? do
- @available ||= (content_for_scanner.strip == "Not found")
+ @available ||= (content_for_scanner.strip == "Not found")
end
property_supported :registered? do
- !available?
+ @registered ||= !available?
end
View
14 lib/whois/answer/parser/whois.nic.mu.rb
@@ -35,20 +35,22 @@ class Parser
class WhoisNicMu < Base
property_supported :status do
- @status ||= if content_for_scanner =~ /Status:\s+(.*?)\n/
- case $1.downcase.to_sym
- when :"active" then :registered
- when :"not registered" then :available
+ @status ||= if content_for_scanner =~ /Status:\s+(.+?)\n/
+ case $1.downcase
+ when "active" then :registered
+ when "not registered" then :available
end
+ else
+ Whois.bug!(ParserError, "Unable to parse status.")
end
end
property_supported :available? do
- @available ||= (status == :available)
+ @available ||= (status == :available)
end
property_supported :registered? do
- !available?
+ @registered ||= !available?
end
View
12 lib/whois/answer/parser/whois.nic.nu.rb
@@ -36,16 +36,22 @@ class WhoisNicNu < Base
property_supported :status do
@status ||= if content_for_scanner =~ /Record status:\s+(.*)\n/
- $1.downcase.to_sym
+ case $1.downcase
+ when "active" then :registered
+ else
+ Whois.bug!(ParserError, "Unknown status `#{$1}'.")
+ end
+ else
+ :available
end
end
property_supported :available? do
- @available ||= !!(content_for_scanner =~ /NO MATCH for domain/)
+ @available ||= !!(content_for_scanner =~ /NO MATCH for domain/)
end
property_supported :registered? do
- !available?
+ @registered ||= !available?
end
View
10 lib/whois/answer/parser/whois.nic.org.uy.rb
@@ -35,8 +35,14 @@ class Parser
class WhoisNicOrgUy < Base
property_supported :status do
- @status ||= if content_for_scanner =~ /Estatus del dominio: (.*?)\n/
- $1
+ @status ||= if content_for_scanner =~ /Estatus del dominio: (.+?)\n/
+ case $1.downcase
+ when "activo" then :registered
+ else
+ Whois.bug!(ParserError, "Unknown status `#{$1}'.")
+ end
+ else
+ :available
end
end
View
1 lib/whois/answer/parser/whois.nic.sn.rb
@@ -46,7 +46,6 @@ class WhoisNicSn < Base
property_not_supported :referral_url
-
property_supported :status do
@status ||= if available?
:available
View
4 lib/whois/answer/parser/whois.nic.st.rb
@@ -43,11 +43,11 @@ class WhoisNicSt < Base
end
property_supported :available? do
- @available ||= !!(content_for_scanner =~ /No entries found for domain/)
+ @available ||= !!(content_for_scanner =~ /No entries found for domain/)
end
property_supported :registered? do
- !available?
+ @registered ||= !available?
end
View
4 lib/whois/answer/parser/whois.nic.tel.rb
@@ -43,11 +43,11 @@ class WhoisNicTel < Base
end
property_supported :available? do
- @available ||= !!(content_for_scanner =~ /Not found:/)
+ @available ||= !!(content_for_scanner =~ /Not found:/)
end
property_supported :registered? do
- !available?
+ @registered ||= !available?
end
View
4 lib/whois/answer/parser/whois.nic.tl.rb
@@ -43,11 +43,11 @@ class WhoisNicTl < Base
end
property_supported :available? do
- @available ||= !!(content_for_scanner =~ /Status: Not Registered/)
+ @available ||= !!(content_for_scanner =~ /Status: Not Registered/)
end
property_supported :registered? do
- !available?
+ @registered ||= !available?
end
View
14 lib/whois/answer/parser/whois.nic.travel.rb
@@ -35,15 +35,23 @@ class Parser
class WhoisNicTravel < Base
property_supported :status do
- @status ||= content_for_scanner.scan(/Domain Status:\s+(.*?)\n/).flatten
+ @status ||= if content_for_scanner =~ /Domain Status:\s+(.+?)\n/
+ case $1.downcase
+ when "ok" then :registered
+ else
+ Whois.bug!(ParserError, "Unknown status `#{$1}'.")
+ end
+ else
+ :available
+ end
end
property_supported :available? do
- @available ||= !!(content_for_scanner =~ /Not found:/)
+ @available ||= !!(content_for_scanner =~ /Not found:/)
end
property_supported :registered? do
- !available?
+ @registered ||= !available?
end
View
4 lib/whois/answer/parser/whois.nic.tv.rb
@@ -57,11 +57,11 @@ class WhoisNicTv < Base
end
property_supported :available? do
- node("Registrar").nil?
+ @available ||= node("Registrar").nil?
end
property_supported :registered? do
- !available?
+ @registered ||= !available?
end
View
14 lib/whois/answer/parser/whois.nic.uk.rb
@@ -35,17 +35,23 @@ class Parser
class WhoisNicUk < Base
property_supported :status do
- @status ||= if content_for_scanner =~ /\s+Registration status:\s+(.*?)\n/
- $1.strip
+ @status ||= if content_for_scanner =~ /\s+Registration status:\s+(.+?)\n/
+ case $1.downcase
+ when "registered until renewal date." then :registered
+ else
+ Whois.bug!(ParserError, "Unknown status `#{$1}'.")
+ end
+ else
+ :available
end
end
property_supported :available? do
- @available ||= !!(content_for_scanner =~ /This domain name has not been registered/)
+ @available ||= !!(content_for_scanner =~ /This domain name has not been registered/)
end
property_supported :registered? do
- !available?
+ @registered ||= !available?
end
View
4 lib/whois/answer/parser/whois.nic.us.rb
@@ -39,11 +39,11 @@ class WhoisNicUs < Base
end
property_supported :available? do
- @available ||= !!(content_for_scanner =~ /Not found:/)
+ @available ||= !!(content_for_scanner =~ /Not found:/)
end
property_supported :registered? do
- !available?
+ @registered ||= !available?
end
View
10 lib/whois/answer/parser/whois.nic.ve.rb
@@ -35,8 +35,14 @@ class Parser
class WhoisNicVe < Base
property_supported :status do
- @status ||= if content_for_scanner =~ /Estatus del dominio: (.*?)\n/
- $1
+ @status ||= if content_for_scanner =~ /Estatus del dominio: (.+?)\n/
+ case $1.downcase
+ when "activo" then :registered
+ else
+ Whois.bug!(ParserError, "Unknown status `#{$1}'.")
+ end
+ else
+ :available
end
end
View
6 lib/whois/answer/parser/whois.norid.no.rb
@@ -35,19 +35,19 @@ class Parser
class WhoisNoridNo < Base
property_supported :status do
- if available?
+ @status ||= if available?
:available
else
:registered
end
end
property_supported :available? do
- @available ||= !!(content_for_scanner =~ /% no matches/)
+ @available ||= !!(content_for_scanner =~ /% no matches/)
end
property_supported :registered? do
- !available?
+ @registered ||= !available?
end
View
4 lib/whois/answer/parser/whois.publicinterestregistry.net.rb
@@ -48,11 +48,11 @@ class WhoisPublicinterestregistryNet < Base
end
property_supported :available? do
- node("Domain ID").nil?
+ @available ||= node("Domain ID").nil?
end
property_supported :registered? do
- !available?
+ @registered ||= !available?
end
View
14 lib/whois/answer/parser/whois.register.bg.rb
@@ -35,17 +35,23 @@ class Parser
class WhoisRegisterBg < Base
property_supported :status do
- @status ||= if content_for_scanner =~ /registration status:\s+(.*?)\n/
- $1.downcase.to_sym
+ @status ||= if content_for_scanner =~ /registration status:\s+(.+?)\n/
+ case $1.downcase
+ when "registered" then :registered
+ else
+ Whois.bug!(ParserError, "Unknown status `#{$1}'.")
+ end
+ else
+ :available
end
end
property_supported :available? do
- @available ||= (content_for_scanner =~ /Domain name (.+?) does not exist/)
+ @available ||= !!(content_for_scanner =~ /Domain name (.+?) does not exist/)
end
property_supported :registered? do
- !available?
+ @registered ||= !available?
end
View
14 lib/whois/answer/parser/whois.registry.in.rb
@@ -35,15 +35,23 @@ class Parser
class WhoisRegistryIn < Base
property_supported :status do
- @status ||= content_for_scanner.scan(/Status:(.*?)\n/).flatten
+ @status ||= if content_for_scanner =~ /Status:(.+?)\n/
+ case $1.downcase
+ when "ok" then :registered
+ else
+ Whois.bug!(ParserError, "Unknown status `#{$1}'.")
+ end
+ else
+ :available
+ end
end
property_supported :available? do
- @available ||= (content_for_scanner.strip == "NOT FOUND")
+ @available ||= (content_for_scanner.strip == "NOT FOUND")
end
property_supported :registered? do
- !available?
+ @registered ||= !available?
end
View
4 lib/whois/answer/parser/whois.registrypro.pro.rb
@@ -39,11 +39,11 @@ class WhoisRegistryproPro < Base
end
property_supported :available? do
- @available ||= !!(content_for_scanner =~ /No match/)
+ @available ||= !!(content_for_scanner =~ /No match/)
end
property_supported :registered? do
- !available?
+ @registered ||= !available?
end
View
4 lib/whois/answer/parser/whois.ripe.net.rb
@@ -35,7 +35,7 @@ class Parser
class WhoisRipeNet < Base
property_supported :status do
- if available?
+ @status ||= if available?
:available
else
:registered
@@ -47,7 +47,7 @@ class WhoisRipeNet < Base
end
property_supported :registered? do
- !available?
+ @registered ||= !available?
end
View
6 lib/whois/answer/parser/whois.ripn.net.rb
@@ -35,19 +35,19 @@ class Parser
class WhoisRipnNet < Base
property_supported :status do
- @status ||= if content_for_scanner =~ /state:\s+(.*?)\n/
+ @status ||= if content_for_scanner =~ /state:\s+(.+?)\n/
$1.split(",").map(&:strip)
else
[]
end
end
property_supported :available? do
- @available ||= !!(content_for_scanner =~ /No entries found/)
+ @available ||= !!(content_for_scanner =~ /No entries found/)
end
property_supported :registered? do
- !available?
+ @registered ||= !available?
end
View
14 lib/whois/answer/parser/whois.rotld.ro.rb
@@ -35,17 +35,23 @@ class Parser
class WhoisRotldRo < Base
property_supported :status do
- @status ||= if content_for_scanner =~ /Domain Status:\s(.*?)\n/
- $1
+ @status ||= if content_for_scanner =~ /Domain Status:\s(.+?)\n/
+ case $1.downcase
+ when "ok" then :registered
+ else
+ Whois.bug!(ParserError, "Unknown status `#{$1}'.")
+ end
+ else
+ :available
end
end
property_supported :available? do
- @available ||= !!(content_for_scanner =~ /No entries found/)
+ @available ||= !!(content_for_scanner =~ /No entries found/)
end
property_supported :registered? do
- !available?
+ @registered ||= !available?
end
View
4 lib/whois/answer/parser/whois.samoanic.ws.rb
@@ -43,11 +43,11 @@ class WhoisSamoanicWs < Base
end
property_supported :available? do
- @available ||= !!(content_for_scanner =~ /No match for/)
+ @available ||= !!(content_for_scanner =~ /No match for/)
end
property_supported :registered? do
- !available?
+ @registered ||= !available?
end
View
19 lib/whois/answer/parser/whois.srs.net.nz.rb
@@ -35,18 +35,25 @@ class Parser
class WhoisSrsNetNz < Base
property_supported :status do
- @status ||= Proc.new do
- content_for_scanner =~ /query_status:\s(.+)\n/
- $1.split(" ", 2).last
- end.call
+ @status ||= if content_for_scanner =~ /query_status:\s(.+)\n/
+ case $1.downcase
+ when /active/ then :registered
+ when /available/ then :available
+ when /invalid characters/ then :invalid
+ else
+ Whois.bug!(ParserError, "Unknown status `#{$1}'.")
+ end
+ else
+ Whois.bug!(ParserError, "Unable to parse status.")
+ end
end
property_supported :available? do
- @available ||= (status == "Available")
+ @available ||= (status == :available)
end
property_supported :registered? do
- @registered ||= (status == "Active")
+ @registered ||= (status == :registered)
end
View
4 lib/whois/answer/parser/whois.usp.ac.fj.rb
@@ -35,9 +35,9 @@ class Parser
class WhoisUspAcFj < Base
property_supported :status do
- @status ||= if content_for_scanner =~ /Status:\s+(.*?)\n/
+ @status ||= if content_for_scanner =~ /Status:\s+(.+?)\n/
case $1.downcase
- when "active" then :registered
+ when "active" then :registered
else
Whois.bug!(ParserError, "Unknown status `#{$1}'.")
end
View
6 lib/whois/answer/parser/whois.za.net.rb
@@ -35,19 +35,19 @@ class Parser
class WhoisZaNet < Base
property_supported :status do