whois 0.9.0 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (262) hide show
  1. data/CHANGELOG.rdoc +161 -21
  2. data/LICENSE.rdoc +1 -1
  3. data/Manifest +184 -13
  4. data/README.rdoc +24 -31
  5. data/Rakefile +7 -7
  6. data/bin/ruby-whois +9 -3
  7. data/data/ip_del_list +2 -0
  8. data/data/make_servers_charset.pl +21 -0
  9. data/data/make_tld_serv.pl +8 -7
  10. data/data/servers_charset_list +37 -0
  11. data/data/tld_serv_list +32 -30
  12. data/lib/whois.rb +0 -1
  13. data/lib/whois/answer.rb +24 -13
  14. data/lib/whois/answer/parser.rb +27 -16
  15. data/lib/whois/answer/parser/NOTES.txt +3 -0
  16. data/lib/whois/answer/parser/base.rb +140 -101
  17. data/lib/whois/answer/parser/jobswhois.verisign-grs.com.rb +99 -0
  18. data/lib/whois/answer/parser/whois.adamsnames.tc.rb +64 -0
  19. data/lib/whois/answer/parser/whois.aeda.net.ae.rb +65 -0
  20. data/lib/whois/answer/parser/whois.aero.rb +6 -6
  21. data/lib/whois/answer/parser/whois.afilias-grs.info.rb +6 -6
  22. data/lib/whois/answer/parser/whois.afilias.info.rb +12 -12
  23. data/lib/whois/answer/parser/whois.biz.rb +72 -0
  24. data/lib/whois/answer/parser/whois.cat.rb +74 -0
  25. data/lib/whois/answer/parser/whois.cira.ca.rb +77 -0
  26. data/lib/whois/answer/parser/whois.crsnic.net.rb +16 -13
  27. data/lib/whois/answer/parser/whois.denic.de.rb +14 -18
  28. data/lib/whois/answer/parser/whois.dk-hostmaster.dk.rb +75 -0
  29. data/lib/whois/answer/parser/whois.domain-registry.nl.rb +72 -0
  30. data/lib/whois/answer/parser/whois.domainregistry.ie.rb +7 -13
  31. data/lib/whois/answer/parser/whois.dotmobiregistry.net.rb +72 -0
  32. data/lib/whois/answer/parser/whois.educause.edu.rb +8 -8
  33. data/lib/whois/answer/parser/whois.eu.org.rb +8 -17
  34. data/lib/whois/answer/parser/whois.eu.rb +64 -0
  35. data/lib/whois/answer/parser/whois.iana.org.rb +6 -9
  36. data/lib/whois/answer/parser/whois.isnic.is.rb +72 -0
  37. data/lib/whois/answer/parser/whois.meregistry.net.rb +72 -0
  38. data/lib/whois/answer/parser/whois.museum.rb +76 -0
  39. data/lib/whois/answer/parser/whois.nic-se.se.rb +77 -0
  40. data/lib/whois/answer/parser/whois.nic.ac.rb +92 -0
  41. data/lib/whois/answer/parser/whois.nic.asia.rb +12 -12
  42. data/lib/whois/answer/parser/whois.nic.cc.rb +99 -0
  43. data/lib/whois/answer/parser/whois.nic.cd.rb +68 -0
  44. data/lib/whois/answer/parser/whois.nic.ch.rb +64 -0
  45. data/lib/whois/answer/parser/whois.nic.coop.rb +74 -0
  46. data/lib/whois/answer/parser/whois.nic.fr.rb +8 -11
  47. data/lib/whois/answer/parser/whois.nic.gl.rb +77 -0
  48. data/lib/whois/answer/parser/whois.nic.gov.rb +8 -17
  49. data/lib/whois/answer/parser/whois.nic.hu.rb +21 -19
  50. data/lib/whois/answer/parser/whois.nic.im.rb +68 -0
  51. data/lib/whois/answer/parser/whois.nic.io.rb +64 -0
  52. data/lib/whois/answer/parser/whois.nic.it.rb +16 -16
  53. data/lib/whois/answer/parser/whois.nic.ly.rb +76 -0
  54. data/lib/whois/answer/parser/whois.nic.mu.rb +77 -0
  55. data/lib/whois/answer/parser/whois.nic.name.rb +8 -17
  56. data/lib/whois/answer/parser/whois.nic.nu.rb +84 -0
  57. data/lib/whois/answer/parser/whois.nic.tel.rb +76 -0
  58. data/lib/whois/answer/parser/whois.nic.tl.rb +76 -0
  59. data/lib/whois/answer/parser/whois.nic.travel.rb +72 -0
  60. data/lib/whois/answer/parser/whois.nic.tv.rb +16 -13
  61. data/lib/whois/answer/parser/whois.nic.uk.rb +82 -0
  62. data/lib/whois/answer/parser/whois.nic.us.rb +72 -0
  63. data/lib/whois/answer/parser/whois.norid.no.rb +72 -0
  64. data/lib/whois/answer/parser/whois.publicinterestregistry.net.rb +16 -16
  65. data/lib/whois/answer/parser/whois.register.bg.rb +74 -0
  66. data/lib/whois/answer/parser/whois.registro.br.rb +64 -0
  67. data/lib/whois/answer/parser/whois.registrypro.pro.rb +77 -0
  68. data/lib/whois/answer/parser/whois.ripe.net.rb +64 -0
  69. data/lib/whois/answer/parser/whois.ripn.net.rb +72 -0
  70. data/lib/whois/answer/parser/whois.rotld.ro.rb +64 -0
  71. data/lib/whois/answer/parser/whois.samoanic.ws.rb +76 -0
  72. data/lib/whois/answer/parser/whois.za.net.rb +8 -11
  73. data/lib/whois/answer/parser/whois.za.org.rb +7 -10
  74. data/lib/whois/answer/super_struct.rb +1 -1
  75. data/lib/whois/client.rb +4 -4
  76. data/lib/whois/definitions/NOTES.txt +12 -0
  77. data/lib/whois/definitions/ipv4.rb +2 -0
  78. data/lib/whois/definitions/tlds.rb +27 -27
  79. data/lib/whois/errors.rb +11 -1
  80. data/lib/whois/server.rb +1 -0
  81. data/lib/whois/server/adapters/web.rb +1 -2
  82. data/lib/whois/version.rb +4 -4
  83. data/test/answer/parser/base_test.rb +16 -29
  84. data/test/answer/parser/jobswhois.verisign-grs.com_test.rb +122 -0
  85. data/test/answer/parser/whois.adamsnames.tc_test.rb +122 -0
  86. data/test/answer/parser/whois.aeda.net.ae_test.rb +63 -0
  87. data/test/answer/parser/whois.afilias-grs.info_test.rb +274 -13
  88. data/test/answer/parser/whois.afilias.info_test.rb +1 -1
  89. data/test/answer/parser/whois.biz_test.rb +51 -0
  90. data/test/answer/parser/whois.cat_test.rb +51 -0
  91. data/test/answer/parser/whois.cira.ca_test.rb +51 -0
  92. data/test/answer/parser/whois.crsnic.net_test.rb +8 -3
  93. data/test/answer/parser/whois.denic.de_test.rb +11 -18
  94. data/test/answer/parser/whois.dk-hostmaster.dk_test.rb +57 -0
  95. data/test/answer/parser/whois.domain-registry.nl_test.rb +49 -0
  96. data/test/answer/parser/whois.domainregistry.ie_test.rb +7 -11
  97. data/test/answer/parser/whois.dotmobiregistry.net_test.rb +51 -0
  98. data/test/answer/parser/whois.educause.edu_test.rb +3 -3
  99. data/test/answer/parser/whois.eu.org_test.rb +6 -12
  100. data/test/answer/parser/whois.eu_test.rb +45 -0
  101. data/test/answer/parser/whois.iana.org_test.rb +2 -4
  102. data/test/answer/parser/whois.isnic.is_test.rb +49 -0
  103. data/test/answer/parser/whois.meregistry.net_test.rb +51 -0
  104. data/test/answer/parser/whois.museum_test.rb +51 -0
  105. data/test/answer/parser/whois.nic-se.se_test.rb +58 -0
  106. data/test/answer/parser/whois.nic.ac_test.rb +126 -0
  107. data/test/answer/parser/whois.nic.asia_test.rb +1 -1
  108. data/test/answer/parser/whois.nic.cc_test.rb +122 -0
  109. data/test/answer/parser/whois.nic.cd_test.rb +49 -0
  110. data/test/answer/parser/whois.nic.ch_test.rb +45 -0
  111. data/test/answer/parser/whois.nic.coop_test.rb +51 -0
  112. data/test/answer/parser/whois.nic.fr_test.rb +178 -13
  113. data/test/answer/parser/whois.nic.gl_test.rb +51 -0
  114. data/test/answer/parser/whois.nic.gov_test.rb +6 -12
  115. data/test/answer/parser/whois.nic.hu_test.rb +9 -7
  116. data/test/answer/parser/whois.nic.im_test.rb +47 -0
  117. data/test/answer/parser/whois.nic.io_test.rb +45 -0
  118. data/test/answer/parser/whois.nic.it_test.rb +6 -3
  119. data/test/answer/parser/whois.nic.ly_test.rb +51 -0
  120. data/test/answer/parser/whois.nic.mu_test.rb +97 -0
  121. data/test/answer/parser/whois.nic.name_test.rb +6 -12
  122. data/test/answer/parser/whois.nic.nu_test.rb +59 -0
  123. data/test/answer/parser/whois.nic.tel_test.rb +51 -0
  124. data/test/answer/parser/whois.nic.tl_test.rb +51 -0
  125. data/test/answer/parser/whois.nic.travel_test.rb +51 -0
  126. data/test/answer/parser/whois.nic.tv_test.rb +9 -5
  127. data/test/answer/parser/whois.nic.uk_test.rb +63 -0
  128. data/test/answer/parser/whois.nic.us_test.rb +51 -0
  129. data/test/answer/parser/whois.norid.no_test.rb +49 -0
  130. data/test/answer/parser/whois.register.bg_test.rb +49 -0
  131. data/test/answer/parser/whois.registro.br_test.rb +45 -0
  132. data/test/answer/parser/whois.registrypro.pro_test.rb +84 -0
  133. data/test/answer/parser/whois.ripe.net_test.rb +203 -0
  134. data/test/answer/parser/whois.ripn.net_test.rb +94 -0
  135. data/test/answer/parser/whois.rotld.ro_test.rb +45 -0
  136. data/test/answer/parser/whois.samoanic.ws_test.rb +51 -0
  137. data/test/answer/parser/whois.za.net_test.rb +2 -4
  138. data/test/answer/parser/whois.za.org_test.rb +2 -4
  139. data/test/answer/parser_test.rb +71 -48
  140. data/test/answer_test.rb +57 -21
  141. data/test/client_test.rb +5 -2
  142. data/test/errors_test.rb +23 -0
  143. data/test/list_tld +74 -76
  144. data/test/testcases/responses/jobswhois.verisign-grs.com/available.txt +44 -0
  145. data/test/testcases/responses/jobswhois.verisign-grs.com/registered.txt +54 -0
  146. data/test/testcases/responses/super_struct_test.rb +3 -4
  147. data/test/testcases/responses/whois.adamsnames.tc/gd/available.txt +2 -0
  148. data/test/testcases/responses/whois.adamsnames.tc/gd/registered.txt +26 -0
  149. data/test/testcases/responses/whois.adamsnames.tc/tc/available.txt +2 -0
  150. data/test/testcases/responses/whois.adamsnames.tc/tc/registered.txt +28 -0
  151. data/test/testcases/responses/whois.adamsnames.tc/vg/available.txt +2 -0
  152. data/test/testcases/responses/whois.adamsnames.tc/vg/registered.txt +28 -0
  153. data/test/testcases/responses/whois.aeda.net.ae/available.txt +1 -0
  154. data/test/testcases/responses/whois.aeda.net.ae/registered.txt +15 -0
  155. data/test/testcases/responses/whois.biz/available.txt +25 -0
  156. data/test/testcases/responses/whois.biz/registered.txt +89 -0
  157. data/test/testcases/responses/whois.cat/available.txt +18 -0
  158. data/test/testcases/responses/whois.cat/registered.txt +83 -0
  159. data/test/testcases/responses/whois.cira.ca/available.txt +9 -0
  160. data/test/testcases/responses/whois.cira.ca/registered.txt +47 -0
  161. data/test/testcases/responses/whois.dk-hostmaster.dk/available.txt +15 -0
  162. data/test/testcases/responses/whois.dk-hostmaster.dk/registered.txt +47 -0
  163. data/test/testcases/responses/whois.domain-registry.nl/available.txt +21 -0
  164. data/test/testcases/responses/whois.domain-registry.nl/registered.txt +67 -0
  165. data/test/testcases/responses/whois.dotmobiregistry.net/available.txt +25 -0
  166. data/test/testcases/responses/whois.dotmobiregistry.net/registered.txt +81 -0
  167. data/test/testcases/responses/whois.eu/available.txt +47 -0
  168. data/test/testcases/responses/whois.eu/registered.txt +63 -0
  169. data/test/testcases/responses/whois.isnic.is/available.txt +7 -0
  170. data/test/testcases/responses/whois.isnic.is/registered.txt +57 -0
  171. data/test/testcases/responses/{whois.afilias-grs.info → whois.meregistry.net}/available.txt +0 -0
  172. data/test/testcases/responses/whois.meregistry.net/registered.txt +94 -0
  173. data/test/testcases/responses/whois.museum/available.txt +18 -0
  174. data/test/testcases/responses/whois.museum/registered.txt +92 -0
  175. data/test/testcases/responses/whois.nic-se.se/available.txt +21 -0
  176. data/test/testcases/responses/whois.nic-se.se/registered.txt +37 -0
  177. data/test/testcases/responses/whois.nic.ac/available.txt +2 -0
  178. data/test/testcases/responses/whois.nic.ac/registered.txt +2 -0
  179. data/test/testcases/responses/whois.nic.cc/available.txt +44 -0
  180. data/test/testcases/responses/whois.nic.cc/registered.txt +58 -0
  181. data/test/testcases/responses/whois.nic.cd/available.txt +1 -0
  182. data/test/testcases/responses/whois.nic.cd/registered.txt +85 -0
  183. data/test/testcases/responses/whois.nic.ch/available.txt +2 -0
  184. data/test/testcases/responses/whois.nic.ch/registered.txt +28 -0
  185. data/test/testcases/responses/whois.nic.coop/available.txt +33 -0
  186. data/test/testcases/responses/whois.nic.coop/registered.txt +123 -0
  187. data/test/testcases/responses/whois.nic.fr/{available.txt → fr/available.txt} +0 -0
  188. data/test/testcases/responses/whois.nic.fr/{registered.txt → fr/registered.txt} +0 -0
  189. data/test/testcases/responses/whois.nic.fr/pm/available.txt +19 -0
  190. data/test/testcases/responses/whois.nic.fr/pm/registered.txt +88 -0
  191. data/test/testcases/responses/whois.nic.fr/re/available.txt +19 -0
  192. data/test/testcases/responses/whois.nic.fr/re/registered.txt +83 -0
  193. data/test/testcases/responses/whois.nic.fr/wf/available.txt +19 -0
  194. data/test/testcases/responses/whois.nic.fr/wf/registered.txt +88 -0
  195. data/test/testcases/responses/whois.nic.fr/yt/available.txt +19 -0
  196. data/test/testcases/responses/whois.nic.fr/yt/registered.txt +88 -0
  197. data/test/testcases/responses/whois.nic.gl/available.txt +23 -0
  198. data/test/testcases/responses/whois.nic.gl/registered.txt +40 -0
  199. data/test/testcases/responses/whois.nic.hu/available.txt +5 -5
  200. data/test/testcases/responses/whois.nic.hu/in_progress.txt +5 -5
  201. data/test/testcases/responses/whois.nic.hu/registered.txt +6 -6
  202. data/test/testcases/responses/whois.nic.im/available.txt +2 -0
  203. data/test/testcases/responses/whois.nic.im/registered.txt +45 -0
  204. data/test/testcases/responses/whois.nic.io/available.txt +2 -0
  205. data/test/testcases/responses/whois.nic.io/registered.txt +2 -0
  206. data/test/testcases/responses/whois.nic.ly/available.txt +1 -0
  207. data/test/testcases/responses/whois.nic.ly/registered.txt +65 -0
  208. data/test/testcases/responses/whois.nic.mu/ki/available.txt +20 -0
  209. data/test/testcases/responses/whois.nic.mu/ki/registered.txt +30 -0
  210. data/test/testcases/responses/whois.nic.mu/mu/available.txt +9 -0
  211. data/test/testcases/responses/whois.nic.mu/mu/registered.txt +22 -0
  212. data/test/testcases/responses/whois.nic.nu/available.txt +19 -0
  213. data/test/testcases/responses/whois.nic.nu/registered.txt +35 -0
  214. data/test/testcases/responses/whois.nic.tel/available.txt +59 -0
  215. data/test/testcases/responses/whois.nic.tel/registered.txt +111 -0
  216. data/test/testcases/responses/whois.nic.tl/available.txt +21 -0
  217. data/test/testcases/responses/whois.nic.tl/registered.txt +29 -0
  218. data/test/testcases/responses/whois.nic.travel/available.txt +25 -0
  219. data/test/testcases/responses/whois.nic.travel/registered.txt +75 -0
  220. data/test/testcases/responses/whois.nic.uk/available.txt +20 -0
  221. data/test/testcases/responses/whois.nic.uk/invalid.txt +22 -0
  222. data/test/testcases/responses/whois.nic.uk/registered.txt +50 -0
  223. data/test/testcases/responses/whois.nic.us/available.txt +29 -0
  224. data/test/testcases/responses/whois.nic.us/registered.txt +99 -0
  225. data/test/testcases/responses/whois.norid.no/available.txt +5 -0
  226. data/test/testcases/responses/whois.norid.no/registered.txt +34 -0
  227. data/test/testcases/responses/whois.register.bg/available.txt +1 -0
  228. data/test/testcases/responses/whois.register.bg/registered.txt +44 -0
  229. data/test/testcases/responses/whois.registro.br/available.txt +22 -0
  230. data/test/testcases/responses/whois.registro.br/registered.txt +23 -0
  231. data/test/testcases/responses/whois.registrypro.pro/available.txt +20 -0
  232. data/test/testcases/responses/whois.registrypro.pro/registered.txt +62 -0
  233. data/test/testcases/responses/whois.ripe.net/fo/available.txt +11 -0
  234. data/test/testcases/responses/whois.ripe.net/fo/registered.txt +45 -0
  235. data/test/testcases/responses/whois.ripe.net/gm/available.txt +11 -0
  236. data/test/testcases/responses/whois.ripe.net/gm/registered.txt +37 -0
  237. data/test/testcases/responses/whois.ripe.net/mc/available.txt +11 -0
  238. data/test/testcases/responses/whois.ripe.net/mc/registered.txt +36 -0
  239. data/test/testcases/responses/whois.ripe.net/sm/available.txt +11 -0
  240. data/test/testcases/responses/whois.ripe.net/sm/registered.txt +60 -0
  241. data/test/testcases/responses/whois.ripe.net/va/available.txt +11 -0
  242. data/test/testcases/responses/whois.ripe.net/va/registered.txt +48 -0
  243. data/test/testcases/responses/whois.ripn.net/ru/available.txt +9 -0
  244. data/test/testcases/responses/whois.ripn.net/ru/registered.txt +24 -0
  245. data/test/testcases/responses/whois.ripn.net/su/available.txt +9 -0
  246. data/test/testcases/responses/whois.ripn.net/su/registered.txt +20 -0
  247. data/test/testcases/responses/whois.rotld.ro/available.txt +16 -0
  248. data/test/testcases/responses/whois.rotld.ro/registered.txt +27 -0
  249. data/test/testcases/responses/whois.samoanic.ws/available.txt +12 -0
  250. data/test/testcases/responses/whois.samoanic.ws/registered.txt +34 -0
  251. data/whois.gemspec +19 -19
  252. metadata +274 -31
  253. data/lib/whois/answer/parser/README.rdoc +0 -21
  254. data/lib/whois/definitions/ipv4.txt +0 -214
  255. data/lib/whois/definitions/ipv6.txt +0 -32
  256. data/lib/whois/definitions/tld.notes.txt +0 -1
  257. data/lib/whois/definitions/tlds.txt +0 -354
  258. data/lib/whois/whois.rb +0 -185
  259. data/test/testcases/responses/whois.afilias-grs.info/registered.txt +0 -122
  260. data/test/testcases/responses/whois.nic.fr/MULTIPLE.txt +0 -4
  261. data/test/whois_test.rb +0 -32
  262. data/utils/tlds.txt +0 -318
@@ -30,56 +30,59 @@ module Whois
30
30
  class WhoisCrsnicNet < Base
31
31
  include Ast
32
32
 
33
- register_method :disclaimer do
33
+ property_supported :disclaimer do
34
34
  node("Disclaimer")
35
35
  end
36
36
 
37
37
 
38
- register_method :domain do
38
+ property_supported :domain do
39
39
  node("Domain Name") { |raw| raw.downcase }
40
40
  end
41
41
 
42
- register_method :domain_id do
42
+ property_supported :domain_id do
43
43
  nil
44
44
  end
45
45
 
46
46
 
47
- register_method :referral_whois do
47
+ property_supported :referral_whois do
48
48
  node("Whois Server")
49
49
  end
50
50
 
51
- register_method :referral_url do
51
+ property_supported :referral_url do
52
52
  node("Referral URL")
53
53
  end
54
54
 
55
55
 
56
- register_method :status do
56
+ property_supported :status do
57
57
  node("Status")
58
58
  end
59
59
 
60
- register_method :available? do
60
+ property_supported :available? do
61
61
  node("Registrar").nil?
62
62
  end
63
63
 
64
- register_method :registered? do
64
+ property_supported :registered? do
65
65
  !available?
66
66
  end
67
67
 
68
68
 
69
- register_method :created_on do
69
+ property_supported :created_on do
70
70
  node("Creation Date") { |raw| Time.parse(raw) }
71
71
  end
72
72
 
73
- register_method :updated_on do
73
+ property_supported :updated_on do
74
74
  node("Updated Date") { |raw| Time.parse(raw) }
75
75
  end
76
76
 
77
- register_method :expires_on do
77
+ property_supported :expires_on do
78
78
  node("Expiration Date") { |raw| Time.parse(raw) }
79
79
  end
80
+
81
+ property_supported :nameservers do
82
+ node("Name Server") { |raw| raw.map { |value| value.downcase }}
83
+ end
80
84
 
81
-
82
- register_method :registrar do
85
+ property_supported :registrar do
83
86
  # Return nil because when the response contains more than one registrar section
84
87
  # the response can be messy. See, for instance, the Verisign response for google.com.
85
88
  nil
@@ -23,47 +23,43 @@ module Whois
23
23
  class WhoisDenicDe < Base
24
24
  include Ast
25
25
 
26
- register_method :disclaimer do
26
+ property_supported :disclaimer do
27
27
  node("Disclaimer")
28
28
  end
29
29
 
30
30
 
31
- register_method :domain do
31
+ property_supported :domain do
32
32
  node("Domain")
33
33
  end
34
34
 
35
- register_method :domain_id do
35
+ property_supported :domain_id do
36
36
  nil
37
37
  end
38
38
 
39
39
 
40
- register_method :status do
40
+ property_supported :status do
41
41
  node("Status")
42
42
  end
43
43
 
44
- register_method :available? do
44
+ property_supported :available? do
45
45
  node("NotFound") && !node("Invalid")
46
46
  end
47
47
 
48
- register_method :registered? do
48
+ property_supported :registered? do
49
49
  !(node("NotFound") || node("Invalid"))
50
50
  end
51
51
 
52
52
 
53
- register_method :created_on do
54
- nil
55
- end
53
+ property_not_supported :created_on
56
54
 
57
- register_method :updated_on do
55
+ property_supported :updated_on do
58
56
  node("Changed") { |raw| Time.parse(raw) }
59
57
  end
60
58
 
61
- register_method :expires_on do
62
- nil
63
- end
59
+ property_not_supported :expires_on
64
60
 
65
61
 
66
- register_method :registrar do
62
+ property_supported :registrar do
67
63
  node("Zone-C") do |raw|
68
64
  Answer::Registrar.new(
69
65
  :id => nil,
@@ -74,20 +70,20 @@ module Whois
74
70
  end
75
71
  end
76
72
 
77
- register_method :registrant do
73
+ property_supported :registrant do
78
74
  node("Holder")
79
75
  end
80
76
 
81
- register_method :admin do
77
+ property_supported :admin do
82
78
  node("Admin-C")
83
79
  end
84
80
 
85
- register_method :technical do
81
+ property_supported :technical do
86
82
  node("Tech-C")
87
83
  end
88
84
 
89
85
 
90
- register_method :nameservers do
86
+ property_supported :nameservers do
91
87
  node("Nserver")
92
88
  end
93
89
 
@@ -0,0 +1,75 @@
1
+ #
2
+ # = Ruby Whois
3
+ #
4
+ # An intelligent pure Ruby WHOIS client and parser.
5
+ #
6
+ #
7
+ # Category:: Net
8
+ # Package:: Whois
9
+ # Author:: Mikkel Kristensen <mikkel@tdx.dk>, Simone Carletti <weppos@weppos.net>
10
+ # License:: MIT License
11
+ #
12
+ #--
13
+ #
14
+ #++
15
+
16
+
17
+ require 'whois/answer/parser/base'
18
+
19
+
20
+ module Whois
21
+ class Answer
22
+ class Parser
23
+
24
+ #
25
+ # = whois.dk-hostmaster.dk
26
+ #
27
+ # Parser for the whois.dk-hostmaster.dk server.
28
+ #
29
+ # NOTE: This parser is just a stub and provides only a few basic methods
30
+ # to check for domain availability and get domain status.
31
+ # Please consider to contribute implementing missing methods.
32
+ # See WhoisNicIt parser for an explanation of all available methods
33
+ # and examples.
34
+ #
35
+ class WhoisDkHostmasterDk < Base
36
+
37
+ property_supported :status do
38
+ @status ||= if content.to_s =~ /Status:\s+(.*)\n/
39
+ $1.downcase.to_sym
40
+ end
41
+ end
42
+
43
+ property_supported :available? do
44
+ @available ||= !!(content.to_s =~ /No entries found for the selected source/)
45
+ end
46
+
47
+ property_supported :registered? do
48
+ !available?
49
+ end
50
+
51
+
52
+ property_supported :created_on do
53
+ @created_on ||= if content.to_s =~ /Registered:\s+(.*)\n/
54
+ Time.parse($1)
55
+ end
56
+ end
57
+
58
+ property_not_supported :updated_on
59
+
60
+ property_supported :expires_on do
61
+ @expires_on ||= if content.to_s =~ /Expires:\s+(.*)\n/
62
+ Time.parse($1)
63
+ end
64
+ end
65
+
66
+
67
+ property_supported :nameservers do
68
+ @nameservers ||= content.to_s.scan(/Hostname:\s+(.*)\n/).flatten
69
+ end
70
+
71
+ end
72
+
73
+ end
74
+ end
75
+ end
@@ -0,0 +1,72 @@
1
+ #
2
+ # = Ruby Whois
3
+ #
4
+ # An intelligent pure Ruby WHOIS client and parser.
5
+ #
6
+ #
7
+ # Category:: Net
8
+ # Package:: Whois
9
+ # Author:: Simone Carletti <weppos@weppos.net>
10
+ # License:: MIT License
11
+ #
12
+ #--
13
+ #
14
+ #++
15
+
16
+
17
+ require 'whois/answer/parser/base'
18
+
19
+
20
+ module Whois
21
+ class Answer
22
+ class Parser
23
+
24
+ #
25
+ # = whois.domain-registry.nl parser
26
+ #
27
+ # Parser for the whois.domain-registry.nl server.
28
+ #
29
+ # NOTE: This parser is just a stub and provides only a few basic methods
30
+ # to check for domain availability and get domain status.
31
+ # Please consider to contribute implementing missing methods.
32
+ # See WhoisNicIt parser for an explanation of all available methods
33
+ # and examples.
34
+ #
35
+ class WhoisDomainRegistryNl < Base
36
+
37
+ property_supported :status do
38
+ if available?
39
+ :available
40
+ else
41
+ :registered
42
+ end
43
+ end
44
+
45
+ property_supported :available? do
46
+ @available ||= !(content.to_s =~ /Status: active/)
47
+ end
48
+
49
+ property_supported :registered? do
50
+ !available?
51
+ end
52
+
53
+
54
+ property_supported :created_on do
55
+ @created_on ||= if content.to_s =~ /Date registered:\s+(.*)\n/
56
+ Time.parse($1)
57
+ end
58
+ end
59
+
60
+ property_supported :updated_on do
61
+ @updated_on ||= if content.to_s =~ /Record last updated:\s+(.*)\n/
62
+ Time.parse($1)
63
+ end
64
+ end
65
+
66
+ property_not_supported :expires_on
67
+
68
+ end
69
+
70
+ end
71
+ end
72
+ end
@@ -34,7 +34,7 @@ module Whois
34
34
  #
35
35
  class WhoisDomainregistryIe < Base
36
36
 
37
- register_method :status do
37
+ property_supported :status do
38
38
  @status ||= if content.to_s =~ /status:\s+(.*)\n/
39
39
  $1.downcase.to_sym
40
40
  else
@@ -42,26 +42,20 @@ module Whois
42
42
  end
43
43
  end
44
44
 
45
- register_method :available? do
45
+ property_supported :available? do
46
46
  @available ||= !!(content.to_s =~ /Not Registered - The domain you have requested is not a registered .ie domain name/)
47
47
  end
48
48
 
49
- register_method :registered? do
49
+ property_supported :registered? do
50
50
  !available?
51
51
  end
52
52
 
53
53
 
54
- # TODO: NotAvailable
55
- register_method :created_on do
56
- nil
57
- end
58
-
59
- # TODO: NotAvailable
60
- register_method :updated_on do
61
- nil
62
- end
54
+ property_not_supported :created_on
55
+
56
+ property_not_supported :updated_on
63
57
 
64
- register_method :expires_on do
58
+ property_supported :expires_on do
65
59
  @expires_on ||= if content.to_s =~ /renewal:\s+(.*)\n/
66
60
  Time.parse($1)
67
61
  end
@@ -0,0 +1,72 @@
1
+ #
2
+ # = Ruby Whois
3
+ #
4
+ # An intelligent pure Ruby WHOIS client and parser.
5
+ #
6
+ #
7
+ # Category:: Net
8
+ # Package:: Whois
9
+ # Author:: Simone Carletti <weppos@weppos.net>
10
+ # License:: MIT License
11
+ #
12
+ #--
13
+ #
14
+ #++
15
+
16
+
17
+ require 'whois/answer/parser/base'
18
+
19
+
20
+ module Whois
21
+ class Answer
22
+ class Parser
23
+
24
+ #
25
+ # = whois.dotmobiregistry.net parser
26
+ #
27
+ # Parser for the whois.dotmobiregistry.net server.
28
+ #
29
+ # NOTE: This parser is just a stub and provides only a few basic methods
30
+ # to check for domain availability and get domain status.
31
+ # Please consider to contribute implementing missing methods.
32
+ # See WhoisNicIt parser for an explanation of all available methods
33
+ # and examples.
34
+ #
35
+ class WhoisDotmobiregistryNet < Base
36
+
37
+ property_supported :status do
38
+ @status ||= content.to_s.scan(/Status:(.*?)\r\n/).flatten
39
+ end
40
+
41
+ property_supported :available? do
42
+ @available ||= (content.to_s =~ /Not found:/)
43
+ end
44
+
45
+ property_supported :registered? do
46
+ !available?
47
+ end
48
+
49
+
50
+ property_supported :created_on do
51
+ @created_on ||= if content.to_s =~ /Created On:(.*?)\r\n/
52
+ Time.parse($1)
53
+ end
54
+ end
55
+
56
+ property_supported :updated_on do
57
+ @updated_on ||= if content.to_s =~ /Last Updated On:(.*?)\r\n/
58
+ Time.parse($1)
59
+ end
60
+ end
61
+
62
+ property_supported :expires_on do
63
+ @expires_on ||= if content.to_s =~ /Expiration Date:(.*?)\r\n/
64
+ Time.parse($1)
65
+ end
66
+ end
67
+
68
+ end
69
+
70
+ end
71
+ end
72
+ end
@@ -34,7 +34,7 @@ module Whois
34
34
  #
35
35
  class WhoisEducauseEdu < Base
36
36
 
37
- register_method :status do
37
+ property_supported :status do
38
38
  if available?
39
39
  :available
40
40
  else
@@ -42,28 +42,28 @@ module Whois
42
42
  end
43
43
  end
44
44
 
45
- register_method :available? do
45
+ property_supported :available? do
46
46
  @available ||= !!(content.to_s =~ /No Match/)
47
47
  end
48
48
 
49
- register_method :registered? do
49
+ property_supported :registered? do
50
50
  !available?
51
51
  end
52
52
 
53
53
 
54
- register_method :created_on do
54
+ property_supported :created_on do
55
55
  @created_on ||= if content.to_s =~ /Domain record activated:\s+(.*)\n/
56
56
  Time.parse($1)
57
57
  end
58
58
  end
59
-
60
- register_method :updated_on do
59
+
60
+ property_supported :updated_on do
61
61
  @updated_on ||= if content.to_s =~ /Domain record last updated:\s+(.*)\n/
62
62
  Time.parse($1)
63
63
  end
64
64
  end
65
-
66
- register_method :expires_on do
65
+
66
+ property_supported :expires_on do
67
67
  @expires_on ||= if content.to_s =~ /Domain expires:\s+(.*)\n/
68
68
  Time.parse($1)
69
69
  end