whois 2.5.1 → 2.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (308) hide show
  1. data/CHANGELOG.md +1537 -0
  2. data/README.md +212 -0
  3. data/Rakefile +3 -3
  4. data/lib/whois.rb +26 -1
  5. data/lib/whois/definitions/tlds.rb +3 -2
  6. data/lib/whois/record.rb +2 -2
  7. data/lib/whois/record/parser/base_afilias.rb +2 -2
  8. data/lib/whois/record/parser/base_cocca.rb +9 -1
  9. data/lib/whois/record/parser/jobswhois.verisign-grs.com.rb +6 -2
  10. data/lib/whois/record/parser/kero.yachay.pe.rb +1 -1
  11. data/lib/whois/record/parser/whois.adamsnames.tc.rb +1 -1
  12. data/lib/whois/record/parser/whois.aeda.net.ae.rb +1 -1
  13. data/lib/whois/record/parser/whois.ai.rb +1 -1
  14. data/lib/whois/record/parser/whois.arnes.si.rb +1 -1
  15. data/lib/whois/record/parser/whois.ati.tn.rb +133 -0
  16. data/lib/whois/record/parser/whois.biz.rb +1 -1
  17. data/lib/whois/record/parser/whois.cat.rb +1 -1
  18. data/lib/whois/record/parser/whois.cctld.uz.rb +4 -3
  19. data/lib/whois/record/parser/whois.centralnic.com.rb +1 -3
  20. data/lib/whois/record/parser/whois.cnnic.cn.rb +1 -1
  21. data/lib/whois/record/parser/whois.co.ca.rb +1 -1
  22. data/lib/whois/record/parser/whois.co.pl.rb +1 -1
  23. data/lib/whois/record/parser/whois.co.ug.rb +13 -12
  24. data/lib/whois/record/parser/whois.crsnic.net.rb +6 -2
  25. data/lib/whois/record/parser/whois.denic.de.rb +1 -1
  26. data/lib/whois/record/parser/whois.dk-hostmaster.dk.rb +1 -1
  27. data/lib/whois/record/parser/whois.dns.be.rb +2 -2
  28. data/lib/whois/record/parser/whois.dns.lu.rb +2 -2
  29. data/lib/whois/record/parser/whois.dns.pl.rb +2 -2
  30. data/lib/whois/record/parser/whois.dns.pt.rb +1 -1
  31. data/lib/whois/record/parser/whois.domain-registry.nl.rb +1 -1
  32. data/lib/whois/record/parser/whois.domain.kg.rb +1 -1
  33. data/lib/whois/record/parser/whois.domainregistry.my.rb +1 -1
  34. data/lib/whois/record/parser/whois.domreg.lt.rb +2 -2
  35. data/lib/whois/record/parser/whois.dot.tk.rb +1 -1
  36. data/lib/whois/record/parser/whois.dreamhost.com.rb +1 -1
  37. data/lib/whois/record/parser/whois.educause.edu.rb +128 -20
  38. data/lib/whois/record/parser/whois.eenet.ee.rb +1 -1
  39. data/lib/whois/record/parser/whois.eu.rb +2 -2
  40. data/lib/whois/record/parser/whois.fi.rb +1 -1
  41. data/lib/whois/record/parser/whois.gg.rb +1 -1
  42. data/lib/whois/record/parser/whois.godaddy.com.rb +1 -1
  43. data/lib/whois/record/parser/whois.hkirc.hk.rb +12 -13
  44. data/lib/whois/record/parser/whois.iana.org.rb +2 -1
  45. data/lib/whois/record/parser/whois.in.ua.rb +1 -1
  46. data/lib/whois/record/parser/whois.isnic.is.rb +1 -1
  47. data/lib/whois/record/parser/whois.isoc.org.il.rb +1 -1
  48. data/lib/whois/record/parser/whois.ja.net.rb +2 -1
  49. data/lib/whois/record/parser/whois.je.rb +1 -1
  50. data/lib/whois/record/parser/whois.jprs.jp.rb +1 -1
  51. data/lib/whois/record/parser/whois.kenic.or.ke.rb +1 -1
  52. data/lib/whois/record/parser/whois.markmonitor.com.rb +1 -1
  53. data/lib/whois/record/parser/whois.meregistry.net.rb +1 -1
  54. data/lib/whois/record/parser/whois.museum.rb +1 -1
  55. data/lib/whois/record/parser/whois.na-nic.com.na.rb +1 -0
  56. data/lib/whois/record/parser/whois.netcom.cm.rb +1 -1
  57. data/lib/whois/record/parser/whois.nic-se.se.rb +1 -1
  58. data/lib/whois/record/parser/whois.nic.am.rb +1 -1
  59. data/lib/whois/record/parser/whois.nic.as.rb +1 -1
  60. data/lib/whois/record/parser/whois.nic.asia.rb +1 -1
  61. data/lib/whois/record/parser/whois.nic.at.rb +1 -1
  62. data/lib/whois/record/parser/whois.nic.cc.rb +1 -1
  63. data/lib/whois/record/parser/whois.nic.cd.rb +1 -1
  64. data/lib/whois/record/parser/whois.nic.ch.rb +2 -2
  65. data/lib/whois/record/parser/whois.nic.ci.rb +1 -1
  66. data/lib/whois/record/parser/whois.nic.ck.rb +1 -1
  67. data/lib/whois/record/parser/whois.nic.cl.rb +1 -1
  68. data/lib/whois/record/parser/whois.nic.co.rb +1 -1
  69. data/lib/whois/record/parser/whois.nic.coop.rb +1 -1
  70. data/lib/whois/record/parser/whois.nic.cz.rb +11 -9
  71. data/lib/whois/record/parser/whois.nic.ec.rb +1 -1
  72. data/lib/whois/record/parser/whois.nic.gl.rb +2 -63
  73. data/lib/whois/record/parser/whois.nic.hu.rb +3 -3
  74. data/lib/whois/record/parser/whois.nic.im.rb +1 -1
  75. data/lib/whois/record/parser/whois.nic.ir.rb +1 -1
  76. data/lib/whois/record/parser/whois.nic.it.rb +4 -4
  77. data/lib/whois/record/parser/whois.nic.kz.rb +1 -1
  78. data/lib/whois/record/parser/whois.nic.li.rb +1 -1
  79. data/lib/whois/record/parser/whois.nic.lv.rb +1 -1
  80. data/lib/whois/record/parser/whois.nic.ly.rb +1 -1
  81. data/lib/whois/record/parser/whois.nic.md.rb +5 -5
  82. data/lib/whois/record/parser/whois.nic.mg.rb +1 -1
  83. data/lib/whois/record/parser/whois.nic.mx.rb +1 -1
  84. data/lib/whois/record/parser/whois.nic.net.sa.rb +1 -1
  85. data/lib/whois/record/parser/whois.nic.nu.rb +1 -1
  86. data/lib/whois/record/parser/whois.nic.org.uy.rb +1 -1
  87. data/lib/whois/record/parser/whois.nic.sl.rb +1 -1
  88. data/lib/whois/record/parser/whois.nic.sm.rb +1 -1
  89. data/lib/whois/record/parser/whois.nic.sn.rb +6 -3
  90. data/lib/whois/record/parser/whois.nic.so.rb +1 -1
  91. data/lib/whois/record/parser/whois.nic.st.rb +1 -1
  92. data/lib/whois/record/parser/whois.nic.tel.rb +1 -1
  93. data/lib/whois/record/parser/whois.nic.tr.rb +2 -1
  94. data/lib/whois/record/parser/whois.nic.travel.rb +1 -1
  95. data/lib/whois/record/parser/whois.nic.tv.rb +1 -1
  96. data/lib/whois/record/parser/whois.nic.uk.rb +11 -4
  97. data/lib/whois/record/parser/whois.nic.us.rb +1 -1
  98. data/lib/whois/record/parser/whois.nic.ve.rb +5 -3
  99. data/lib/whois/record/parser/whois.pandi.or.id.rb +5 -4
  100. data/lib/whois/record/parser/whois.pnina.ps.rb +8 -8
  101. data/lib/whois/record/parser/whois.register.bg.rb +6 -5
  102. data/lib/whois/record/parser/whois.registry.hm.rb +1 -1
  103. data/lib/whois/record/parser/whois.registry.om.rb +125 -0
  104. data/lib/whois/record/parser/whois.registrypro.pro.rb +1 -1
  105. data/lib/whois/record/parser/whois.ripe.net.rb +1 -1
  106. data/lib/whois/record/parser/whois.rnids.rs.rb +1 -1
  107. data/lib/whois/record/parser/whois.rotld.ro.rb +5 -4
  108. data/lib/whois/record/parser/whois.samoanic.ws.rb +1 -1
  109. data/lib/whois/record/parser/whois.sgnic.sg.rb +16 -16
  110. data/lib/whois/record/parser/whois.sk-nic.sk.rb +15 -8
  111. data/lib/whois/record/parser/whois.smallregistry.net.rb +10 -2
  112. data/lib/whois/record/parser/whois.srs.net.nz.rb +38 -20
  113. data/lib/whois/record/parser/whois.tcinet.ru.rb +4 -2
  114. data/lib/whois/record/parser/whois.thnic.co.th.rb +5 -4
  115. data/lib/whois/record/parser/whois.tld.ee.rb +7 -7
  116. data/lib/whois/record/parser/whois.tonic.to.rb +2 -3
  117. data/lib/whois/record/parser/whois.twnic.net.tw.rb +1 -1
  118. data/lib/whois/record/parser/whois.tznic.or.tz.rb +8 -4
  119. data/lib/whois/record/parser/whois.usp.ac.fj.rb +5 -4
  120. data/lib/whois/record/parser/whois.za.net.rb +1 -1
  121. data/lib/whois/record/parser/whois.za.org.rb +1 -1
  122. data/lib/whois/record/scanners/whois.ati.tn.rb +46 -0
  123. data/lib/whois/record/scanners/whois.cira.ca.rb +0 -1
  124. data/lib/whois/record/scanners/whois.registry.om.rb +39 -0
  125. data/lib/whois/record/scanners/whois.rnids.rs.rb +5 -0
  126. data/lib/whois/record/super_struct.rb +8 -5
  127. data/lib/whois/server/adapters/base.rb +53 -53
  128. data/lib/whois/version.rb +2 -2
  129. data/spec/fixtures/responses/whois.ati.tn/status_available.expected +57 -0
  130. data/spec/fixtures/responses/whois.ati.tn/status_available.txt +4 -0
  131. data/spec/fixtures/responses/whois.ati.tn/status_registered.expected +122 -0
  132. data/spec/fixtures/responses/whois.ati.tn/status_registered.txt +36 -0
  133. data/spec/fixtures/responses/whois.cctld.uz/property_expires_on_dash.expected +2 -0
  134. data/spec/fixtures/responses/whois.cctld.uz/property_expires_on_dash.txt +123 -0
  135. data/spec/fixtures/responses/whois.cctld.uz/property_status_reserved.expected +8 -0
  136. data/spec/fixtures/responses/whois.cctld.uz/property_status_reserved.txt +123 -0
  137. data/spec/fixtures/responses/{whois.nic.uk/property_status_registered.expected → whois.co.ug/property_status_active.expected} +0 -0
  138. data/spec/fixtures/responses/whois.co.ug/property_status_active.txt +35 -0
  139. data/spec/fixtures/responses/whois.co.ug/property_status_unconfirmed.expected +8 -0
  140. data/spec/fixtures/responses/whois.co.ug/property_status_unconfirmed.txt +30 -0
  141. data/spec/fixtures/responses/whois.dns.be/{response_throttled.expected → response_throttled_hourly.expected} +0 -0
  142. data/spec/fixtures/responses/whois.dns.be/{response_throttled_max.txt → response_throttled_hourly.txt} +0 -0
  143. data/spec/fixtures/responses/whois.dns.be/{response_throttled_max.expected → response_throttled_limit.expected} +0 -0
  144. data/spec/fixtures/responses/whois.dns.be/{response_throttled.txt → response_throttled_limit.txt} +0 -0
  145. data/spec/fixtures/responses/whois.dns.hr/status_registered.expected +13 -11
  146. data/spec/fixtures/responses/whois.domain-registry.nl/status_available.expected +4 -0
  147. data/spec/fixtures/responses/whois.domain-registry.nl/status_redemption.expected +4 -0
  148. data/spec/fixtures/responses/whois.educause.edu/fixture1.txt +63 -0
  149. data/spec/fixtures/responses/whois.educause.edu/fixture2.txt +66 -0
  150. data/spec/fixtures/responses/whois.educause.edu/fixture3.txt +67 -0
  151. data/spec/fixtures/responses/whois.educause.edu/fixture4.txt +68 -0
  152. data/spec/fixtures/responses/whois.educause.edu/fixture5.txt +66 -0
  153. data/spec/fixtures/responses/whois.educause.edu/fixture6.txt +66 -0
  154. data/spec/fixtures/responses/whois.educause.edu/property_contact_registrant.expected +27 -0
  155. data/spec/fixtures/responses/whois.educause.edu/property_contact_registrant.txt +63 -0
  156. data/spec/fixtures/responses/whois.educause.edu/property_contact_registrant_with_additional_organization.expected +28 -0
  157. data/spec/fixtures/responses/whois.educause.edu/property_contact_registrant_with_additional_organization.txt +66 -0
  158. data/spec/fixtures/responses/whois.educause.edu/property_contact_registrant_without_address.expected +26 -0
  159. data/spec/fixtures/responses/whois.educause.edu/{property_registrant_without_address.txt → property_contact_registrant_without_address.txt} +0 -0
  160. data/spec/fixtures/responses/whois.educause.edu/property_contact_registrant_without_zip.expected +27 -0
  161. data/spec/fixtures/responses/whois.educause.edu/{property_registrant_without_zip.txt → property_contact_registrant_without_zip.txt} +0 -0
  162. data/spec/fixtures/responses/whois.educause.edu/property_contacts.expected +31 -0
  163. data/spec/fixtures/responses/whois.educause.edu/property_contacts.txt +63 -0
  164. data/spec/fixtures/responses/whois.educause.edu/property_contacts_case1.expected +31 -0
  165. data/spec/fixtures/responses/whois.educause.edu/property_contacts_case1.txt +66 -0
  166. data/spec/fixtures/responses/whois.educause.edu/property_contacts_case2.expected +32 -0
  167. data/spec/fixtures/responses/whois.educause.edu/property_contacts_case2.txt +67 -0
  168. data/spec/fixtures/responses/whois.educause.edu/property_contacts_case3.expected +32 -0
  169. data/spec/fixtures/responses/whois.educause.edu/property_contacts_case3.txt +66 -0
  170. data/spec/fixtures/responses/whois.educause.edu/property_contacts_case4.expected +32 -0
  171. data/spec/fixtures/responses/whois.educause.edu/property_contacts_case4.txt +68 -0
  172. data/spec/fixtures/responses/whois.educause.edu/status_available.expected +34 -0
  173. data/spec/fixtures/responses/whois.educause.edu/status_registered.expected +70 -8
  174. data/spec/fixtures/responses/whois.hkirc.hk/property_expires_on_null.expected +2 -0
  175. data/spec/fixtures/responses/whois.hkirc.hk/property_expires_on_null.txt +104 -0
  176. data/spec/fixtures/responses/whois.na-nic.com.na/property_status_active.expected +8 -0
  177. data/spec/fixtures/responses/whois.na-nic.com.na/property_status_active.txt +54 -0
  178. data/spec/fixtures/responses/whois.na-nic.com.na/property_status_delegated.expected +8 -0
  179. data/spec/fixtures/responses/whois.na-nic.com.na/property_status_delegated.txt +86 -0
  180. data/spec/fixtures/responses/whois.na-nic.com.na/status_registered.expected +9 -2
  181. data/spec/fixtures/responses/whois.na-nic.com.na/status_registered.txt +17 -7
  182. data/spec/fixtures/responses/whois.nc/property_contact_without_state.txt +21 -0
  183. data/spec/fixtures/responses/whois.nic.af/status_registered.expected +14 -3
  184. data/spec/fixtures/responses/whois.nic.af/status_registered.txt +59 -40
  185. data/spec/fixtures/responses/whois.nic.cx/status_registered.expected +7 -0
  186. data/spec/fixtures/responses/whois.nic.gl/status_available.expected +7 -0
  187. data/spec/fixtures/responses/whois.nic.gl/status_registered.expected +14 -0
  188. data/spec/fixtures/responses/whois.nic.gs/status_registered.expected +7 -0
  189. data/spec/fixtures/responses/whois.nic.ht/status_registered.expected +9 -2
  190. data/spec/fixtures/responses/whois.nic.ht/status_registered.txt +58 -44
  191. data/spec/fixtures/responses/whois.nic.ki/status_registered.expected +7 -0
  192. data/spec/fixtures/responses/whois.nic.ms/status_registered.expected +7 -0
  193. data/spec/fixtures/responses/whois.nic.mu/status_registered.expected +9 -2
  194. data/spec/fixtures/responses/whois.nic.mu/status_registered.txt +52 -8
  195. data/spec/fixtures/responses/whois.nic.net.nf/status_registered.expected +7 -0
  196. data/spec/fixtures/responses/whois.nic.net.ng/status_registered.expected +7 -0
  197. data/spec/fixtures/responses/whois.nic.net.sb/status_registered.expected +7 -0
  198. data/spec/fixtures/responses/whois.nic.tl/status_registered.expected +9 -2
  199. data/spec/fixtures/responses/whois.nic.tl/status_registered.txt +42 -5
  200. data/spec/fixtures/responses/whois.nic.uk/property_nameservers_with_ip.txt +11 -7
  201. data/spec/fixtures/responses/whois.nic.uk/property_registrant_type_individual.txt +45 -0
  202. data/spec/fixtures/responses/whois.nic.uk/{property_status_registered.txt → property_registrant_type_unknown.txt} +5 -5
  203. data/spec/fixtures/responses/whois.nic.uk/property_status_missing.txt +2 -2
  204. data/spec/fixtures/responses/whois.nic.uk/property_status_no_status_listed.txt +2 -2
  205. data/spec/fixtures/responses/whois.nic.uk/property_status_registered_until_expiry_date.txt +18 -13
  206. data/spec/fixtures/responses/whois.nic.uk/property_status_suspended.txt +51 -51
  207. data/spec/fixtures/responses/whois.nic.uk/status_available.txt +2 -2
  208. data/spec/fixtures/responses/whois.nic.uk/status_invalid.txt +2 -2
  209. data/spec/fixtures/responses/whois.nic.uk/status_registered.expected +2 -2
  210. data/spec/fixtures/responses/whois.nic.uk/status_registered.txt +5 -5
  211. data/spec/fixtures/responses/whois.nic.uk/status_reserved.expected +1 -1
  212. data/spec/fixtures/responses/whois.nic.uk/status_reserved.txt +2 -2
  213. data/spec/fixtures/responses/whois.nic.uk/status_suspended.expected +1 -1
  214. data/spec/fixtures/responses/whois.nic.uk/status_suspended.txt +51 -51
  215. data/spec/fixtures/responses/whois.registry.gy/status_registered.expected +7 -0
  216. data/spec/fixtures/responses/whois.registry.om/status_available.expected +56 -0
  217. data/spec/fixtures/responses/whois.registry.om/status_available.txt +1 -0
  218. data/spec/fixtures/responses/whois.registry.om/status_registered.expected +100 -0
  219. data/spec/fixtures/responses/whois.registry.om/status_registered.txt +18 -0
  220. data/spec/fixtures/responses/whois.rnids.rs/property_nameservers_hyphenated.expected +9 -0
  221. data/spec/fixtures/responses/whois.rnids.rs/property_nameservers_hyphenated.txt +36 -0
  222. data/spec/fixtures/responses/whois.rnids.rs/token_whois_privacy.expected +11 -0
  223. data/spec/fixtures/responses/whois.rnids.rs/token_whois_privacy.txt +36 -0
  224. data/spec/fixtures/responses/whois.srs.net.nz/response_throttled.expected +2 -0
  225. data/spec/fixtures/responses/whois.srs.net.nz/response_throttled.txt +27 -0
  226. data/spec/fixtures/responses/whois.srs.net.nz/status_available.expected +4 -0
  227. data/spec/fixtures/responses/whois.srs.net.nz/status_available.txt +2 -3
  228. data/spec/fixtures/responses/whois.srs.net.nz/status_invalid.expected +4 -0
  229. data/spec/fixtures/responses/whois.srs.net.nz/status_invalid.txt +2 -3
  230. data/spec/fixtures/responses/whois.srs.net.nz/status_registered.expected +6 -2
  231. data/spec/fixtures/responses/whois.srs.net.nz/status_registered.txt +5 -4
  232. data/spec/fixtures/responses/whois.tznic.or.tz/property_status_expired.expected +8 -0
  233. data/spec/fixtures/responses/whois.tznic.or.tz/property_status_expired.txt +56 -0
  234. data/spec/support/helpers/spec_helper.rb +0 -5
  235. data/spec/tlds +4 -2
  236. data/spec/whois/record/contact_spec.rb +8 -8
  237. data/spec/whois/record/nameserver_spec.rb +6 -6
  238. data/spec/whois/record/parser/base_spec.rb +11 -11
  239. data/spec/whois/record/parser/blank_spec.rb +1 -1
  240. data/spec/whois/record/parser/responses/whois.ati.tn/status_available_spec.rb +108 -0
  241. data/spec/whois/record/parser/responses/whois.ati.tn/status_registered_spec.rb +173 -0
  242. data/spec/whois/record/parser/responses/whois.cctld.uz/property_expires_on_dash_spec.rb +29 -0
  243. data/spec/whois/record/parser/responses/whois.cctld.uz/property_status_reserved_spec.rb +39 -0
  244. data/spec/whois/record/parser/responses/{whois.nic.uk/property_status_registered_spec.rb → whois.co.ug/property_status_active_spec.rb} +4 -4
  245. data/spec/whois/record/parser/responses/whois.co.ug/property_status_unconfirmed_spec.rb +39 -0
  246. data/spec/whois/record/parser/responses/whois.dns.be/{response_throttled_spec.rb → response_throttled_hourly_spec.rb} +3 -3
  247. data/spec/whois/record/parser/responses/whois.dns.be/{response_throttled_max_spec.rb → response_throttled_limit_spec.rb} +3 -3
  248. data/spec/whois/record/parser/responses/whois.dns.hr/status_registered_spec.rb +13 -11
  249. data/spec/whois/record/parser/responses/whois.domain-registry.nl/status_available_spec.rb +5 -0
  250. data/spec/whois/record/parser/responses/whois.domain-registry.nl/status_redemption_spec.rb +5 -0
  251. data/spec/whois/record/parser/responses/whois.educause.edu/property_contact_registrant_spec.rb +44 -0
  252. data/spec/whois/record/parser/responses/whois.educause.edu/property_contact_registrant_with_additional_organization_spec.rb +44 -0
  253. data/spec/whois/record/parser/responses/whois.educause.edu/property_contact_registrant_without_address_spec.rb +44 -0
  254. data/spec/whois/record/parser/responses/whois.educause.edu/property_contact_registrant_without_zip_spec.rb +44 -0
  255. data/spec/whois/record/parser/responses/whois.educause.edu/property_contacts_case1_spec.rb +43 -0
  256. data/spec/whois/record/parser/responses/whois.educause.edu/property_contacts_case2_spec.rb +43 -0
  257. data/spec/whois/record/parser/responses/whois.educause.edu/property_contacts_case3_spec.rb +43 -0
  258. data/spec/whois/record/parser/responses/whois.educause.edu/property_contacts_case4_spec.rb +43 -0
  259. data/spec/whois/record/parser/responses/whois.educause.edu/property_contacts_spec.rb +43 -0
  260. data/spec/whois/record/parser/responses/whois.educause.edu/status_available_spec.rb +48 -0
  261. data/spec/whois/record/parser/responses/whois.educause.edu/status_registered_spec.rb +83 -8
  262. data/spec/whois/record/parser/responses/whois.hkirc.hk/property_expires_on_null_spec.rb +29 -0
  263. data/spec/whois/record/parser/responses/whois.na-nic.com.na/property_status_active_spec.rb +39 -0
  264. data/spec/whois/record/parser/responses/whois.na-nic.com.na/property_status_delegated_spec.rb +39 -0
  265. data/spec/whois/record/parser/responses/whois.na-nic.com.na/status_registered_spec.rb +10 -2
  266. data/spec/whois/record/parser/responses/whois.nic.af/status_registered_spec.rb +15 -3
  267. data/spec/whois/record/parser/responses/whois.nic.cx/status_registered_spec.rb +8 -0
  268. data/spec/whois/record/parser/responses/whois.nic.gl/status_available_spec.rb +10 -0
  269. data/spec/whois/record/parser/responses/whois.nic.gl/status_registered_spec.rb +18 -0
  270. data/spec/whois/record/parser/responses/whois.nic.gs/status_registered_spec.rb +8 -0
  271. data/spec/whois/record/parser/responses/whois.nic.ht/status_registered_spec.rb +10 -2
  272. data/spec/whois/record/parser/responses/whois.nic.ki/status_registered_spec.rb +8 -0
  273. data/spec/whois/record/parser/responses/whois.nic.ms/status_registered_spec.rb +8 -0
  274. data/spec/whois/record/parser/responses/whois.nic.mu/status_registered_spec.rb +10 -2
  275. data/spec/whois/record/parser/responses/whois.nic.net.nf/status_registered_spec.rb +8 -0
  276. data/spec/whois/record/parser/responses/whois.nic.net.ng/status_registered_spec.rb +8 -0
  277. data/spec/whois/record/parser/responses/whois.nic.net.sb/status_registered_spec.rb +8 -0
  278. data/spec/whois/record/parser/responses/whois.nic.tl/status_registered_spec.rb +10 -2
  279. data/spec/whois/record/parser/responses/whois.nic.uk/status_registered_spec.rb +2 -2
  280. data/spec/whois/record/parser/responses/whois.nic.uk/status_reserved_spec.rb +1 -1
  281. data/spec/whois/record/parser/responses/whois.nic.uk/status_suspended_spec.rb +1 -1
  282. data/spec/whois/record/parser/responses/whois.registry.gy/status_registered_spec.rb +8 -0
  283. data/spec/whois/record/parser/responses/whois.registry.om/status_available_spec.rb +107 -0
  284. data/spec/whois/record/parser/responses/whois.registry.om/status_registered_spec.rb +151 -0
  285. data/spec/whois/record/parser/responses/whois.rnids.rs/property_nameservers_hyphenated_spec.rb +36 -0
  286. data/spec/whois/record/parser/responses/whois.rnids.rs/token_whois_privacy_spec.rb +42 -0
  287. data/spec/whois/record/parser/responses/whois.srs.net.nz/response_throttled_spec.rb +29 -0
  288. data/spec/whois/record/parser/responses/whois.srs.net.nz/status_available_spec.rb +5 -0
  289. data/spec/whois/record/parser/responses/whois.srs.net.nz/status_invalid_spec.rb +5 -0
  290. data/spec/whois/record/parser/responses/whois.srs.net.nz/status_registered_spec.rb +7 -2
  291. data/spec/whois/record/parser/responses/whois.tznic.or.tz/property_status_expired_spec.rb +39 -0
  292. data/spec/whois/record/parser_spec.rb +25 -25
  293. data/spec/whois/record/part_spec.rb +5 -5
  294. data/spec/whois/record/registrar_spec.rb +8 -8
  295. data/spec/whois/record/super_struct_spec.rb +0 -1
  296. data/spec/whois/record_spec.rb +12 -12
  297. data/spec/whois/server/adapters/afilias_spec.rb +2 -2
  298. data/spec/whois/server/adapters/formatted_spec.rb +1 -1
  299. data/spec/whois/server/adapters/pir_spec.rb +2 -2
  300. data/spec/whois/server/adapters/standard_spec.rb +1 -1
  301. data/spec/whois/server/adapters/verisign_spec.rb +2 -2
  302. data/whois.gemspec +6 -6
  303. metadata +97 -20
  304. data/.rspec +0 -1
  305. data/spec/fixtures/responses/whois.educause.edu/property_registrant_without_address.expected +0 -11
  306. data/spec/fixtures/responses/whois.educause.edu/property_registrant_without_zip.expected +0 -12
  307. data/spec/whois/record/parser/responses/whois.educause.edu/property_registrant_without_address_spec.rb +0 -38
  308. data/spec/whois/record/parser/responses/whois.educause.edu/property_registrant_without_zip_spec.rb +0 -39
@@ -0,0 +1,125 @@
1
+ #--
2
+ # Ruby Whois
3
+ #
4
+ # An intelligent pure Ruby WHOIS client and parser.
5
+ #
6
+ # Copyright (c) 2009-2012 Simone Carletti <weppos@weppos.net>
7
+ #++
8
+
9
+
10
+ require 'whois/record/parser/base'
11
+ require 'whois/record/scanners/whois.registry.om.rb'
12
+
13
+
14
+ module Whois
15
+ class Record
16
+ class Parser
17
+
18
+ # Parser for the whois.registry.om server.
19
+ #
20
+ # @see Whois::Record::Parser::Example
21
+ # The Example parser for the list of all available methods.
22
+ #
23
+ # @since RELEASE
24
+ class WhoisRegistryOm < Base
25
+ include Scanners::Ast
26
+
27
+ property_not_supported :disclaimer
28
+
29
+
30
+ property_supported :domain do
31
+ node('Domain Name')
32
+ end
33
+
34
+ property_not_supported :domain_id
35
+
36
+
37
+ property_not_supported :referral_whois
38
+
39
+ property_not_supported :referral_url
40
+
41
+
42
+ property_supported :status do
43
+ case (s = node('Status'))
44
+ when nil
45
+ :available
46
+ when 'ok'
47
+ :registered
48
+ else
49
+ Whois.bug!(ParserError, "Unknown status `#{s}'.")
50
+ end
51
+ end
52
+
53
+ property_supported :available? do
54
+ !!node('status:available')
55
+ end
56
+
57
+ property_supported :registered? do
58
+ !available?
59
+ end
60
+
61
+
62
+ property_not_supported :created_on
63
+
64
+ property_not_supported :updated_on
65
+
66
+ property_not_supported :expires_on
67
+
68
+
69
+ property_supported :registrar do
70
+ node('Registrar Name') do |name|
71
+ Record::Registrar.new(
72
+ :name => name
73
+ )
74
+ end
75
+ end
76
+
77
+
78
+ property_supported :registrant_contacts do
79
+ build_contact('Registrant', Whois::Record::Contact::TYPE_REGISTRANT)
80
+ end
81
+
82
+ property_not_supported :admin_contacts
83
+
84
+ property_supported :technical_contacts do
85
+ build_contact('Tech', Whois::Record::Contact::TYPE_TECHNICAL)
86
+ end
87
+
88
+
89
+ property_supported :nameservers do
90
+ node('Name Server') do |names|
91
+ names.map do |name|
92
+ Record::Nameserver.new(:name => name)
93
+ end
94
+ end
95
+ end
96
+
97
+
98
+ # Initializes a new {Scanners::WhoisRegistryOm} instance
99
+ # passing the {#content_for_scanner}
100
+ # and calls +parse+ on it.
101
+ #
102
+ # @return [Hash]
103
+ def parse
104
+ Scanners::WhoisRegistryOm.new(content_for_scanner).parse
105
+ end
106
+
107
+
108
+ private
109
+
110
+ def build_contact(element, type)
111
+ node("#{element} Contact ID") do
112
+ Record::Contact.new(
113
+ :type => type,
114
+ :id => node("#{element} Contact ID"),
115
+ :name => node("#{element} Contact Name"),
116
+ :email => node("#{element} Contact Email")
117
+ )
118
+ end
119
+ end
120
+
121
+ end
122
+
123
+ end
124
+ end
125
+ end
@@ -61,7 +61,7 @@ module Whois
61
61
 
62
62
  property_supported :nameservers do
63
63
  content_for_scanner.scan(/Name Server:(.+)\n/).flatten.map do |name|
64
- Record::Nameserver.new(name.downcase)
64
+ Record::Nameserver.new(:name => name.downcase)
65
65
  end
66
66
  end
67
67
 
@@ -59,7 +59,7 @@ module Whois
59
59
  property_supported :nameservers do
60
60
  content_for_scanner.scan(/nserver:\s+(.+)\n/).flatten.map do |line|
61
61
  name, ipv4 = line.split(/\s+/)
62
- Record::Nameserver.new(name.downcase, ipv4)
62
+ Record::Nameserver.new(:name => name.downcase, :ipv4 => ipv4)
63
63
  end
64
64
  end
65
65
 
@@ -97,7 +97,7 @@ module Whois
97
97
 
98
98
  property_supported :nameservers do
99
99
  Array.wrap(node("DNS")).map do |line|
100
- name, ipv4 = line.split("-").map(&:strip)
100
+ name, ipv4 = line.split(/ - ?/).map(&:strip)
101
101
  name.chomp!(".")
102
102
  Nameserver.new(:name => name, :ipv4 => ipv4)
103
103
  end
@@ -30,9 +30,10 @@ module Whois
30
30
  property_supported :status do
31
31
  if content_for_scanner =~ /Domain Status:\s(.+?)\n/
32
32
  case $1.downcase
33
- when "ok" then :registered
34
- else
35
- Whois.bug!(ParserError, "Unknown status `#{$1}'.")
33
+ when "ok"
34
+ :registered
35
+ else
36
+ Whois.bug!(ParserError, "Unknown status `#{$1}'.")
36
37
  end
37
38
  else
38
39
  :available
@@ -57,7 +58,7 @@ module Whois
57
58
 
58
59
  property_supported :nameservers do
59
60
  content_for_scanner.scan(/Name Server:\s+(.+)\n/).flatten.map do |name|
60
- Record::Nameserver.new(name)
61
+ Record::Nameserver.new(:name => name)
61
62
  end
62
63
  end
63
64
 
@@ -66,7 +66,7 @@ module Whois
66
66
  property_supported :nameservers do
67
67
  if content_for_scanner =~ /Current Nameservers:\n\n((.+\n)+)\n/
68
68
  $1.split("\n").map do |name|
69
- Record::Nameserver.new(name.strip.downcase)
69
+ Record::Nameserver.new(:name => name.strip.downcase)
70
70
  end
71
71
  end
72
72
  end
@@ -58,22 +58,22 @@ module Whois
58
58
  property_supported :nameservers do
59
59
  if content_for_scanner =~ /Name Servers:\n((.+\n)+)\n/
60
60
  values = case value = $1.downcase
61
- # schema-1
62
- when /^(?:\s+([\w.-]+)\n){2,}/
63
- value.scan(/\s+([\w.-]+)\n/).map do |match|
64
- { :name => match[0] }
65
- end
66
- when /^(?:\s+([\w.-]+)\s+\((.+)\)\n){2,}/
67
- value.scan(/\s+([\w.-]+)\s+\((.+)\)\n/).map do |match|
68
- { :name => match[0], :ipv4 => match[1] }
69
- end
70
- # schema-2
71
- when /^(?:\s+([\w.-]+)){2,}/
72
- value.strip.split(/\s+/).map do |name|
73
- { :name => name }
74
- end
75
- else
76
- Whois.bug!(ParserError, "Unknown nameservers format `#{value}'")
61
+ # schema-1
62
+ when /^(?:\s+([\w.-]+)\n){2,}/
63
+ value.scan(/\s+([\w.-]+)\n/).map do |match|
64
+ { :name => match[0] }
65
+ end
66
+ when /^(?:\s+([\w.-]+)\s+\((.+)\)\n){2,}/
67
+ value.scan(/\s+([\w.-]+)\s+\((.+)\)\n/).map do |match|
68
+ { :name => match[0], :ipv4 => match[1] }
69
+ end
70
+ # schema-2
71
+ when /^(?:\s+([\w.-]+)){2,}/
72
+ value.strip.split(/\s+/).map do |name|
73
+ { :name => name }
74
+ end
75
+ else
76
+ Whois.bug!(ParserError, "Unknown nameservers format `#{value}'")
77
77
  end
78
78
 
79
79
  values.map do |params|
@@ -36,21 +36,28 @@ module Whois
36
36
  if content_for_scanner =~ /^Domain-status\s+(.+)\n/
37
37
  case $1.downcase
38
38
  # The domain is registered and paid.
39
- when "dom_ok" then :registered
39
+ when "dom_ok"
40
+ :registered
40
41
  # The domain is registered and registration fee has to be payed (14 days).
41
42
  # Replacement 14-day period for domain payment.
42
- when "dom_ta" then :registered
43
+ when "dom_ta"
44
+ :registered
43
45
  # 28 days before the expiration of one year's notice is sent to the first call for an extension of domains.
44
46
  # The domain is still fully functional (14 days).
45
- when "dom_dakt" then :registered
47
+ when "dom_dakt"
48
+ :registered
46
49
  # 14 days before the expiration of one year's notice is sent to the second call to the extension of domains.
47
50
  # The domain is still fully functional (14 days).
48
- when "dom_warn" then :registered
51
+ when "dom_warn"
52
+ :registered
49
53
  # The domain is expired and has not been renewed (14 days).
50
- when "dom_lnot" then :registered
51
- when "dom_exp" then :registered
54
+ when "dom_lnot"
55
+ :registered
56
+ when "dom_exp"
57
+ :registered
52
58
  # The domain losts its registrar (28 days).
53
- when "dom_held" then :redemption
59
+ when "dom_held"
60
+ :redemption
54
61
  else
55
62
  Whois.bug!(ParserError, "Unknown status `#{$1}'.")
56
63
  end
@@ -85,7 +92,7 @@ module Whois
85
92
 
86
93
  property_supported :nameservers do
87
94
  content_for_scanner.scan(/dns_name\s+(.+)\n/).flatten.map do |name|
88
- Record::Nameserver.new(name)
95
+ Record::Nameserver.new(:name => name)
89
96
  end
90
97
  end
91
98
 
@@ -75,7 +75,15 @@ module Whois
75
75
 
76
76
 
77
77
  property_supported :registrar do
78
- node("registrar") { |hash| Registrar.new(*hash.values_at('nil', 'name', 'name', 'web')) }
78
+ node("registrar") do |hash|
79
+ v1, v2, v3, v4 = hash.values_at('nil', 'name', 'name', 'web')
80
+ Registrar.new(
81
+ :id => v1,
82
+ :name => v2,
83
+ :organization => v3,
84
+ :url => v4
85
+ )
86
+ end
79
87
  end
80
88
 
81
89
  property_supported :registrant_contacts do
@@ -93,7 +101,7 @@ module Whois
93
101
 
94
102
  property_supported :nameservers do
95
103
  Array.wrap(node("name_servers")).map do |hash|
96
- Record::Nameserver.new(hash)
104
+ Record::Nameserver.new(:name => hash)
97
105
  end
98
106
  end
99
107
 
@@ -14,31 +14,35 @@ module Whois
14
14
  class Record
15
15
  class Parser
16
16
 
17
- #
18
- # = whois.srs.net.nz parser
19
- #
20
17
  # Parser for the whois.srs.net.nz server.
21
18
  #
22
- # NOTE: This parser is just a stub and provides only a few basic methods
23
- # to check for domain availability and get domain status.
24
- # Please consider to contribute implementing missing methods.
25
- # See WhoisNicIt parser for an explanation of all available methods
26
- # and examples.
19
+ # @note This parser is just a stub and provides only a few basic methods
20
+ # to check for domain availability and get domain status.
21
+ # Please consider to contribute implementing missing methods.
22
+ #
23
+ # @see Whois::Record::Parser::Example
24
+ # The Example parser for the list of all available methods.
27
25
  #
28
26
  class WhoisSrsNetNz < Base
29
27
 
30
28
  # @see http://dnc.org.nz/content/srs-whois-spec-1.0.html
31
29
  property_supported :status do
32
30
  if content_for_scanner =~ /query_status:\s(.+)\n/
33
- case s = $1.downcase
34
- when /active/ then :registered
35
- when /available/ then :available
36
- when /invalid characters/ then :invalid
37
- # The domain is no longer active but is in the period prior
38
- # to being released for general registrations
39
- when "210 pendingrelease" then :redemption
40
- else
41
- Whois.bug!(ParserError, "Unknown status `#{s}'.")
31
+ case (s = $1.downcase)
32
+ when "200 active"
33
+ :registered
34
+ # The domain is no longer active but is in the period prior
35
+ # to being released for general registrations
36
+ when "210 pendingrelease"
37
+ :redemption
38
+ when "220 available"
39
+ :available
40
+ when "404 request denied"
41
+ :error
42
+ when /invalid characters/
43
+ :invalid
44
+ else
45
+ Whois.bug!(ParserError, "Unknown status `#{s}'.")
42
46
  end
43
47
  else
44
48
  Whois.bug!(ParserError, "Unable to parse status.")
@@ -46,11 +50,11 @@ module Whois
46
50
  end
47
51
 
48
52
  property_supported :available? do
49
- (status == :available)
53
+ status == :available
50
54
  end
51
55
 
52
56
  property_supported :registered? do
53
- (status == :registered) || (status == :redemption)
57
+ status == :registered || status == :redemption
54
58
  end
55
59
 
56
60
 
@@ -75,7 +79,21 @@ module Whois
75
79
 
76
80
  property_supported :nameservers do
77
81
  content_for_scanner.scan(/ns_name_[\d]+:\s(.+)\n/).flatten.map do |name|
78
- Record::Nameserver.new(name)
82
+ Record::Nameserver.new(:name => name)
83
+ end
84
+ end
85
+
86
+
87
+ # Checks whether the response has been throttled.
88
+ #
89
+ # @return [Boolean]
90
+ #
91
+ # @example
92
+ # query_status: 440 Request Denied
93
+ #
94
+ def response_throttled?
95
+ cached_properties_fetch(:response_throttled?) do
96
+ !!(content_for_scanner =~ /^query_status: 440 Request Denied/)
79
97
  end
80
98
  end
81
99
 
@@ -60,7 +60,9 @@ module Whois
60
60
 
61
61
  property_supported :registrar do
62
62
  if content_for_scanner =~ /registrar:\s+(.*)\n/
63
- Record::Registrar.new(:id => $1)
63
+ Record::Registrar.new(
64
+ :id => $1
65
+ )
64
66
  end
65
67
  end
66
68
 
@@ -91,7 +93,7 @@ module Whois
91
93
  property_supported :nameservers do
92
94
  content_for_scanner.scan(/nserver:\s+(.+)\n/).flatten.map do |line|
93
95
  name, ipv4 = line.split(/\s+/)
94
- Record::Nameserver.new(name.chomp("."), ipv4)
96
+ Record::Nameserver.new(:name => name.chomp("."), :ipv4 => ipv4)
95
97
  end
96
98
  end
97
99
 
@@ -30,9 +30,10 @@ module Whois
30
30
  property_supported :status do
31
31
  if content_for_scanner =~ /Status: (.+?)\n/
32
32
  case $1.downcase
33
- when "active" then :registered
34
- else
35
- Whois.bug!(ParserError, "Unknown status `#{$1}'.")
33
+ when "active"
34
+ :registered
35
+ else
36
+ Whois.bug!(ParserError, "Unknown status `#{$1}'.")
36
37
  end
37
38
  else
38
39
  :available
@@ -69,7 +70,7 @@ module Whois
69
70
 
70
71
  property_supported :nameservers do
71
72
  content_for_scanner.scan(/Name Server:\s+(.+)\n/).flatten.map do |name|
72
- Record::Nameserver.new(name.downcase)
73
+ Record::Nameserver.new(:name => name.downcase)
73
74
  end
74
75
  end
75
76
 
@@ -69,22 +69,22 @@ module Whois
69
69
 
70
70
 
71
71
  property_supported :registrar do
72
- if content_for_scanner =~ /registrar:\s+(.*)\n/
72
+ if content_for_scanner =~ /registrar:\s+(.+)\n/
73
73
  Whois::Record::Registrar.new(
74
- :id => $1,
75
- :name => $1
74
+ :id => $1,
75
+ :name => $1
76
76
  )
77
77
  end
78
78
  end
79
79
 
80
80
  property_supported :admin_contacts do
81
- if content_for_scanner =~ /admin-c:\s+(.*)\n/
81
+ if content_for_scanner =~ /admin-c:\s+(.+)\n/
82
82
  build_contact($1, Whois::Record::Contact::TYPE_ADMIN)
83
83
  end
84
84
  end
85
85
 
86
86
  property_supported :registrant_contacts do
87
- if content_for_scanner =~ /registrant:\s+(.*)\n/
87
+ if content_for_scanner =~ /registrant:\s+(.+)\n/
88
88
  build_contact($1, Whois::Record::Contact::TYPE_REGISTRANT)
89
89
  end
90
90
  end
@@ -95,9 +95,9 @@ module Whois
95
95
  property_supported :nameservers do
96
96
  content_for_scanner.scan(/nserver:\s+(.+)\n/).flatten.map do |line|
97
97
  if line =~ /(.+) \((.+)\)/
98
- Record::Nameserver.new($1, $2)
98
+ Record::Nameserver.new(:name => $1, :ipv4 => $2)
99
99
  else
100
- Record::Nameserver.new(line)
100
+ Record::Nameserver.new(:name => line)
101
101
  end
102
102
  end
103
103
  end