whois 2.5.1 → 2.6.0
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.md +1537 -0
- data/README.md +212 -0
- data/Rakefile +3 -3
- data/lib/whois.rb +26 -1
- data/lib/whois/definitions/tlds.rb +3 -2
- data/lib/whois/record.rb +2 -2
- data/lib/whois/record/parser/base_afilias.rb +2 -2
- data/lib/whois/record/parser/base_cocca.rb +9 -1
- data/lib/whois/record/parser/jobswhois.verisign-grs.com.rb +6 -2
- data/lib/whois/record/parser/kero.yachay.pe.rb +1 -1
- data/lib/whois/record/parser/whois.adamsnames.tc.rb +1 -1
- data/lib/whois/record/parser/whois.aeda.net.ae.rb +1 -1
- data/lib/whois/record/parser/whois.ai.rb +1 -1
- data/lib/whois/record/parser/whois.arnes.si.rb +1 -1
- data/lib/whois/record/parser/whois.ati.tn.rb +133 -0
- data/lib/whois/record/parser/whois.biz.rb +1 -1
- data/lib/whois/record/parser/whois.cat.rb +1 -1
- data/lib/whois/record/parser/whois.cctld.uz.rb +4 -3
- data/lib/whois/record/parser/whois.centralnic.com.rb +1 -3
- data/lib/whois/record/parser/whois.cnnic.cn.rb +1 -1
- data/lib/whois/record/parser/whois.co.ca.rb +1 -1
- data/lib/whois/record/parser/whois.co.pl.rb +1 -1
- data/lib/whois/record/parser/whois.co.ug.rb +13 -12
- data/lib/whois/record/parser/whois.crsnic.net.rb +6 -2
- data/lib/whois/record/parser/whois.denic.de.rb +1 -1
- data/lib/whois/record/parser/whois.dk-hostmaster.dk.rb +1 -1
- data/lib/whois/record/parser/whois.dns.be.rb +2 -2
- data/lib/whois/record/parser/whois.dns.lu.rb +2 -2
- data/lib/whois/record/parser/whois.dns.pl.rb +2 -2
- data/lib/whois/record/parser/whois.dns.pt.rb +1 -1
- data/lib/whois/record/parser/whois.domain-registry.nl.rb +1 -1
- data/lib/whois/record/parser/whois.domain.kg.rb +1 -1
- data/lib/whois/record/parser/whois.domainregistry.my.rb +1 -1
- data/lib/whois/record/parser/whois.domreg.lt.rb +2 -2
- data/lib/whois/record/parser/whois.dot.tk.rb +1 -1
- data/lib/whois/record/parser/whois.dreamhost.com.rb +1 -1
- data/lib/whois/record/parser/whois.educause.edu.rb +128 -20
- data/lib/whois/record/parser/whois.eenet.ee.rb +1 -1
- data/lib/whois/record/parser/whois.eu.rb +2 -2
- data/lib/whois/record/parser/whois.fi.rb +1 -1
- data/lib/whois/record/parser/whois.gg.rb +1 -1
- data/lib/whois/record/parser/whois.godaddy.com.rb +1 -1
- data/lib/whois/record/parser/whois.hkirc.hk.rb +12 -13
- data/lib/whois/record/parser/whois.iana.org.rb +2 -1
- data/lib/whois/record/parser/whois.in.ua.rb +1 -1
- data/lib/whois/record/parser/whois.isnic.is.rb +1 -1
- data/lib/whois/record/parser/whois.isoc.org.il.rb +1 -1
- data/lib/whois/record/parser/whois.ja.net.rb +2 -1
- data/lib/whois/record/parser/whois.je.rb +1 -1
- data/lib/whois/record/parser/whois.jprs.jp.rb +1 -1
- data/lib/whois/record/parser/whois.kenic.or.ke.rb +1 -1
- data/lib/whois/record/parser/whois.markmonitor.com.rb +1 -1
- data/lib/whois/record/parser/whois.meregistry.net.rb +1 -1
- data/lib/whois/record/parser/whois.museum.rb +1 -1
- data/lib/whois/record/parser/whois.na-nic.com.na.rb +1 -0
- data/lib/whois/record/parser/whois.netcom.cm.rb +1 -1
- data/lib/whois/record/parser/whois.nic-se.se.rb +1 -1
- data/lib/whois/record/parser/whois.nic.am.rb +1 -1
- data/lib/whois/record/parser/whois.nic.as.rb +1 -1
- data/lib/whois/record/parser/whois.nic.asia.rb +1 -1
- data/lib/whois/record/parser/whois.nic.at.rb +1 -1
- data/lib/whois/record/parser/whois.nic.cc.rb +1 -1
- data/lib/whois/record/parser/whois.nic.cd.rb +1 -1
- data/lib/whois/record/parser/whois.nic.ch.rb +2 -2
- data/lib/whois/record/parser/whois.nic.ci.rb +1 -1
- data/lib/whois/record/parser/whois.nic.ck.rb +1 -1
- data/lib/whois/record/parser/whois.nic.cl.rb +1 -1
- data/lib/whois/record/parser/whois.nic.co.rb +1 -1
- data/lib/whois/record/parser/whois.nic.coop.rb +1 -1
- data/lib/whois/record/parser/whois.nic.cz.rb +11 -9
- data/lib/whois/record/parser/whois.nic.ec.rb +1 -1
- data/lib/whois/record/parser/whois.nic.gl.rb +2 -63
- data/lib/whois/record/parser/whois.nic.hu.rb +3 -3
- data/lib/whois/record/parser/whois.nic.im.rb +1 -1
- data/lib/whois/record/parser/whois.nic.ir.rb +1 -1
- data/lib/whois/record/parser/whois.nic.it.rb +4 -4
- data/lib/whois/record/parser/whois.nic.kz.rb +1 -1
- data/lib/whois/record/parser/whois.nic.li.rb +1 -1
- data/lib/whois/record/parser/whois.nic.lv.rb +1 -1
- data/lib/whois/record/parser/whois.nic.ly.rb +1 -1
- data/lib/whois/record/parser/whois.nic.md.rb +5 -5
- data/lib/whois/record/parser/whois.nic.mg.rb +1 -1
- data/lib/whois/record/parser/whois.nic.mx.rb +1 -1
- data/lib/whois/record/parser/whois.nic.net.sa.rb +1 -1
- data/lib/whois/record/parser/whois.nic.nu.rb +1 -1
- data/lib/whois/record/parser/whois.nic.org.uy.rb +1 -1
- data/lib/whois/record/parser/whois.nic.sl.rb +1 -1
- data/lib/whois/record/parser/whois.nic.sm.rb +1 -1
- data/lib/whois/record/parser/whois.nic.sn.rb +6 -3
- data/lib/whois/record/parser/whois.nic.so.rb +1 -1
- data/lib/whois/record/parser/whois.nic.st.rb +1 -1
- data/lib/whois/record/parser/whois.nic.tel.rb +1 -1
- data/lib/whois/record/parser/whois.nic.tr.rb +2 -1
- data/lib/whois/record/parser/whois.nic.travel.rb +1 -1
- data/lib/whois/record/parser/whois.nic.tv.rb +1 -1
- data/lib/whois/record/parser/whois.nic.uk.rb +11 -4
- data/lib/whois/record/parser/whois.nic.us.rb +1 -1
- data/lib/whois/record/parser/whois.nic.ve.rb +5 -3
- data/lib/whois/record/parser/whois.pandi.or.id.rb +5 -4
- data/lib/whois/record/parser/whois.pnina.ps.rb +8 -8
- data/lib/whois/record/parser/whois.register.bg.rb +6 -5
- data/lib/whois/record/parser/whois.registry.hm.rb +1 -1
- data/lib/whois/record/parser/whois.registry.om.rb +125 -0
- data/lib/whois/record/parser/whois.registrypro.pro.rb +1 -1
- data/lib/whois/record/parser/whois.ripe.net.rb +1 -1
- data/lib/whois/record/parser/whois.rnids.rs.rb +1 -1
- data/lib/whois/record/parser/whois.rotld.ro.rb +5 -4
- data/lib/whois/record/parser/whois.samoanic.ws.rb +1 -1
- data/lib/whois/record/parser/whois.sgnic.sg.rb +16 -16
- data/lib/whois/record/parser/whois.sk-nic.sk.rb +15 -8
- data/lib/whois/record/parser/whois.smallregistry.net.rb +10 -2
- data/lib/whois/record/parser/whois.srs.net.nz.rb +38 -20
- data/lib/whois/record/parser/whois.tcinet.ru.rb +4 -2
- data/lib/whois/record/parser/whois.thnic.co.th.rb +5 -4
- data/lib/whois/record/parser/whois.tld.ee.rb +7 -7
- data/lib/whois/record/parser/whois.tonic.to.rb +2 -3
- data/lib/whois/record/parser/whois.twnic.net.tw.rb +1 -1
- data/lib/whois/record/parser/whois.tznic.or.tz.rb +8 -4
- data/lib/whois/record/parser/whois.usp.ac.fj.rb +5 -4
- data/lib/whois/record/parser/whois.za.net.rb +1 -1
- data/lib/whois/record/parser/whois.za.org.rb +1 -1
- data/lib/whois/record/scanners/whois.ati.tn.rb +46 -0
- data/lib/whois/record/scanners/whois.cira.ca.rb +0 -1
- data/lib/whois/record/scanners/whois.registry.om.rb +39 -0
- data/lib/whois/record/scanners/whois.rnids.rs.rb +5 -0
- data/lib/whois/record/super_struct.rb +8 -5
- data/lib/whois/server/adapters/base.rb +53 -53
- data/lib/whois/version.rb +2 -2
- data/spec/fixtures/responses/whois.ati.tn/status_available.expected +57 -0
- data/spec/fixtures/responses/whois.ati.tn/status_available.txt +4 -0
- data/spec/fixtures/responses/whois.ati.tn/status_registered.expected +122 -0
- data/spec/fixtures/responses/whois.ati.tn/status_registered.txt +36 -0
- data/spec/fixtures/responses/whois.cctld.uz/property_expires_on_dash.expected +2 -0
- data/spec/fixtures/responses/whois.cctld.uz/property_expires_on_dash.txt +123 -0
- data/spec/fixtures/responses/whois.cctld.uz/property_status_reserved.expected +8 -0
- data/spec/fixtures/responses/whois.cctld.uz/property_status_reserved.txt +123 -0
- data/spec/fixtures/responses/{whois.nic.uk/property_status_registered.expected → whois.co.ug/property_status_active.expected} +0 -0
- data/spec/fixtures/responses/whois.co.ug/property_status_active.txt +35 -0
- data/spec/fixtures/responses/whois.co.ug/property_status_unconfirmed.expected +8 -0
- data/spec/fixtures/responses/whois.co.ug/property_status_unconfirmed.txt +30 -0
- data/spec/fixtures/responses/whois.dns.be/{response_throttled.expected → response_throttled_hourly.expected} +0 -0
- data/spec/fixtures/responses/whois.dns.be/{response_throttled_max.txt → response_throttled_hourly.txt} +0 -0
- data/spec/fixtures/responses/whois.dns.be/{response_throttled_max.expected → response_throttled_limit.expected} +0 -0
- data/spec/fixtures/responses/whois.dns.be/{response_throttled.txt → response_throttled_limit.txt} +0 -0
- data/spec/fixtures/responses/whois.dns.hr/status_registered.expected +13 -11
- data/spec/fixtures/responses/whois.domain-registry.nl/status_available.expected +4 -0
- data/spec/fixtures/responses/whois.domain-registry.nl/status_redemption.expected +4 -0
- data/spec/fixtures/responses/whois.educause.edu/fixture1.txt +63 -0
- data/spec/fixtures/responses/whois.educause.edu/fixture2.txt +66 -0
- data/spec/fixtures/responses/whois.educause.edu/fixture3.txt +67 -0
- data/spec/fixtures/responses/whois.educause.edu/fixture4.txt +68 -0
- data/spec/fixtures/responses/whois.educause.edu/fixture5.txt +66 -0
- data/spec/fixtures/responses/whois.educause.edu/fixture6.txt +66 -0
- data/spec/fixtures/responses/whois.educause.edu/property_contact_registrant.expected +27 -0
- data/spec/fixtures/responses/whois.educause.edu/property_contact_registrant.txt +63 -0
- data/spec/fixtures/responses/whois.educause.edu/property_contact_registrant_with_additional_organization.expected +28 -0
- data/spec/fixtures/responses/whois.educause.edu/property_contact_registrant_with_additional_organization.txt +66 -0
- data/spec/fixtures/responses/whois.educause.edu/property_contact_registrant_without_address.expected +26 -0
- data/spec/fixtures/responses/whois.educause.edu/{property_registrant_without_address.txt → property_contact_registrant_without_address.txt} +0 -0
- data/spec/fixtures/responses/whois.educause.edu/property_contact_registrant_without_zip.expected +27 -0
- data/spec/fixtures/responses/whois.educause.edu/{property_registrant_without_zip.txt → property_contact_registrant_without_zip.txt} +0 -0
- data/spec/fixtures/responses/whois.educause.edu/property_contacts.expected +31 -0
- data/spec/fixtures/responses/whois.educause.edu/property_contacts.txt +63 -0
- data/spec/fixtures/responses/whois.educause.edu/property_contacts_case1.expected +31 -0
- data/spec/fixtures/responses/whois.educause.edu/property_contacts_case1.txt +66 -0
- data/spec/fixtures/responses/whois.educause.edu/property_contacts_case2.expected +32 -0
- data/spec/fixtures/responses/whois.educause.edu/property_contacts_case2.txt +67 -0
- data/spec/fixtures/responses/whois.educause.edu/property_contacts_case3.expected +32 -0
- data/spec/fixtures/responses/whois.educause.edu/property_contacts_case3.txt +66 -0
- data/spec/fixtures/responses/whois.educause.edu/property_contacts_case4.expected +32 -0
- data/spec/fixtures/responses/whois.educause.edu/property_contacts_case4.txt +68 -0
- data/spec/fixtures/responses/whois.educause.edu/status_available.expected +34 -0
- data/spec/fixtures/responses/whois.educause.edu/status_registered.expected +70 -8
- data/spec/fixtures/responses/whois.hkirc.hk/property_expires_on_null.expected +2 -0
- data/spec/fixtures/responses/whois.hkirc.hk/property_expires_on_null.txt +104 -0
- data/spec/fixtures/responses/whois.na-nic.com.na/property_status_active.expected +8 -0
- data/spec/fixtures/responses/whois.na-nic.com.na/property_status_active.txt +54 -0
- data/spec/fixtures/responses/whois.na-nic.com.na/property_status_delegated.expected +8 -0
- data/spec/fixtures/responses/whois.na-nic.com.na/property_status_delegated.txt +86 -0
- data/spec/fixtures/responses/whois.na-nic.com.na/status_registered.expected +9 -2
- data/spec/fixtures/responses/whois.na-nic.com.na/status_registered.txt +17 -7
- data/spec/fixtures/responses/whois.nc/property_contact_without_state.txt +21 -0
- data/spec/fixtures/responses/whois.nic.af/status_registered.expected +14 -3
- data/spec/fixtures/responses/whois.nic.af/status_registered.txt +59 -40
- data/spec/fixtures/responses/whois.nic.cx/status_registered.expected +7 -0
- data/spec/fixtures/responses/whois.nic.gl/status_available.expected +7 -0
- data/spec/fixtures/responses/whois.nic.gl/status_registered.expected +14 -0
- data/spec/fixtures/responses/whois.nic.gs/status_registered.expected +7 -0
- data/spec/fixtures/responses/whois.nic.ht/status_registered.expected +9 -2
- data/spec/fixtures/responses/whois.nic.ht/status_registered.txt +58 -44
- data/spec/fixtures/responses/whois.nic.ki/status_registered.expected +7 -0
- data/spec/fixtures/responses/whois.nic.ms/status_registered.expected +7 -0
- data/spec/fixtures/responses/whois.nic.mu/status_registered.expected +9 -2
- data/spec/fixtures/responses/whois.nic.mu/status_registered.txt +52 -8
- data/spec/fixtures/responses/whois.nic.net.nf/status_registered.expected +7 -0
- data/spec/fixtures/responses/whois.nic.net.ng/status_registered.expected +7 -0
- data/spec/fixtures/responses/whois.nic.net.sb/status_registered.expected +7 -0
- data/spec/fixtures/responses/whois.nic.tl/status_registered.expected +9 -2
- data/spec/fixtures/responses/whois.nic.tl/status_registered.txt +42 -5
- data/spec/fixtures/responses/whois.nic.uk/property_nameservers_with_ip.txt +11 -7
- data/spec/fixtures/responses/whois.nic.uk/property_registrant_type_individual.txt +45 -0
- data/spec/fixtures/responses/whois.nic.uk/{property_status_registered.txt → property_registrant_type_unknown.txt} +5 -5
- data/spec/fixtures/responses/whois.nic.uk/property_status_missing.txt +2 -2
- data/spec/fixtures/responses/whois.nic.uk/property_status_no_status_listed.txt +2 -2
- data/spec/fixtures/responses/whois.nic.uk/property_status_registered_until_expiry_date.txt +18 -13
- data/spec/fixtures/responses/whois.nic.uk/property_status_suspended.txt +51 -51
- data/spec/fixtures/responses/whois.nic.uk/status_available.txt +2 -2
- data/spec/fixtures/responses/whois.nic.uk/status_invalid.txt +2 -2
- data/spec/fixtures/responses/whois.nic.uk/status_registered.expected +2 -2
- data/spec/fixtures/responses/whois.nic.uk/status_registered.txt +5 -5
- data/spec/fixtures/responses/whois.nic.uk/status_reserved.expected +1 -1
- data/spec/fixtures/responses/whois.nic.uk/status_reserved.txt +2 -2
- data/spec/fixtures/responses/whois.nic.uk/status_suspended.expected +1 -1
- data/spec/fixtures/responses/whois.nic.uk/status_suspended.txt +51 -51
- data/spec/fixtures/responses/whois.registry.gy/status_registered.expected +7 -0
- data/spec/fixtures/responses/whois.registry.om/status_available.expected +56 -0
- data/spec/fixtures/responses/whois.registry.om/status_available.txt +1 -0
- data/spec/fixtures/responses/whois.registry.om/status_registered.expected +100 -0
- data/spec/fixtures/responses/whois.registry.om/status_registered.txt +18 -0
- data/spec/fixtures/responses/whois.rnids.rs/property_nameservers_hyphenated.expected +9 -0
- data/spec/fixtures/responses/whois.rnids.rs/property_nameservers_hyphenated.txt +36 -0
- data/spec/fixtures/responses/whois.rnids.rs/token_whois_privacy.expected +11 -0
- data/spec/fixtures/responses/whois.rnids.rs/token_whois_privacy.txt +36 -0
- data/spec/fixtures/responses/whois.srs.net.nz/response_throttled.expected +2 -0
- data/spec/fixtures/responses/whois.srs.net.nz/response_throttled.txt +27 -0
- data/spec/fixtures/responses/whois.srs.net.nz/status_available.expected +4 -0
- data/spec/fixtures/responses/whois.srs.net.nz/status_available.txt +2 -3
- data/spec/fixtures/responses/whois.srs.net.nz/status_invalid.expected +4 -0
- data/spec/fixtures/responses/whois.srs.net.nz/status_invalid.txt +2 -3
- data/spec/fixtures/responses/whois.srs.net.nz/status_registered.expected +6 -2
- data/spec/fixtures/responses/whois.srs.net.nz/status_registered.txt +5 -4
- data/spec/fixtures/responses/whois.tznic.or.tz/property_status_expired.expected +8 -0
- data/spec/fixtures/responses/whois.tznic.or.tz/property_status_expired.txt +56 -0
- data/spec/support/helpers/spec_helper.rb +0 -5
- data/spec/tlds +4 -2
- data/spec/whois/record/contact_spec.rb +8 -8
- data/spec/whois/record/nameserver_spec.rb +6 -6
- data/spec/whois/record/parser/base_spec.rb +11 -11
- data/spec/whois/record/parser/blank_spec.rb +1 -1
- data/spec/whois/record/parser/responses/whois.ati.tn/status_available_spec.rb +108 -0
- data/spec/whois/record/parser/responses/whois.ati.tn/status_registered_spec.rb +173 -0
- data/spec/whois/record/parser/responses/whois.cctld.uz/property_expires_on_dash_spec.rb +29 -0
- data/spec/whois/record/parser/responses/whois.cctld.uz/property_status_reserved_spec.rb +39 -0
- data/spec/whois/record/parser/responses/{whois.nic.uk/property_status_registered_spec.rb → whois.co.ug/property_status_active_spec.rb} +4 -4
- data/spec/whois/record/parser/responses/whois.co.ug/property_status_unconfirmed_spec.rb +39 -0
- data/spec/whois/record/parser/responses/whois.dns.be/{response_throttled_spec.rb → response_throttled_hourly_spec.rb} +3 -3
- data/spec/whois/record/parser/responses/whois.dns.be/{response_throttled_max_spec.rb → response_throttled_limit_spec.rb} +3 -3
- data/spec/whois/record/parser/responses/whois.dns.hr/status_registered_spec.rb +13 -11
- data/spec/whois/record/parser/responses/whois.domain-registry.nl/status_available_spec.rb +5 -0
- data/spec/whois/record/parser/responses/whois.domain-registry.nl/status_redemption_spec.rb +5 -0
- data/spec/whois/record/parser/responses/whois.educause.edu/property_contact_registrant_spec.rb +44 -0
- data/spec/whois/record/parser/responses/whois.educause.edu/property_contact_registrant_with_additional_organization_spec.rb +44 -0
- data/spec/whois/record/parser/responses/whois.educause.edu/property_contact_registrant_without_address_spec.rb +44 -0
- data/spec/whois/record/parser/responses/whois.educause.edu/property_contact_registrant_without_zip_spec.rb +44 -0
- data/spec/whois/record/parser/responses/whois.educause.edu/property_contacts_case1_spec.rb +43 -0
- data/spec/whois/record/parser/responses/whois.educause.edu/property_contacts_case2_spec.rb +43 -0
- data/spec/whois/record/parser/responses/whois.educause.edu/property_contacts_case3_spec.rb +43 -0
- data/spec/whois/record/parser/responses/whois.educause.edu/property_contacts_case4_spec.rb +43 -0
- data/spec/whois/record/parser/responses/whois.educause.edu/property_contacts_spec.rb +43 -0
- data/spec/whois/record/parser/responses/whois.educause.edu/status_available_spec.rb +48 -0
- data/spec/whois/record/parser/responses/whois.educause.edu/status_registered_spec.rb +83 -8
- data/spec/whois/record/parser/responses/whois.hkirc.hk/property_expires_on_null_spec.rb +29 -0
- data/spec/whois/record/parser/responses/whois.na-nic.com.na/property_status_active_spec.rb +39 -0
- data/spec/whois/record/parser/responses/whois.na-nic.com.na/property_status_delegated_spec.rb +39 -0
- data/spec/whois/record/parser/responses/whois.na-nic.com.na/status_registered_spec.rb +10 -2
- data/spec/whois/record/parser/responses/whois.nic.af/status_registered_spec.rb +15 -3
- data/spec/whois/record/parser/responses/whois.nic.cx/status_registered_spec.rb +8 -0
- data/spec/whois/record/parser/responses/whois.nic.gl/status_available_spec.rb +10 -0
- data/spec/whois/record/parser/responses/whois.nic.gl/status_registered_spec.rb +18 -0
- data/spec/whois/record/parser/responses/whois.nic.gs/status_registered_spec.rb +8 -0
- data/spec/whois/record/parser/responses/whois.nic.ht/status_registered_spec.rb +10 -2
- data/spec/whois/record/parser/responses/whois.nic.ki/status_registered_spec.rb +8 -0
- data/spec/whois/record/parser/responses/whois.nic.ms/status_registered_spec.rb +8 -0
- data/spec/whois/record/parser/responses/whois.nic.mu/status_registered_spec.rb +10 -2
- data/spec/whois/record/parser/responses/whois.nic.net.nf/status_registered_spec.rb +8 -0
- data/spec/whois/record/parser/responses/whois.nic.net.ng/status_registered_spec.rb +8 -0
- data/spec/whois/record/parser/responses/whois.nic.net.sb/status_registered_spec.rb +8 -0
- data/spec/whois/record/parser/responses/whois.nic.tl/status_registered_spec.rb +10 -2
- data/spec/whois/record/parser/responses/whois.nic.uk/status_registered_spec.rb +2 -2
- data/spec/whois/record/parser/responses/whois.nic.uk/status_reserved_spec.rb +1 -1
- data/spec/whois/record/parser/responses/whois.nic.uk/status_suspended_spec.rb +1 -1
- data/spec/whois/record/parser/responses/whois.registry.gy/status_registered_spec.rb +8 -0
- data/spec/whois/record/parser/responses/whois.registry.om/status_available_spec.rb +107 -0
- data/spec/whois/record/parser/responses/whois.registry.om/status_registered_spec.rb +151 -0
- data/spec/whois/record/parser/responses/whois.rnids.rs/property_nameservers_hyphenated_spec.rb +36 -0
- data/spec/whois/record/parser/responses/whois.rnids.rs/token_whois_privacy_spec.rb +42 -0
- data/spec/whois/record/parser/responses/whois.srs.net.nz/response_throttled_spec.rb +29 -0
- data/spec/whois/record/parser/responses/whois.srs.net.nz/status_available_spec.rb +5 -0
- data/spec/whois/record/parser/responses/whois.srs.net.nz/status_invalid_spec.rb +5 -0
- data/spec/whois/record/parser/responses/whois.srs.net.nz/status_registered_spec.rb +7 -2
- data/spec/whois/record/parser/responses/whois.tznic.or.tz/property_status_expired_spec.rb +39 -0
- data/spec/whois/record/parser_spec.rb +25 -25
- data/spec/whois/record/part_spec.rb +5 -5
- data/spec/whois/record/registrar_spec.rb +8 -8
- data/spec/whois/record/super_struct_spec.rb +0 -1
- data/spec/whois/record_spec.rb +12 -12
- data/spec/whois/server/adapters/afilias_spec.rb +2 -2
- data/spec/whois/server/adapters/formatted_spec.rb +1 -1
- data/spec/whois/server/adapters/pir_spec.rb +2 -2
- data/spec/whois/server/adapters/standard_spec.rb +1 -1
- data/spec/whois/server/adapters/verisign_spec.rb +2 -2
- data/whois.gemspec +6 -6
- metadata +97 -20
- data/.rspec +0 -1
- data/spec/fixtures/responses/whois.educause.edu/property_registrant_without_address.expected +0 -11
- data/spec/fixtures/responses/whois.educause.edu/property_registrant_without_zip.expected +0 -12
- data/spec/whois/record/parser/responses/whois.educause.edu/property_registrant_without_address_spec.rb +0 -38
- data/spec/whois/record/parser/responses/whois.educause.edu/property_registrant_without_zip_spec.rb +0 -39
data/README.md
ADDED
@@ -0,0 +1,212 @@
|
|
1
|
+
# Whois
|
2
|
+
|
3
|
+
*Whois* is an intelligent pure Ruby WHOIS client and parser.
|
4
|
+
|
5
|
+
[![Build Status](https://secure.travis-ci.org/weppos/whois.png)](http://travis-ci.org/weppos/whois)
|
6
|
+
|
7
|
+
*Whois* is a OS-independent library and doesn't require any external binaries or C libraries: it is a 100% Ruby software.
|
8
|
+
|
9
|
+
This library was developed to power [RoboDomain](https://www.robodomain.com) and, since July 2009, it ran more than thousands requests.
|
10
|
+
|
11
|
+
An extensive test suite is available to verify the library correctness but you must be aware that registrant might change WHOIS interfaces without notice and at any time causing queries to specific hosts to stop working.
|
12
|
+
|
13
|
+
|
14
|
+
## Features
|
15
|
+
|
16
|
+
* Ability to query registry data for [IPv4, IPv6, TLDs, and domain names](http://www.ruby-whois.org/manual/usage.html#usage-objects)
|
17
|
+
* Ability to [parse WHOIS responses](http://www.ruby-whois.org/manual/parser.html)
|
18
|
+
* Flexible and extensible interface (e.g. You can define [custom servers](http://www.ruby-whois.org/manual/server.html) on the fly)
|
19
|
+
* Object oriented design, featuring 10 different design patterns
|
20
|
+
* Pure Ruby library, without any external dependency other than Ruby itself
|
21
|
+
* Compatible with [Ruby 1.8.7 and greater](http://www.ruby-whois.org/manual/installing.html#installation-requirements), including Ruby 1.9 branch
|
22
|
+
* Successfully tested against several [Ruby implementations](http://www.ruby-whois.org/manual/interpreters.html)
|
23
|
+
|
24
|
+
|
25
|
+
## Requirements
|
26
|
+
|
27
|
+
* Ruby >= 1.8.7
|
28
|
+
|
29
|
+
*Whois* >= 1.5 requires Ruby 1.8.7 or newer.
|
30
|
+
For older versions of Ruby, see the CHANGELOG.rdoc file.
|
31
|
+
|
32
|
+
In addition to the standard Ruby interpreter (MRI),
|
33
|
+
Whois has been successfully tested against several
|
34
|
+
[Ruby implementations](http://www.ruby-whois.org/manual/interpreters.html).
|
35
|
+
|
36
|
+
|
37
|
+
## Installation
|
38
|
+
|
39
|
+
The best way to install *Whois* is via [RubyGems](https://rubygems.org/).
|
40
|
+
|
41
|
+
$ gem install whois
|
42
|
+
|
43
|
+
You might need administrator privileges on your system to install the gem.
|
44
|
+
|
45
|
+
|
46
|
+
## Upgrade
|
47
|
+
|
48
|
+
Install the newer version via RubyGems.
|
49
|
+
|
50
|
+
$ gem install whois
|
51
|
+
|
52
|
+
Minor and bugfix releases normally won't break backwards-compatibility. You can read the CHANGELOG.md file to learn about the changes in each release.
|
53
|
+
|
54
|
+
Read the [Upgrading](http://www.ruby-whois.org/manual/upgrading.html) documentation page for detailed information about incompatible changes and further instructions.
|
55
|
+
|
56
|
+
|
57
|
+
## Getting Started
|
58
|
+
|
59
|
+
Note. This section covers only the essentials for getting started with the Whois library. The [documentation](http://www.ruby-whois.org/documentation.html) provides a more accurate explanation including tutorials, more examples and technical details about the client/server/record/parser architecture.
|
60
|
+
|
61
|
+
### Querying the Server
|
62
|
+
|
63
|
+
Whois provides the ability to get WHOIS information for TLD, domain names, IPv4 and IPv6 addresses. The client is smart enough to guess the best WHOIS server according to given query, send the request and return the response.
|
64
|
+
|
65
|
+
Check out the following examples:
|
66
|
+
|
67
|
+
# Domain WHOIS
|
68
|
+
w = Whois::Client.new
|
69
|
+
w.query("google.com")
|
70
|
+
# => #<Whois::Record>
|
71
|
+
|
72
|
+
# TLD WHOIS
|
73
|
+
w = Whois::Client.new
|
74
|
+
w.query(".com")
|
75
|
+
# => #<Whois::Record>
|
76
|
+
|
77
|
+
# IPv4 WHOIS
|
78
|
+
w = Whois::Client.new
|
79
|
+
w.query("74.125.67.100")
|
80
|
+
# => #<Whois::Record>
|
81
|
+
|
82
|
+
# IPv6 WHOIS
|
83
|
+
w = Whois::Client.new
|
84
|
+
w.query("2001:db8::1428:57ab")
|
85
|
+
# => #<Whois::Record>
|
86
|
+
|
87
|
+
The query method is stateless. For this reason, you can safely re-use the same client instance for multiple queries.
|
88
|
+
|
89
|
+
w = Whois::Client.new
|
90
|
+
w.query("google.com")
|
91
|
+
w.query(".com")
|
92
|
+
w.query("74.125.67.100")
|
93
|
+
w.query("2001:db8::1428:57ab")
|
94
|
+
w.query("google.it")
|
95
|
+
|
96
|
+
If you just need a WHOIS response and you don't care about a full control of the WHOIS client, the {Whois} module provides an all-in-one method called {Whois.whois}. This is the simplest way to send a WHOIS request.
|
97
|
+
|
98
|
+
Whois.whois("google.com")
|
99
|
+
# => #<Whois::Record>
|
100
|
+
|
101
|
+
Did I mention you can even use blocks?
|
102
|
+
|
103
|
+
Whois::Client.new do |w|
|
104
|
+
w.query("google.com")
|
105
|
+
w.query(".com")
|
106
|
+
w.query("74.125.67.100")
|
107
|
+
w.query("2001:db8::1428:57ab")
|
108
|
+
w.query("google.it")
|
109
|
+
end
|
110
|
+
|
111
|
+
### Consuming the Record
|
112
|
+
|
113
|
+
Any WHOIS query returns a `Whois::Record`. This object looks like a String, but it's way more powerful.
|
114
|
+
|
115
|
+
`Whois::Record` encapsulates a WHOIS record and provides the ability to parse the WHOIS response programmatically, by using an object oriented syntax.
|
116
|
+
|
117
|
+
r = Whois.whois("google.it")
|
118
|
+
# => #<Whois::Record>
|
119
|
+
|
120
|
+
r.available?
|
121
|
+
# => false
|
122
|
+
r.registered?
|
123
|
+
# => true
|
124
|
+
|
125
|
+
r.created_on
|
126
|
+
# => Fri Dec 10 00:00:00 +0100 1999
|
127
|
+
|
128
|
+
t = r.technical_contact
|
129
|
+
# => #<Whois::Record::Contact>
|
130
|
+
t.id
|
131
|
+
# => "TS7016-ITNIC"
|
132
|
+
t.name
|
133
|
+
# => "Technical Services"
|
134
|
+
|
135
|
+
r.nameservers.each do |nameserver|
|
136
|
+
puts nameserver
|
137
|
+
end
|
138
|
+
|
139
|
+
This feature is made possible by the *Whois* record parsers. Unfortunately, due to the lack of a global standard, each WHOIS server requires a specific parser. For this reason, the library doesn't support all existing WHOIS servers.
|
140
|
+
|
141
|
+
If you create a new parser, please consider releasing it to the public so that it can be included in a next version.
|
142
|
+
|
143
|
+
### Timeout
|
144
|
+
|
145
|
+
By default, each query run though the client has a timeout value of 5 seconds. If the execution exceeds timeout limit, the client raises a `Timeout::Error` exception.
|
146
|
+
|
147
|
+
Off course, you can customize the timeout value setting a different value. If timeout is `nil`, the client will until the response is sent back from the server or the process is killed. Don't disable the timeout unless you really know you are doing!
|
148
|
+
|
149
|
+
w = Whois::Client.new(:timeout => 10)
|
150
|
+
w.timeout # => 10
|
151
|
+
w.timeout = 5
|
152
|
+
w.timeout # => 5
|
153
|
+
|
154
|
+
w.query("google.com")
|
155
|
+
|
156
|
+
|
157
|
+
## Acknowledgments
|
158
|
+
|
159
|
+
First of all, I would like to express my most sincere thanks to Cyril Mougel, the author of the first Ruby Whois gem that has been available since 2007. Cyril has been kind enough to yield me the privilege of using the RubyForge Whois project and the Whois package name to publish this library. To express all my gratitude, the release 0.5.0 and all sub sequential versions of the new Whois up to 0.9.x are 100% compatible with Cyril's Whois.
|
160
|
+
|
161
|
+
Whois is largely inspired by other notable Whois projects, most of all the Debian Whois library written and maintained by Marco D'Itri. Other good ideas and design decisions come from the PERL `Net::DRI` package.
|
162
|
+
|
163
|
+
I would lie if I say I'm completely unaware of the other Ruby Whois projects. Before starting this Ruby Whois library I deeply investigated the available resources and, despite none of them was a good candidate for a refactoring, some of them expose a really cool API.
|
164
|
+
They didn't directly influence this library or any design decision, but they have been a really interesting code-reading.
|
165
|
+
|
166
|
+
The parser architecture has been inspired by the [PHPWhois](http://phpwhois.sourceforge.net/) project. The authors puts lot of effort to create whois-specific parsers normalizing the different responses in a single tree-based structure. So far, this is the only one open source project that offers such this feature in all the programming language ecosystem.
|
167
|
+
|
168
|
+
Despite I spent weeks reading source code from the available whois libraries, Ruby *Whois* has been built from scratch trying to focus on long-term maintainability and flexibility and cannot be considered a Ruby port of any of other existing Whois libraries.
|
169
|
+
|
170
|
+
|
171
|
+
## Credits
|
172
|
+
|
173
|
+
- [Simone Carletti](http://www.simonecarletti.com/) <weppos@weppos.net> - Author
|
174
|
+
- [Contributors](https://github.com/weppos/whois/contributors)
|
175
|
+
|
176
|
+
|
177
|
+
## Contribute
|
178
|
+
|
179
|
+
Direct questions and discussions to the [mailing list](http://groups.google.com/group/ruby-whois).
|
180
|
+
|
181
|
+
Pull requests are very welcome! Please include spec and/or feature coverage for every patch, and create a topic branch for every separate change you make.
|
182
|
+
|
183
|
+
Report issues or feature requests to [GitHub Issues](https://github.com/weppos/whois/issues).
|
184
|
+
|
185
|
+
|
186
|
+
## Donations
|
187
|
+
|
188
|
+
[Support Whois at Pledgie](http://www.pledgie.com/campaigns/11383).
|
189
|
+
|
190
|
+
<a href='http://www.pledgie.com/campaigns/11383'><img alt='Click here to lend your support to: whois and make a donation at www.pledgie.com !' src='http://www.pledgie.com/campaigns/11383.png?skin_name=chrome' border='0' /></a>
|
191
|
+
|
192
|
+
Whois is free software, but it costs money to write, test, and distribute it. You can support the development by sending a donation. **Any amount, even $5, is greatly appreciated**.
|
193
|
+
|
194
|
+
|
195
|
+
## More
|
196
|
+
|
197
|
+
- [Homepage](http://www.ruby-whois.org/)
|
198
|
+
- [Repository](https://github.com/weppos/whois)
|
199
|
+
- [Documentation](http://www.ruby-whois.org/documentation.html) - The official documentation, see also the [API Documentation](http://www.ruby-whois.org/api).
|
200
|
+
- [Discussion Group](http://groups.google.com/group/ruby-whois)
|
201
|
+
|
202
|
+
|
203
|
+
## Changelog
|
204
|
+
|
205
|
+
See the [CHANGELOG](CHANGELOG.md) file for details.
|
206
|
+
|
207
|
+
|
208
|
+
## License
|
209
|
+
|
210
|
+
Copyright (c) 2009-2012 Simone Carletti.
|
211
|
+
|
212
|
+
This is Free Software distributed under the MIT license.
|
data/Rakefile
CHANGED
@@ -26,14 +26,14 @@ spec = Gem::Specification.new do |s|
|
|
26
26
|
s.homepage = "http://www.ruby-whois.org"
|
27
27
|
s.rubyforge_project = "whois"
|
28
28
|
|
29
|
-
s.files = %w( Rakefile LICENSE .gemtest .
|
30
|
-
Dir.glob("*.{
|
29
|
+
s.files = %w( Rakefile LICENSE .gemtest .yardopts ) +
|
30
|
+
Dir.glob("*.{md,gemspec}") +
|
31
31
|
Dir.glob("{bin,lib,spec}/**/*")
|
32
32
|
s.executables = %w( ruby-whois )
|
33
33
|
s.require_paths = %w( lib )
|
34
34
|
|
35
35
|
s.add_development_dependency "rake", "~> 0.9"
|
36
|
-
s.add_development_dependency "rspec", "~> 2.
|
36
|
+
s.add_development_dependency "rspec", "~> 2.10.0"
|
37
37
|
s.add_development_dependency "mocha"
|
38
38
|
s.add_development_dependency "yard"
|
39
39
|
|
data/lib/whois.rb
CHANGED
@@ -114,8 +114,9 @@ module Whois
|
|
114
114
|
#
|
115
115
|
# @api internal
|
116
116
|
# @private
|
117
|
-
def deprecate(message = nil)
|
117
|
+
def deprecate(message = nil, callstack = caller)
|
118
118
|
message ||= "You are using deprecated behavior which will be removed from the next major or minor release."
|
119
|
+
# warn("DEPRECATION WARNING: #{message} #{deprecation_caller_message(callstack)}")
|
119
120
|
warn("DEPRECATION WARNING: #{message}")
|
120
121
|
end
|
121
122
|
|
@@ -134,6 +135,30 @@ module Whois
|
|
134
135
|
" http://github.com/weppos/whois/issues"
|
135
136
|
end
|
136
137
|
|
138
|
+
private
|
139
|
+
|
140
|
+
def deprecation_caller_message(callstack)
|
141
|
+
file, line, method = extract_callstack(callstack)
|
142
|
+
if file
|
143
|
+
if line && method
|
144
|
+
"(called from #{method} at #{file}:#{line})"
|
145
|
+
else
|
146
|
+
"(called from #{file}:#{line})"
|
147
|
+
end
|
148
|
+
end
|
149
|
+
end
|
150
|
+
|
151
|
+
def extract_callstack(callstack)
|
152
|
+
gem_root = File.expand_path("../../../", __FILE__) + "/"
|
153
|
+
offending_line = callstack.find { |line| !line.start_with?(gem_root) } || callstack.first
|
154
|
+
if offending_line
|
155
|
+
if md = offending_line.match(/^(.+?):(\d+)(?::in `(.*?)')?/)
|
156
|
+
md.captures
|
157
|
+
else
|
158
|
+
offending_line
|
159
|
+
end
|
160
|
+
end
|
161
|
+
end
|
137
162
|
end
|
138
163
|
|
139
164
|
end
|
@@ -232,7 +232,7 @@ Whois::Server.define :tld, ".np", nil, { :web => "http://register.mos.com.np/use
|
|
232
232
|
Whois::Server.define :tld, ".nr", nil, { :web => "http://www.cenpac.net.nr/dns/whois.html", :adapter => Whois::Server::Adapters::Web }
|
233
233
|
Whois::Server.define :tld, ".nu", "whois.nic.nu"
|
234
234
|
Whois::Server.define :tld, ".nz", "whois.srs.net.nz"
|
235
|
-
Whois::Server.define :tld, ".om",
|
235
|
+
Whois::Server.define :tld, ".om", "whois.registry.om"
|
236
236
|
Whois::Server.define :tld, ".pa", nil, { :web => "http://www.nic.pa/", :adapter => Whois::Server::Adapters::Web }
|
237
237
|
Whois::Server.define :tld, ".pe", "kero.yachay.pe"
|
238
238
|
Whois::Server.define :tld, ".pf", nil, { :adapter => Whois::Server::Adapters::None }
|
@@ -273,6 +273,7 @@ Whois::Server.define :tld, ".sr", nil, { :adapter => Whois::Server::Adapters::No
|
|
273
273
|
Whois::Server.define :tld, ".st", "whois.nic.st"
|
274
274
|
Whois::Server.define :tld, ".su", "whois.tcinet.ru"
|
275
275
|
Whois::Server.define :tld, ".sv", nil, { :adapter => Whois::Server::Adapters::Web, :web => "http://www.uca.edu.sv/dns/" }
|
276
|
+
Whois::Server.define :tld, ".sx", "whois.sx"
|
276
277
|
Whois::Server.define :tld, ".sy", nil, { :adapter => Whois::Server::Adapters::None }
|
277
278
|
Whois::Server.define :tld, ".sz", nil, { :adapter => Whois::Server::Adapters::None }
|
278
279
|
Whois::Server.define :tld, ".tc", "whois.adamsnames.tc"
|
@@ -284,7 +285,7 @@ Whois::Server.define :tld, ".tj", nil, { :web => "http://www.nic.tj/whois.html",
|
|
284
285
|
Whois::Server.define :tld, ".tk", "whois.dot.tk"
|
285
286
|
Whois::Server.define :tld, ".tl", "whois.nic.tl"
|
286
287
|
Whois::Server.define :tld, ".tm", "whois.nic.tm"
|
287
|
-
Whois::Server.define :tld, ".tn",
|
288
|
+
Whois::Server.define :tld, ".tn", "whois.ati.tn"
|
288
289
|
Whois::Server.define :tld, ".to", "whois.tonic.to"
|
289
290
|
Whois::Server.define :tld, ".tp", nil, { :adapter => Whois::Server::Adapters::None }
|
290
291
|
Whois::Server.define :tld, ".tr", "whois.nic.tr"
|
data/lib/whois/record.rb
CHANGED
@@ -104,12 +104,12 @@ module Whois
|
|
104
104
|
# and separates each response with a newline character.
|
105
105
|
#
|
106
106
|
# @example Record with one part
|
107
|
-
# record = Whois::Record.new([Whois::Record::Part.new("First record.")])
|
107
|
+
# record = Whois::Record.new([Whois::Record::Part.new(:body => "First record.")])
|
108
108
|
# record.content
|
109
109
|
# # => "First record."
|
110
110
|
#
|
111
111
|
# @example Record with multiple parts
|
112
|
-
# record = Whois::Record.new([Whois::Record::Part.new("First record."), Whois::Record::Part.new("Second record.")])
|
112
|
+
# record = Whois::Record.new([Whois::Record::Part.new(:body => "First record."), Whois::Record::Part.new(:body => "Second record.")])
|
113
113
|
# record.content
|
114
114
|
# # => "First record.\nSecond record."
|
115
115
|
#
|
@@ -102,7 +102,7 @@ module Whois
|
|
102
102
|
|
103
103
|
property_supported :nameservers do
|
104
104
|
Array.wrap(node("Name Server")).reject(&:empty?).map do |name|
|
105
|
-
Nameserver.new(name.downcase)
|
105
|
+
Nameserver.new(:name => name.downcase)
|
106
106
|
end
|
107
107
|
end
|
108
108
|
|
@@ -117,7 +117,7 @@ module Whois
|
|
117
117
|
end
|
118
118
|
|
119
119
|
|
120
|
-
|
120
|
+
private
|
121
121
|
|
122
122
|
def build_contact(element, type)
|
123
123
|
node("#{element} ID") do
|
@@ -70,10 +70,18 @@ module Whois
|
|
70
70
|
end
|
71
71
|
|
72
72
|
|
73
|
+
property_supported :registrar do
|
74
|
+
Record::Registrar.new(
|
75
|
+
:name => content_for_scanner.slice(/Registrar Name: (.+)\n/, 1),
|
76
|
+
:url => content_for_scanner.slice(/Registration URL: (.+)\n/, 1)
|
77
|
+
)
|
78
|
+
end
|
79
|
+
|
80
|
+
|
73
81
|
property_supported :nameservers do
|
74
82
|
if content_for_scanner =~ /Name Servers:\n((.+\n)+)\n/
|
75
83
|
$1.split("\n").map do |name|
|
76
|
-
Record::Nameserver.new(name.strip)
|
84
|
+
Record::Nameserver.new(:name => name.strip)
|
77
85
|
end
|
78
86
|
end
|
79
87
|
end
|
@@ -70,14 +70,18 @@ module Whois
|
|
70
70
|
|
71
71
|
property_supported :registrar do
|
72
72
|
node("Registrar") do |raw|
|
73
|
-
Whois::Record::Registrar.new(
|
73
|
+
Whois::Record::Registrar.new(
|
74
|
+
:name => last_useful_item(raw),
|
75
|
+
:organization => last_useful_item(raw),
|
76
|
+
:url => referral_url
|
77
|
+
)
|
74
78
|
end
|
75
79
|
end
|
76
80
|
|
77
81
|
|
78
82
|
property_supported :nameservers do
|
79
83
|
Array.wrap(node("Name Server")).reject { |value| value =~ /no nameserver/i }.map do |name|
|
80
|
-
Nameserver.new(name.downcase)
|
84
|
+
Nameserver.new(:name => name.downcase)
|
81
85
|
end
|
82
86
|
end
|
83
87
|
|
@@ -54,7 +54,7 @@ module Whois
|
|
54
54
|
property_supported :nameservers do
|
55
55
|
if content_for_scanner =~ /Nameservers\n((.+\n)+)\n/
|
56
56
|
$1.split("\n").select { |e| e =~ /Server Hostname/ }.map do |line|
|
57
|
-
Record::Nameserver.new(line.split(":").last.strip)
|
57
|
+
Record::Nameserver.new(:name => line.split(":").last.strip)
|
58
58
|
end
|
59
59
|
end
|
60
60
|
end
|
@@ -0,0 +1,133 @@
|
|
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.ati.tn.rb'
|
12
|
+
|
13
|
+
|
14
|
+
module Whois
|
15
|
+
class Record
|
16
|
+
class Parser
|
17
|
+
|
18
|
+
# Parser for the whois.ati.tn 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 WhoisAtiTn < Base
|
25
|
+
include Scanners::Ast
|
26
|
+
|
27
|
+
property_supported :disclaimer do
|
28
|
+
node("field:disclaimer")
|
29
|
+
end
|
30
|
+
|
31
|
+
|
32
|
+
property_supported :domain do
|
33
|
+
node("Domain")
|
34
|
+
end
|
35
|
+
|
36
|
+
property_not_supported :domain_id
|
37
|
+
|
38
|
+
|
39
|
+
property_not_supported :referral_whois
|
40
|
+
|
41
|
+
property_not_supported :referral_url
|
42
|
+
|
43
|
+
|
44
|
+
property_supported :status do
|
45
|
+
if available?
|
46
|
+
:available
|
47
|
+
else
|
48
|
+
:registered
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
52
|
+
property_supported :available? do
|
53
|
+
!!node("status:available")
|
54
|
+
end
|
55
|
+
|
56
|
+
property_supported :registered? do
|
57
|
+
!available?
|
58
|
+
end
|
59
|
+
|
60
|
+
|
61
|
+
property_supported :created_on do
|
62
|
+
node("Acivated") { |value| Time.parse(value) }
|
63
|
+
end
|
64
|
+
|
65
|
+
property_not_supported :updated_on
|
66
|
+
|
67
|
+
property_not_supported :expires_on
|
68
|
+
|
69
|
+
|
70
|
+
property_supported :registrar do
|
71
|
+
node("Registrar") do |str|
|
72
|
+
Record::Registrar.new(
|
73
|
+
:id => nil,
|
74
|
+
:name => node("Registrar")
|
75
|
+
)
|
76
|
+
end
|
77
|
+
end
|
78
|
+
|
79
|
+
|
80
|
+
property_supported :registrant_contacts do
|
81
|
+
build_contact("Owner", Whois::Record::Contact::TYPE_REGISTRANT)
|
82
|
+
end
|
83
|
+
|
84
|
+
property_supported :admin_contacts do
|
85
|
+
build_contact("Admin.", Whois::Record::Contact::TYPE_ADMIN)
|
86
|
+
end
|
87
|
+
|
88
|
+
property_supported :technical_contacts do
|
89
|
+
build_contact("Tech.", Whois::Record::Contact::TYPE_TECHNICAL)
|
90
|
+
end
|
91
|
+
|
92
|
+
|
93
|
+
property_supported :nameservers do
|
94
|
+
Array.wrap(node("NameServers")).map do |line|
|
95
|
+
name, ipv4 = line.match(/(.+)\. \[(.+)\]/)[1, 2]
|
96
|
+
Nameserver.new(:name => name, :ipv4 => ipv4)
|
97
|
+
end
|
98
|
+
end
|
99
|
+
|
100
|
+
|
101
|
+
# Initializes a new {Scanners::WhoisAtiTn} instance
|
102
|
+
# passing the {#content_for_scanner}
|
103
|
+
# and calls +parse+ on it.
|
104
|
+
#
|
105
|
+
# @return [Hash]
|
106
|
+
def parse
|
107
|
+
Scanners::WhoisAtiTn.new(content_for_scanner).parse
|
108
|
+
end
|
109
|
+
|
110
|
+
|
111
|
+
private
|
112
|
+
|
113
|
+
def build_contact(element, type)
|
114
|
+
node("#{element} Name") do
|
115
|
+
Record::Contact.new(
|
116
|
+
:type => type,
|
117
|
+
:id => nil,
|
118
|
+
:name => node("#{element} Name"),
|
119
|
+
:address => node("#{element} Address"),
|
120
|
+
:phone => node("#{element} Tel"),
|
121
|
+
:fax => node("#{element} Fax"),
|
122
|
+
:email => node("#{element} Email"),
|
123
|
+
:created_on => node("#{element} Created") { |value| Time.parse(value) },
|
124
|
+
:updated_on => node("#{element} Updated") { |value| Time.parse(value) }
|
125
|
+
)
|
126
|
+
end
|
127
|
+
end
|
128
|
+
|
129
|
+
end
|
130
|
+
|
131
|
+
end
|
132
|
+
end
|
133
|
+
end
|