whois-parser 0.0.1 → 1.0.0.pre.beta1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.yardopts +2 -0
- data/CHANGELOG.md +20 -0
- data/CONTRIBUTING.md +40 -0
- data/LICENSE.txt +17 -18
- data/README.md +6 -24
- data/lib/whois/parser/contact.rb +56 -0
- data/lib/whois/parser/errors.rb +46 -0
- data/lib/whois/parser/nameserver.rb +39 -0
- data/lib/whois/parser/registrar.rb +25 -0
- data/lib/whois/parser/super_struct.rb +53 -0
- data/lib/whois/parser/version.rb +3 -2
- data/lib/whois/parser.rb +407 -3
- data/lib/whois/parser_extensions/whois.rb +78 -0
- data/lib/whois/parser_extensions/whois_record.rb +222 -0
- data/lib/whois/parser_extensions.rb +9 -0
- data/lib/whois/parsers/base.rb +412 -0
- data/lib/whois/parsers/base_afilias.rb +139 -0
- data/lib/whois/parsers/base_afilias2.rb +140 -0
- data/lib/whois/parsers/base_cocca.rb +97 -0
- data/lib/whois/parsers/base_cocca2.rb +91 -0
- data/lib/whois/parsers/base_icann_compliant.rb +150 -0
- data/lib/whois/parsers/base_icb.rb +92 -0
- data/lib/whois/parsers/base_iisse.rb +113 -0
- data/lib/whois/parsers/base_nic_fr.rb +169 -0
- data/lib/whois/parsers/base_shared1.rb +108 -0
- data/lib/whois/parsers/base_shared2.rb +127 -0
- data/lib/whois/parsers/base_shared3.rb +127 -0
- data/lib/whois/parsers/base_verisign.rb +106 -0
- data/lib/whois/parsers/base_whoisd.rb +145 -0
- data/lib/whois/parsers/blank.rb +35 -0
- data/lib/whois/parsers/capetown-whois.registry.net.za.rb +25 -0
- data/lib/whois/parsers/ccwhois.ksregistry.net.rb +25 -0
- data/lib/whois/parsers/ccwhois.verisign-grs.com.rb +25 -0
- data/lib/whois/parsers/durban-whois.registry.net.za.rb +25 -0
- data/lib/whois/parsers/example.rb +163 -0
- data/lib/whois/parsers/joburg-whois.registry.net.za.rb +25 -0
- data/lib/whois/parsers/kero.yachay.pe.rb +86 -0
- data/lib/whois/parsers/org-whois.registry.net.za.rb +25 -0
- data/lib/whois/parsers/tvwhois.verisign-grs.com.rb +25 -0
- data/lib/whois/parsers/whois.1und1.info.rb +28 -0
- data/lib/whois/parsers/whois.35.com.rb +23 -0
- data/lib/whois/parsers/whois.aeda.net.ae.rb +64 -0
- data/lib/whois/parsers/whois.aero.rb +58 -0
- data/lib/whois/parsers/whois.afilias-grs.info.rb +21 -0
- data/lib/whois/parsers/whois.afilias.net.rb +41 -0
- data/lib/whois/parsers/whois.ai.rb +62 -0
- data/lib/whois/parsers/whois.amnic.net.rb +79 -0
- data/lib/whois/parsers/whois.ascio.com.rb +29 -0
- data/lib/whois/parsers/whois.ati.tn.rb +116 -0
- data/lib/whois/parsers/whois.audns.net.au.rb +118 -0
- data/lib/whois/parsers/whois.ax.rb +64 -0
- data/lib/whois/parsers/whois.biz.rb +25 -0
- data/lib/whois/parsers/whois.bnnic.bn.rb +75 -0
- data/lib/whois/parsers/whois.cat.rb +75 -0
- data/lib/whois/parsers/whois.cctld.by.rb +94 -0
- data/lib/whois/parsers/whois.cctld.uz.rb +79 -0
- data/lib/whois/parsers/whois.centralnic.com.rb +140 -0
- data/lib/whois/parsers/whois.cira.ca.rb +192 -0
- data/lib/whois/parsers/whois.cmc.iq.rb +25 -0
- data/lib/whois/parsers/whois.cnnic.cn.rb +108 -0
- data/lib/whois/parsers/whois.co.ca.rb +74 -0
- data/lib/whois/parsers/whois.co.pl.rb +82 -0
- data/lib/whois/parsers/whois.co.ug.rb +82 -0
- data/lib/whois/parsers/whois.comlaude.com.rb +113 -0
- data/lib/whois/parsers/whois.corporatedomains.com.rb +28 -0
- data/lib/whois/parsers/whois.denic.de.rb +164 -0
- data/lib/whois/parsers/whois.dk-hostmaster.dk.rb +88 -0
- data/lib/whois/parsers/whois.dns.be.rb +120 -0
- data/lib/whois/parsers/whois.dns.hr.rb +97 -0
- data/lib/whois/parsers/whois.dns.lu.rb +126 -0
- data/lib/whois/parsers/whois.dns.pl.rb +151 -0
- data/lib/whois/parsers/whois.dns.pt.rb +77 -0
- data/lib/whois/parsers/whois.domain-registry.nl.rb +123 -0
- data/lib/whois/parsers/whois.domain.kg.rb +76 -0
- data/lib/whois/parsers/whois.domainregistry.ie.rb +121 -0
- data/lib/whois/parsers/whois.domreg.lt.rb +68 -0
- data/lib/whois/parsers/whois.donuts.co.rb +61 -0
- data/lib/whois/parsers/whois.dot.cf.rb +71 -0
- data/lib/whois/parsers/whois.dot.tk.rb +70 -0
- data/lib/whois/parsers/whois.dotgov.gov.rb +61 -0
- data/lib/whois/parsers/whois.dotmobiregistry.net.rb +21 -0
- data/lib/whois/parsers/whois.dotpostregistry.net.rb +25 -0
- data/lib/whois/parsers/whois.dreamhost.com.rb +23 -0
- data/lib/whois/parsers/whois.educause.edu.rb +200 -0
- data/lib/whois/parsers/whois.eenet.ee.rb +72 -0
- data/lib/whois/parsers/whois.enom.com.rb +34 -0
- data/lib/whois/parsers/whois.eu.org.rb +58 -0
- data/lib/whois/parsers/whois.eu.rb +130 -0
- data/lib/whois/parsers/whois.fi.rb +117 -0
- data/lib/whois/parsers/whois.gandi.net.rb +30 -0
- data/lib/whois/parsers/whois.gg.rb +31 -0
- data/lib/whois/parsers/whois.godaddy.com.rb +112 -0
- data/lib/whois/parsers/whois.gov.za.rb +60 -0
- data/lib/whois/parsers/whois.hkirc.hk.rb +70 -0
- data/lib/whois/parsers/whois.iana.org.rb +102 -0
- data/lib/whois/parsers/whois.iis.nu.rb +26 -0
- data/lib/whois/parsers/whois.iis.se.rb +26 -0
- data/lib/whois/parsers/whois.in.ua.rb +75 -0
- data/lib/whois/parsers/whois.inregistry.net.rb +27 -0
- data/lib/whois/parsers/whois.isnic.is.rb +70 -0
- data/lib/whois/parsers/whois.isoc.org.il.rb +75 -0
- data/lib/whois/parsers/whois.ja.net.rb +75 -0
- data/lib/whois/parsers/whois.je.rb +25 -0
- data/lib/whois/parsers/whois.jprs.jp.rb +103 -0
- data/lib/whois/parsers/whois.kenic.or.ke.rb +91 -0
- data/lib/whois/parsers/whois.kr.rb +79 -0
- data/lib/whois/parsers/whois.markmonitor.com.rb +36 -0
- data/lib/whois/parsers/whois.monic.mo.rb +83 -0
- data/lib/whois/parsers/whois.museum.rb +79 -0
- data/lib/whois/parsers/whois.mynic.my.rb +72 -0
- data/lib/whois/parsers/whois.na-nic.com.na.rb +21 -0
- data/lib/whois/parsers/whois.nc.rb +122 -0
- data/lib/whois/parsers/whois.netcom.cm.rb +26 -0
- data/lib/whois/parsers/whois.networksolutions.com.rb +37 -0
- data/lib/whois/parsers/whois.nic.ac.rb +25 -0
- data/lib/whois/parsers/whois.nic.af.rb +25 -0
- data/lib/whois/parsers/whois.nic.ag.rb +21 -0
- data/lib/whois/parsers/whois.nic.as.rb +63 -0
- data/lib/whois/parsers/whois.nic.asia.rb +107 -0
- data/lib/whois/parsers/whois.nic.at.rb +64 -0
- data/lib/whois/parsers/whois.nic.bj.rb +126 -0
- data/lib/whois/parsers/whois.nic.bo.rb +73 -0
- data/lib/whois/parsers/whois.nic.cd.rb +34 -0
- data/lib/whois/parsers/whois.nic.ch.rb +109 -0
- data/lib/whois/parsers/whois.nic.ci.rb +70 -0
- data/lib/whois/parsers/whois.nic.cl.rb +71 -0
- data/lib/whois/parsers/whois.nic.co.rb +25 -0
- data/lib/whois/parsers/whois.nic.college.rb +25 -0
- data/lib/whois/parsers/whois.nic.coop.rb +70 -0
- data/lib/whois/parsers/whois.nic.cx.rb +25 -0
- data/lib/whois/parsers/whois.nic.cz.rb +42 -0
- data/lib/whois/parsers/whois.nic.design.rb +25 -0
- data/lib/whois/parsers/whois.nic.dm.rb +25 -0
- data/lib/whois/parsers/whois.nic.dz.rb +58 -0
- data/lib/whois/parsers/whois.nic.ec.rb +34 -0
- data/lib/whois/parsers/whois.nic.es.rb +105 -0
- data/lib/whois/parsers/whois.nic.fo.rb +43 -0
- data/lib/whois/parsers/whois.nic.fr.rb +25 -0
- data/lib/whois/parsers/whois.nic.gd.rb +31 -0
- data/lib/whois/parsers/whois.nic.gl.rb +25 -0
- data/lib/whois/parsers/whois.nic.gs.rb +31 -0
- data/lib/whois/parsers/whois.nic.hn.rb +25 -0
- data/lib/whois/parsers/whois.nic.ht.rb +25 -0
- data/lib/whois/parsers/whois.nic.hu.rb +78 -0
- data/lib/whois/parsers/whois.nic.im.rb +66 -0
- data/lib/whois/parsers/whois.nic.io.rb +48 -0
- data/lib/whois/parsers/whois.nic.ir.rb +66 -0
- data/lib/whois/parsers/whois.nic.it.rb +159 -0
- data/lib/whois/parsers/whois.nic.jobs.rb +25 -0
- data/lib/whois/parsers/whois.nic.ki.rb +25 -0
- data/lib/whois/parsers/whois.nic.kz.rb +67 -0
- data/lib/whois/parsers/whois.nic.la.rb +25 -0
- data/lib/whois/parsers/whois.nic.li.rb +64 -0
- data/lib/whois/parsers/whois.nic.lk.rb +109 -0
- data/lib/whois/parsers/whois.nic.lv.rb +65 -0
- data/lib/whois/parsers/whois.nic.ly.rb +76 -0
- data/lib/whois/parsers/whois.nic.md.rb +94 -0
- data/lib/whois/parsers/whois.nic.me.rb +85 -0
- data/lib/whois/parsers/whois.nic.mg.rb +31 -0
- data/lib/whois/parsers/whois.nic.ms.rb +25 -0
- data/lib/whois/parsers/whois.nic.mu.rb +25 -0
- data/lib/whois/parsers/whois.nic.mx.rb +79 -0
- data/lib/whois/parsers/whois.nic.name.rb +68 -0
- data/lib/whois/parsers/whois.nic.net.ng.rb +27 -0
- data/lib/whois/parsers/whois.nic.net.sa.rb +70 -0
- data/lib/whois/parsers/whois.nic.net.sb.rb +31 -0
- data/lib/whois/parsers/whois.nic.nf.rb +25 -0
- data/lib/whois/parsers/whois.nic.org.uy.rb +75 -0
- data/lib/whois/parsers/whois.nic.pm.rb +25 -0
- data/lib/whois/parsers/whois.nic.pr.rb +84 -0
- data/lib/whois/parsers/whois.nic.priv.at.rb +62 -0
- data/lib/whois/parsers/whois.nic.pw.rb +25 -0
- data/lib/whois/parsers/whois.nic.re.rb +25 -0
- data/lib/whois/parsers/whois.nic.sh.rb +25 -0
- data/lib/whois/parsers/whois.nic.sl.rb +76 -0
- data/lib/whois/parsers/whois.nic.sm.rb +76 -0
- data/lib/whois/parsers/whois.nic.sn.rb +113 -0
- data/lib/whois/parsers/whois.nic.so.rb +70 -0
- data/lib/whois/parsers/whois.nic.space.rb +25 -0
- data/lib/whois/parsers/whois.nic.st.rb +72 -0
- data/lib/whois/parsers/whois.nic.tc.rb +25 -0
- data/lib/whois/parsers/whois.nic.tech.rb +25 -0
- data/lib/whois/parsers/whois.nic.tel.rb +25 -0
- data/lib/whois/parsers/whois.nic.tl.rb +25 -0
- data/lib/whois/parsers/whois.nic.tm.rb +31 -0
- data/lib/whois/parsers/whois.nic.tr.rb +159 -0
- data/lib/whois/parsers/whois.nic.travel.rb +25 -0
- data/lib/whois/parsers/whois.nic.uk.rb +177 -0
- data/lib/whois/parsers/whois.nic.us.rb +25 -0
- data/lib/whois/parsers/whois.nic.ve.rb +87 -0
- data/lib/whois/parsers/whois.nic.wf.rb +25 -0
- data/lib/whois/parsers/whois.nic.xxx.rb +42 -0
- data/lib/whois/parsers/whois.nic.xyz.rb +25 -0
- data/lib/whois/parsers/whois.norid.no.rb +61 -0
- data/lib/whois/parsers/whois.pairnic.com.rb +28 -0
- data/lib/whois/parsers/whois.pandi.or.id.rb +25 -0
- data/lib/whois/parsers/whois.pir.org.rb +90 -0
- data/lib/whois/parsers/whois.pnina.ps.rb +31 -0
- data/lib/whois/parsers/whois.register.bg.rb +83 -0
- data/lib/whois/parsers/whois.register.com.rb +30 -0
- data/lib/whois/parsers/whois.register.si.rb +73 -0
- data/lib/whois/parsers/whois.registre.ma.rb +63 -0
- data/lib/whois/parsers/whois.registro.br.rb +73 -0
- data/lib/whois/parsers/whois.registry.gy.rb +25 -0
- data/lib/whois/parsers/whois.registry.hm.rb +72 -0
- data/lib/whois/parsers/whois.registry.net.za.rb +139 -0
- data/lib/whois/parsers/whois.registry.om.rb +40 -0
- data/lib/whois/parsers/whois.registry.qa.rb +25 -0
- data/lib/whois/parsers/whois.ripe.net.rb +68 -0
- data/lib/whois/parsers/whois.rnids.rs.rb +134 -0
- data/lib/whois/parsers/whois.rotld.ro.rb +65 -0
- data/lib/whois/parsers/whois.rrpproxy.net.rb +32 -0
- data/lib/whois/parsers/whois.safenames.net.rb +48 -0
- data/lib/whois/parsers/whois.schlund.info.rb +34 -0
- data/lib/whois/parsers/whois.sgnic.sg.rb +87 -0
- data/lib/whois/parsers/whois.sk-nic.sk.rb +101 -0
- data/lib/whois/parsers/whois.smallregistry.net.rb +131 -0
- data/lib/whois/parsers/whois.srs.net.nz.rb +159 -0
- data/lib/whois/parsers/whois.sx.rb +127 -0
- data/lib/whois/parsers/whois.tcinet.ru.rb +114 -0
- data/lib/whois/parsers/whois.thnic.co.th.rb +79 -0
- data/lib/whois/parsers/whois.tld.ee.rb +134 -0
- data/lib/whois/parsers/whois.tld.sy.rb +34 -0
- data/lib/whois/parsers/whois.tonic.to.rb +86 -0
- data/lib/whois/parsers/whois.tucows.com.rb +28 -0
- data/lib/whois/parsers/whois.twnic.net.tw.rb +72 -0
- data/lib/whois/parsers/whois.tznic.or.tz.rb +25 -0
- data/lib/whois/parsers/whois.ua.rb +240 -0
- data/lib/whois/parsers/whois.udag.net.rb +28 -0
- data/lib/whois/parsers/whois.uniregistry.net.rb +61 -0
- data/lib/whois/parsers/whois.usp.ac.fj.rb +72 -0
- data/lib/whois/parsers/whois.verisign-grs.com.rb +49 -0
- data/lib/whois/parsers/whois.website.ws.rb +74 -0
- data/lib/whois/parsers/whois.wildwestdomains.com.rb +37 -0
- data/lib/whois/parsers/whois.yoursrs.com.rb +125 -0
- data/lib/whois/parsers/whois.za.net.rb +72 -0
- data/lib/whois/parsers/whois.za.org.rb +72 -0
- data/lib/whois/parsers/whois1.nic.bi.rb +25 -0
- data/lib/whois/parsers/za_central_registry.rb +68 -0
- data/lib/whois/parsers.rb +4 -0
- data/lib/whois/safe_record.rb +169 -0
- data/lib/whois/scanners/base.rb +116 -0
- data/lib/whois/scanners/base_afilias.rb +51 -0
- data/lib/whois/scanners/base_cocca2.rb +43 -0
- data/lib/whois/scanners/base_icann_compliant.rb +45 -0
- data/lib/whois/scanners/base_iisse.rb +36 -0
- data/lib/whois/scanners/base_shared1.rb +31 -0
- data/lib/whois/scanners/base_shared2.rb +35 -0
- data/lib/whois/scanners/base_shared3.rb +37 -0
- data/lib/whois/scanners/base_whoisd.rb +44 -0
- data/lib/whois/scanners/iana.rb +89 -0
- data/lib/whois/scanners/scannable.rb +65 -0
- data/lib/whois/scanners/verisign.rb +100 -0
- data/lib/whois/scanners/whois.ati.tn.rb +32 -0
- data/lib/whois/scanners/whois.audns.net.au.rb +25 -0
- data/lib/whois/scanners/whois.cctld.by.rb +35 -0
- data/lib/whois/scanners/whois.centralnic.com.rb +32 -0
- data/lib/whois/scanners/whois.cira.ca.rb +72 -0
- data/lib/whois/scanners/whois.cnnic.cn.rb +42 -0
- data/lib/whois/scanners/whois.denic.de.rb +96 -0
- data/lib/whois/scanners/whois.dns.hr.rb +25 -0
- data/lib/whois/scanners/whois.domainregistry.ie.rb +46 -0
- data/lib/whois/scanners/whois.fi.rb +39 -0
- data/lib/whois/scanners/whois.nc.rb +32 -0
- data/lib/whois/scanners/whois.nic.cz.rb +22 -0
- data/lib/whois/scanners/whois.nic.it.rb +92 -0
- data/lib/whois/scanners/whois.pir.org.rb +17 -0
- data/lib/whois/scanners/whois.registry.net.za.rb +92 -0
- data/lib/whois/scanners/whois.rnids.rs.rb +52 -0
- data/lib/whois/scanners/whois.smallregistry.net.rb +50 -0
- data/lib/whois/scanners/whois.srs.net.nz.rb +23 -0
- data/lib/whois/scanners/whois.sx.rb +37 -0
- data/lib/whois/scanners/whois.tld.ee.rb +47 -0
- data/lib/whois/scanners/whois.tucows.com.rb +23 -0
- data/lib/whois/scanners/whois.yoursrs.com.rb +24 -0
- data/lib/whois-parser.rb +10 -0
- data/whois-parser.gemspec +37 -19
- metadata +318 -20
- data/.gitignore +0 -14
- data/Gemfile +0 -4
- data/Rakefile +0 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: af38e1acd98423594909a861cb24844f20750ad3
|
4
|
+
data.tar.gz: 0018ffd2edd5fd685d8767fedd598b9e00a708c5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fd44abb95f7be9e4d60cbd8c63e14a9e2272770aea82ced954f57d5ba40225ff2ef9b58cc26be35a93b305edd741d4a835d3c686fdc5801fff6d0cf84d7bd205
|
7
|
+
data.tar.gz: c7e36ae017065a96f41b096c59bcb909c3da4bf2bd92ac9b68ad5c210ff798dd74753dc944890cff5c2a929e614b4873e74d292b5d8657e5ff79fe1e863ab902
|
data/.yardopts
ADDED
data/CHANGELOG.md
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
# Changelog
|
2
|
+
|
3
|
+
This project uses [Semantic Versioning 2.0.0](http://semver.org/).
|
4
|
+
|
5
|
+
|
6
|
+
##### master
|
7
|
+
|
8
|
+
Initial import from the `whois` library.
|
9
|
+
|
10
|
+
- NEW: whois.dk-hostmaster.dk parser now recognizes throttled responses (whois/GH-382). [Thanks @troelskn]
|
11
|
+
|
12
|
+
- NEW: Safer time parsing (GH-18). [Thanks @davidcornu]
|
13
|
+
|
14
|
+
- NEW: Detect reserved .INFO domains (whois/GH-468).
|
15
|
+
|
16
|
+
- FIXED: whois.audns.net.au removed the registrar ID field (GH-20, GH-21). Thanks [@afoster]
|
17
|
+
|
18
|
+
- CHANGED: Updated .JOBS from obswhois.verisign-grs.com to whois.nic.jobs (GH-23).
|
19
|
+
|
20
|
+
- CHANGED: Updated .PRO from whois.dotproregistry.net to whois.afilias.net (GH-24).
|
data/CONTRIBUTING.md
ADDED
@@ -0,0 +1,40 @@
|
|
1
|
+
# Contributing
|
2
|
+
|
3
|
+
## Workflow
|
4
|
+
|
5
|
+
Fork, then clone the repo:
|
6
|
+
|
7
|
+
$ git clone git@github.com:your-username/whois-parser.git
|
8
|
+
|
9
|
+
Set up your machine:
|
10
|
+
|
11
|
+
$ bundle
|
12
|
+
|
13
|
+
Make sure the tests pass:
|
14
|
+
|
15
|
+
$ bundle exec rake
|
16
|
+
|
17
|
+
To propose a change/feature/patch, create your feature branch:
|
18
|
+
|
19
|
+
$ git checkout -b my-new-feature
|
20
|
+
|
21
|
+
Make your change. Add tests for your change. Make the tests pass:
|
22
|
+
|
23
|
+
$ bundle exec rake
|
24
|
+
|
25
|
+
`utils/mkwhois.rb` can be used to quicky generate `status_available.txt` and `status_registered.txt` files for your tests
|
26
|
+
|
27
|
+
$ ruby utils/mkwhois.rb google.com status_available
|
28
|
+
|
29
|
+
Commit your changes:
|
30
|
+
|
31
|
+
$ git commit -am 'Add some feature'
|
32
|
+
|
33
|
+
Push to your fork and [submit a pull request](https://github.com/weppos/whois-parser/compare/).
|
34
|
+
|
35
|
+
|
36
|
+
## Tests
|
37
|
+
|
38
|
+
To increase the chance that your pull request is accepted please **make sure to write tests**. Changes without corresponding tests will likely not be included as they will produce fragile code that can easily break whenever the registry changes the response format.
|
39
|
+
|
40
|
+
Some examples: [84dbdde320f31c20184bcfe5e544e8fd3cd32862](https://github.com/weppos/whois/commit/84dbdde320f31c20184bcfe5e544e8fd3cd32862), [3b6688b95e6fadcf720cc777ef4bbd2cd644e62b](https://github.com/weppos/whois/commit/3b6688b95e6fadcf720cc777ef4bbd2cd644e62b)
|
data/LICENSE.txt
CHANGED
@@ -1,22 +1,21 @@
|
|
1
|
-
|
1
|
+
The MIT License (MIT)
|
2
2
|
|
3
|
-
|
3
|
+
Copyright (c) 2009-2015 Simone Carletti
|
4
4
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
the following conditions:
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
12
11
|
|
13
|
-
The above copyright notice and this permission notice shall be
|
14
|
-
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
13
|
+
copies or substantial portions of the Software.
|
15
14
|
|
16
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
OF
|
22
|
-
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
+
SOFTWARE.
|
data/README.md
CHANGED
@@ -1,31 +1,13 @@
|
|
1
|
-
# Whois
|
1
|
+
# [Whois](http://whoisrb.org/) Parser
|
2
2
|
|
3
|
-
|
3
|
+
[![Build Status](https://travis-ci.org/weppos/whois-parser.svg?branch=master)](https://travis-ci.org/weppos/whois-parser)
|
4
4
|
|
5
|
-
## Installation
|
6
5
|
|
7
|
-
|
6
|
+
## Versioning
|
8
7
|
|
9
|
-
|
10
|
-
gem 'whois-parser'
|
11
|
-
```
|
8
|
+
<tt>Whois::Parser</tt> uses [Semantic Versioning 2.0.0](http://semver.org)
|
12
9
|
|
13
|
-
And then execute:
|
14
10
|
|
15
|
-
|
11
|
+
## License
|
16
12
|
|
17
|
-
|
18
|
-
|
19
|
-
$ gem install whois-parser
|
20
|
-
|
21
|
-
## Usage
|
22
|
-
|
23
|
-
TODO: Write usage instructions here
|
24
|
-
|
25
|
-
## Contributing
|
26
|
-
|
27
|
-
1. Fork it ( https://github.com/[my-github-username]/whois-parser/fork )
|
28
|
-
2. Create your feature branch (`git checkout -b my-new-feature`)
|
29
|
-
3. Commit your changes (`git commit -am 'Add some feature'`)
|
30
|
-
4. Push to the branch (`git push origin my-new-feature`)
|
31
|
-
5. Create a new Pull Request
|
13
|
+
Copyright (c) 2009-2015 Simone Carletti. This is Free Software distributed under the MIT license.
|
@@ -0,0 +1,56 @@
|
|
1
|
+
require_relative 'super_struct'
|
2
|
+
|
3
|
+
|
4
|
+
module Whois
|
5
|
+
class Parser
|
6
|
+
|
7
|
+
# Holds the details of a contact extracted from the WHOIS response.
|
8
|
+
#
|
9
|
+
# A contact is composed by the several attributes,
|
10
|
+
# accessible through corresponding getter / setter methods.
|
11
|
+
#
|
12
|
+
# Please note that a response is not required to provide
|
13
|
+
# all the attributes. When an attribute is not available,
|
14
|
+
# the corresponding value is set to nil.
|
15
|
+
#
|
16
|
+
# @attr [String] id
|
17
|
+
# @attr [String] type
|
18
|
+
# @attr [String] name
|
19
|
+
# @attr [String] organization
|
20
|
+
# @attr [String] address
|
21
|
+
# @attr [String] city
|
22
|
+
# @attr [String] zip
|
23
|
+
# @attr [String] state
|
24
|
+
# @attr [String] country
|
25
|
+
# @attr [String] country_code
|
26
|
+
# @attr [String] phone
|
27
|
+
# @attr [String] fax
|
28
|
+
# @attr [String] email
|
29
|
+
# @attr [String] url - e. g. to the contact form
|
30
|
+
# @attr [Time] created_on
|
31
|
+
# @attr [Time] updated_on
|
32
|
+
#
|
33
|
+
class Contact < SuperStruct.new(:id, :type, :name, :organization,
|
34
|
+
:address, :city, :zip, :state, :country, :country_code,
|
35
|
+
:phone, :fax, :email, :url,
|
36
|
+
:created_on, :updated_on)
|
37
|
+
|
38
|
+
TYPE_REGISTRANT = 1
|
39
|
+
TYPE_ADMINISTRATIVE = 2
|
40
|
+
TYPE_TECHNICAL = 3
|
41
|
+
|
42
|
+
|
43
|
+
def self.const_missing(name)
|
44
|
+
case name
|
45
|
+
when :TYPE_ADMIN
|
46
|
+
Whois.deprecate("Whois::Record::Contact::TYPE_ADMIN is now Whois::Record::Contact::TYPE_ADMINISTRATIVE")
|
47
|
+
self.const_set(name, TYPE_ADMINISTRATIVE)
|
48
|
+
else
|
49
|
+
super
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
53
|
+
end
|
54
|
+
|
55
|
+
end
|
56
|
+
end
|
@@ -0,0 +1,46 @@
|
|
1
|
+
module Whois
|
2
|
+
|
3
|
+
# @!group Parser
|
4
|
+
|
5
|
+
# Generic class for parser errors.
|
6
|
+
class ParserError < Error
|
7
|
+
end
|
8
|
+
|
9
|
+
# Raised when the library hasn't been able to load a valid parser
|
10
|
+
# according to current settings and you're trying to access a property
|
11
|
+
# that requires a valid parser.
|
12
|
+
class ParserNotFound < ParserError
|
13
|
+
end
|
14
|
+
|
15
|
+
# Raised when you are trying to access an attribute that has not been implemented.
|
16
|
+
class AttributeNotImplemented < ParserError
|
17
|
+
end
|
18
|
+
|
19
|
+
# Raised when you are trying to access an attribute that is not supported.
|
20
|
+
class AttributeNotSupported < ParserError
|
21
|
+
end
|
22
|
+
|
23
|
+
# @!endgroup
|
24
|
+
|
25
|
+
|
26
|
+
# @!group Response
|
27
|
+
|
28
|
+
# Generic class for response errors.
|
29
|
+
class ResponseError < Error
|
30
|
+
end
|
31
|
+
|
32
|
+
# Raised when attempting to access a property when the response is throttled.
|
33
|
+
#
|
34
|
+
# @see Whois::Parsers::Base#response_throttled?
|
35
|
+
class ResponseIsThrottled < ResponseError
|
36
|
+
end
|
37
|
+
|
38
|
+
# Raised when attempting to access a property when the response is unavailable.
|
39
|
+
#
|
40
|
+
# @see Whois::Parsers::Base#response_unavailable?
|
41
|
+
class ResponseIsUnavailable < ResponseError
|
42
|
+
end
|
43
|
+
|
44
|
+
# @!endgroup
|
45
|
+
|
46
|
+
end
|
@@ -0,0 +1,39 @@
|
|
1
|
+
require_relative 'super_struct'
|
2
|
+
|
3
|
+
|
4
|
+
module Whois
|
5
|
+
class Parser
|
6
|
+
|
7
|
+
# Holds the details of the Name Servers extracted from the WHOIS response.
|
8
|
+
#
|
9
|
+
# A name server is composed by the several attributes,
|
10
|
+
# accessible through corresponding getter / setter methods.
|
11
|
+
#
|
12
|
+
# Please note that a response is not required to provide
|
13
|
+
# all the attributes. When an attribute is not available,
|
14
|
+
# the corresponding value is set to nil.
|
15
|
+
#
|
16
|
+
# @attr [String] name
|
17
|
+
# @attr [String] ipv4
|
18
|
+
# @attr [String] ipv6
|
19
|
+
#
|
20
|
+
class Nameserver < SuperStruct.new(:name, :ipv4, :ipv6)
|
21
|
+
|
22
|
+
# Returns a string representation of this object
|
23
|
+
# composed by the host +name+.
|
24
|
+
#
|
25
|
+
# @example
|
26
|
+
# Nameserver.new(:name => "ns.example.com").to_s
|
27
|
+
# # => "ns.example.com"
|
28
|
+
# Nameserver.new.to_s
|
29
|
+
# # => ""
|
30
|
+
#
|
31
|
+
# @return [String] The string representation.
|
32
|
+
def to_s
|
33
|
+
name.to_s
|
34
|
+
end
|
35
|
+
|
36
|
+
end
|
37
|
+
|
38
|
+
end
|
39
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
require_relative 'super_struct'
|
2
|
+
|
3
|
+
|
4
|
+
module Whois
|
5
|
+
class Parser
|
6
|
+
|
7
|
+
# Holds the details of the Registrar extracted from the WHOIS response.
|
8
|
+
#
|
9
|
+
# A registrar is composed by the several attributes,
|
10
|
+
# accessible through corresponding getter / setter methods.
|
11
|
+
#
|
12
|
+
# Please note that a response is not required to provide
|
13
|
+
# all the attributes. When an attribute is not available,
|
14
|
+
# the corresponding value is set to nil.
|
15
|
+
#
|
16
|
+
# @attr [String] id
|
17
|
+
# @attr [String] name
|
18
|
+
# @attr [String] organization
|
19
|
+
# @attr [String] url
|
20
|
+
#
|
21
|
+
class Registrar < SuperStruct.new(:id, :name, :organization, :url)
|
22
|
+
end
|
23
|
+
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,53 @@
|
|
1
|
+
require 'ostruct'
|
2
|
+
|
3
|
+
|
4
|
+
# SuperStruct is an enhanced version of the Ruby Standard library {Struct}.
|
5
|
+
#
|
6
|
+
# Compared with the original version, it provides the following additional features:
|
7
|
+
# * ability to initialize an instance from Hash
|
8
|
+
# * ability to pass a block on creation
|
9
|
+
#
|
10
|
+
class SuperStruct < Struct
|
11
|
+
|
12
|
+
# Overwrites the standard {Struct} initializer
|
13
|
+
# to add the ability to create an instance from a {Hash} of parameters.
|
14
|
+
#
|
15
|
+
# @overload initialize({ Symbol => Object })
|
16
|
+
# Initializes the object with a key/value hash.
|
17
|
+
# @param [{ Symbol => Object }] values
|
18
|
+
# @return [SuperStruct]
|
19
|
+
# @overload initialize([ value1, value1, ... ])
|
20
|
+
# Initializes the object with given values.
|
21
|
+
# @param [Array] values
|
22
|
+
# @return [SuperStruct]
|
23
|
+
# @overload initialize(value1, value1, ...)
|
24
|
+
# Initializes the object with given values.
|
25
|
+
# @return [SuperStruct]
|
26
|
+
#
|
27
|
+
# @yield self
|
28
|
+
#
|
29
|
+
# @example
|
30
|
+
# attributes = { :foo => 1, :bar => "baz" }
|
31
|
+
# Struct.new(attributes)
|
32
|
+
# # => #<Struct foo=1, bar="baz">
|
33
|
+
#
|
34
|
+
def initialize(*args)
|
35
|
+
if args.first.is_a? Hash
|
36
|
+
initialize_with_hash(args.first)
|
37
|
+
elsif args.size == 0
|
38
|
+
super
|
39
|
+
else
|
40
|
+
raise ArgumentError
|
41
|
+
end
|
42
|
+
yield(self) if block_given?
|
43
|
+
end
|
44
|
+
|
45
|
+
private
|
46
|
+
|
47
|
+
def initialize_with_hash(attributes = {})
|
48
|
+
attributes.each do |key, value|
|
49
|
+
self[key] = value
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
53
|
+
end
|
data/lib/whois/parser/version.rb
CHANGED