whois 3.6.5 → 4.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/CHANGELOG.md +15 -0
- data/CONTRIBUTING.md +0 -2
- data/README.md +8 -3
- data/bin/whoisrb +5 -5
- data/data/tld.json +437 -216
- data/lib/whois.rb +1 -75
- data/lib/whois/errors.rb +0 -44
- data/lib/whois/record.rb +0 -237
- data/lib/whois/record/part.rb +20 -4
- data/lib/whois/server/adapters/base.rb +18 -3
- data/lib/whois/version.rb +1 -13
- data/whois.gemspec +9 -16
- metadata +7 -295
- data/lib/whois/record/contact.rb +0 -65
- data/lib/whois/record/nameserver.rb +0 -48
- data/lib/whois/record/parser.rb +0 -398
- data/lib/whois/record/parser/base.rb +0 -399
- data/lib/whois/record/parser/base_afilias.rb +0 -141
- data/lib/whois/record/parser/base_afilias2.rb +0 -138
- data/lib/whois/record/parser/base_cocca.rb +0 -99
- data/lib/whois/record/parser/base_cocca2.rb +0 -100
- data/lib/whois/record/parser/base_icann_compliant.rb +0 -159
- data/lib/whois/record/parser/base_icb.rb +0 -94
- data/lib/whois/record/parser/base_iisse.rb +0 -113
- data/lib/whois/record/parser/base_shared1.rb +0 -110
- data/lib/whois/record/parser/base_shared2.rb +0 -129
- data/lib/whois/record/parser/base_shared3.rb +0 -129
- data/lib/whois/record/parser/base_verisign.rb +0 -108
- data/lib/whois/record/parser/base_whoisd.rb +0 -147
- data/lib/whois/record/parser/blank.rb +0 -37
- data/lib/whois/record/parser/capetown-whois.registry.net.za.rb +0 -27
- data/lib/whois/record/parser/ccwhois.ksregistry.net.rb +0 -28
- data/lib/whois/record/parser/ccwhois.verisign-grs.com.rb +0 -27
- data/lib/whois/record/parser/durban-whois.registry.net.za.rb +0 -27
- data/lib/whois/record/parser/example.rb +0 -166
- data/lib/whois/record/parser/jobswhois.verisign-grs.com.rb +0 -27
- data/lib/whois/record/parser/joburg-whois.registry.net.za.rb +0 -27
- data/lib/whois/record/parser/kero.yachay.pe.rb +0 -88
- data/lib/whois/record/parser/org-whois.registry.net.za.rb +0 -27
- data/lib/whois/record/parser/whois.1und1.info.rb +0 -30
- data/lib/whois/record/parser/whois.35.com.rb +0 -26
- data/lib/whois/record/parser/whois.aeda.net.ae.rb +0 -66
- data/lib/whois/record/parser/whois.aero.rb +0 -59
- data/lib/whois/record/parser/whois.afilias-grs.info.rb +0 -23
- data/lib/whois/record/parser/whois.afilias.net.rb +0 -28
- data/lib/whois/record/parser/whois.ai.rb +0 -64
- data/lib/whois/record/parser/whois.amnic.net.rb +0 -81
- data/lib/whois/record/parser/whois.ascio.com.rb +0 -31
- data/lib/whois/record/parser/whois.ati.tn.rb +0 -118
- data/lib/whois/record/parser/whois.audns.net.au.rb +0 -121
- data/lib/whois/record/parser/whois.ax.rb +0 -66
- data/lib/whois/record/parser/whois.biz.rb +0 -27
- data/lib/whois/record/parser/whois.bnnic.bn.rb +0 -77
- data/lib/whois/record/parser/whois.cat.rb +0 -79
- data/lib/whois/record/parser/whois.cctld.by.rb +0 -96
- data/lib/whois/record/parser/whois.cctld.uz.rb +0 -83
- data/lib/whois/record/parser/whois.centralnic.com.rb +0 -142
- data/lib/whois/record/parser/whois.cira.ca.rb +0 -194
- data/lib/whois/record/parser/whois.cmc.iq.rb +0 -27
- data/lib/whois/record/parser/whois.cnnic.cn.rb +0 -110
- data/lib/whois/record/parser/whois.co.ca.rb +0 -78
- data/lib/whois/record/parser/whois.co.pl.rb +0 -84
- data/lib/whois/record/parser/whois.co.ug.rb +0 -84
- data/lib/whois/record/parser/whois.comlaude.com.rb +0 -115
- data/lib/whois/record/parser/whois.corporatedomains.com.rb +0 -30
- data/lib/whois/record/parser/whois.denic.de.rb +0 -166
- data/lib/whois/record/parser/whois.dk-hostmaster.dk.rb +0 -82
- data/lib/whois/record/parser/whois.dns.be.rb +0 -122
- data/lib/whois/record/parser/whois.dns.hr.rb +0 -99
- data/lib/whois/record/parser/whois.dns.lu.rb +0 -128
- data/lib/whois/record/parser/whois.dns.pl.rb +0 -153
- data/lib/whois/record/parser/whois.dns.pt.rb +0 -79
- data/lib/whois/record/parser/whois.domain-registry.nl.rb +0 -125
- data/lib/whois/record/parser/whois.domain.kg.rb +0 -78
- data/lib/whois/record/parser/whois.domainregistry.ie.rb +0 -123
- data/lib/whois/record/parser/whois.domreg.lt.rb +0 -70
- data/lib/whois/record/parser/whois.donuts.co.rb +0 -64
- data/lib/whois/record/parser/whois.dot.cf.rb +0 -73
- data/lib/whois/record/parser/whois.dot.tk.rb +0 -72
- data/lib/whois/record/parser/whois.dotgov.gov.rb +0 -63
- data/lib/whois/record/parser/whois.dotmobiregistry.net.rb +0 -23
- data/lib/whois/record/parser/whois.dotpostregistry.net.rb +0 -27
- data/lib/whois/record/parser/whois.dotproregistry.net.rb +0 -41
- data/lib/whois/record/parser/whois.dreamhost.com.rb +0 -25
- data/lib/whois/record/parser/whois.educause.edu.rb +0 -202
- data/lib/whois/record/parser/whois.eenet.ee.rb +0 -74
- data/lib/whois/record/parser/whois.enom.com.rb +0 -36
- data/lib/whois/record/parser/whois.eu.org.rb +0 -60
- data/lib/whois/record/parser/whois.eu.rb +0 -132
- data/lib/whois/record/parser/whois.fi.rb +0 -119
- data/lib/whois/record/parser/whois.gandi.net.rb +0 -32
- data/lib/whois/record/parser/whois.gg.rb +0 -33
- data/lib/whois/record/parser/whois.godaddy.com.rb +0 -113
- data/lib/whois/record/parser/whois.gov.za.rb +0 -64
- data/lib/whois/record/parser/whois.hkirc.hk.rb +0 -73
- data/lib/whois/record/parser/whois.iana.org.rb +0 -104
- data/lib/whois/record/parser/whois.iis.nu.rb +0 -28
- data/lib/whois/record/parser/whois.iis.se.rb +0 -28
- data/lib/whois/record/parser/whois.in.ua.rb +0 -77
- data/lib/whois/record/parser/whois.inregistry.net.rb +0 -29
- data/lib/whois/record/parser/whois.isnic.is.rb +0 -72
- data/lib/whois/record/parser/whois.isoc.org.il.rb +0 -77
- data/lib/whois/record/parser/whois.ja.net.rb +0 -77
- data/lib/whois/record/parser/whois.je.rb +0 -27
- data/lib/whois/record/parser/whois.jprs.jp.rb +0 -105
- data/lib/whois/record/parser/whois.kenic.or.ke.rb +0 -93
- data/lib/whois/record/parser/whois.kr.rb +0 -81
- data/lib/whois/record/parser/whois.markmonitor.com.rb +0 -38
- data/lib/whois/record/parser/whois.monic.mo.rb +0 -85
- data/lib/whois/record/parser/whois.museum.rb +0 -81
- data/lib/whois/record/parser/whois.mynic.my.rb +0 -74
- data/lib/whois/record/parser/whois.na-nic.com.na.rb +0 -23
- data/lib/whois/record/parser/whois.nc.rb +0 -124
- data/lib/whois/record/parser/whois.netcom.cm.rb +0 -28
- data/lib/whois/record/parser/whois.networksolutions.com.rb +0 -39
- data/lib/whois/record/parser/whois.nic.ac.rb +0 -27
- data/lib/whois/record/parser/whois.nic.af.rb +0 -27
- data/lib/whois/record/parser/whois.nic.ag.rb +0 -23
- data/lib/whois/record/parser/whois.nic.as.rb +0 -65
- data/lib/whois/record/parser/whois.nic.asia.rb +0 -109
- data/lib/whois/record/parser/whois.nic.at.rb +0 -66
- data/lib/whois/record/parser/whois.nic.bj.rb +0 -128
- data/lib/whois/record/parser/whois.nic.bo.rb +0 -75
- data/lib/whois/record/parser/whois.nic.cd.rb +0 -36
- data/lib/whois/record/parser/whois.nic.ch.rb +0 -111
- data/lib/whois/record/parser/whois.nic.ci.rb +0 -72
- data/lib/whois/record/parser/whois.nic.cl.rb +0 -73
- data/lib/whois/record/parser/whois.nic.co.rb +0 -27
- data/lib/whois/record/parser/whois.nic.college.rb +0 -27
- data/lib/whois/record/parser/whois.nic.coop.rb +0 -72
- data/lib/whois/record/parser/whois.nic.cx.rb +0 -27
- data/lib/whois/record/parser/whois.nic.cz.rb +0 -44
- data/lib/whois/record/parser/whois.nic.design.rb +0 -27
- data/lib/whois/record/parser/whois.nic.dm.rb +0 -27
- data/lib/whois/record/parser/whois.nic.dz.rb +0 -60
- data/lib/whois/record/parser/whois.nic.ec.rb +0 -36
- data/lib/whois/record/parser/whois.nic.es.rb +0 -107
- data/lib/whois/record/parser/whois.nic.fo.rb +0 -45
- data/lib/whois/record/parser/whois.nic.fr.rb +0 -176
- data/lib/whois/record/parser/whois.nic.gd.rb +0 -33
- data/lib/whois/record/parser/whois.nic.gl.rb +0 -27
- data/lib/whois/record/parser/whois.nic.gs.rb +0 -33
- data/lib/whois/record/parser/whois.nic.hn.rb +0 -27
- data/lib/whois/record/parser/whois.nic.ht.rb +0 -27
- data/lib/whois/record/parser/whois.nic.hu.rb +0 -80
- data/lib/whois/record/parser/whois.nic.im.rb +0 -68
- data/lib/whois/record/parser/whois.nic.io.rb +0 -50
- data/lib/whois/record/parser/whois.nic.ir.rb +0 -68
- data/lib/whois/record/parser/whois.nic.it.rb +0 -161
- data/lib/whois/record/parser/whois.nic.ki.rb +0 -27
- data/lib/whois/record/parser/whois.nic.kz.rb +0 -69
- data/lib/whois/record/parser/whois.nic.la.rb +0 -27
- data/lib/whois/record/parser/whois.nic.li.rb +0 -66
- data/lib/whois/record/parser/whois.nic.lk.rb +0 -111
- data/lib/whois/record/parser/whois.nic.lv.rb +0 -69
- data/lib/whois/record/parser/whois.nic.ly.rb +0 -78
- data/lib/whois/record/parser/whois.nic.md.rb +0 -96
- data/lib/whois/record/parser/whois.nic.me.rb +0 -87
- data/lib/whois/record/parser/whois.nic.mg.rb +0 -33
- data/lib/whois/record/parser/whois.nic.ms.rb +0 -27
- data/lib/whois/record/parser/whois.nic.mu.rb +0 -27
- data/lib/whois/record/parser/whois.nic.mx.rb +0 -81
- data/lib/whois/record/parser/whois.nic.name.rb +0 -70
- data/lib/whois/record/parser/whois.nic.net.ng.rb +0 -29
- data/lib/whois/record/parser/whois.nic.net.sa.rb +0 -72
- data/lib/whois/record/parser/whois.nic.net.sb.rb +0 -33
- data/lib/whois/record/parser/whois.nic.nf.rb +0 -27
- data/lib/whois/record/parser/whois.nic.org.uy.rb +0 -77
- data/lib/whois/record/parser/whois.nic.pr.rb +0 -86
- data/lib/whois/record/parser/whois.nic.priv.at.rb +0 -64
- data/lib/whois/record/parser/whois.nic.pw.rb +0 -27
- data/lib/whois/record/parser/whois.nic.sh.rb +0 -27
- data/lib/whois/record/parser/whois.nic.sl.rb +0 -78
- data/lib/whois/record/parser/whois.nic.sm.rb +0 -78
- data/lib/whois/record/parser/whois.nic.sn.rb +0 -115
- data/lib/whois/record/parser/whois.nic.so.rb +0 -72
- data/lib/whois/record/parser/whois.nic.space.rb +0 -27
- data/lib/whois/record/parser/whois.nic.st.rb +0 -74
- data/lib/whois/record/parser/whois.nic.tc.rb +0 -27
- data/lib/whois/record/parser/whois.nic.tech.rb +0 -27
- data/lib/whois/record/parser/whois.nic.tel.rb +0 -27
- data/lib/whois/record/parser/whois.nic.tl.rb +0 -27
- data/lib/whois/record/parser/whois.nic.tm.rb +0 -33
- data/lib/whois/record/parser/whois.nic.tr.rb +0 -161
- data/lib/whois/record/parser/whois.nic.travel.rb +0 -27
- data/lib/whois/record/parser/whois.nic.tv.rb +0 -27
- data/lib/whois/record/parser/whois.nic.uk.rb +0 -179
- data/lib/whois/record/parser/whois.nic.us.rb +0 -27
- data/lib/whois/record/parser/whois.nic.ve.rb +0 -89
- data/lib/whois/record/parser/whois.nic.xxx.rb +0 -44
- data/lib/whois/record/parser/whois.nic.xyz.rb +0 -22
- data/lib/whois/record/parser/whois.norid.no.rb +0 -63
- data/lib/whois/record/parser/whois.pairnic.com.rb +0 -30
- data/lib/whois/record/parser/whois.pandi.or.id.rb +0 -27
- data/lib/whois/record/parser/whois.pir.org.rb +0 -92
- data/lib/whois/record/parser/whois.pnina.ps.rb +0 -33
- data/lib/whois/record/parser/whois.register.bg.rb +0 -85
- data/lib/whois/record/parser/whois.register.com.rb +0 -32
- data/lib/whois/record/parser/whois.register.si.rb +0 -75
- data/lib/whois/record/parser/whois.registre.ma.rb +0 -65
- data/lib/whois/record/parser/whois.registro.br.rb +0 -75
- data/lib/whois/record/parser/whois.registry.gy.rb +0 -27
- data/lib/whois/record/parser/whois.registry.hm.rb +0 -74
- data/lib/whois/record/parser/whois.registry.net.za.rb +0 -145
- data/lib/whois/record/parser/whois.registry.om.rb +0 -42
- data/lib/whois/record/parser/whois.registry.qa.rb +0 -27
- data/lib/whois/record/parser/whois.ripe.net.rb +0 -70
- data/lib/whois/record/parser/whois.rnids.rs.rb +0 -136
- data/lib/whois/record/parser/whois.rotld.ro.rb +0 -67
- data/lib/whois/record/parser/whois.rrpproxy.net.rb +0 -34
- data/lib/whois/record/parser/whois.safenames.net.rb +0 -50
- data/lib/whois/record/parser/whois.schlund.info.rb +0 -36
- data/lib/whois/record/parser/whois.sgnic.sg.rb +0 -89
- data/lib/whois/record/parser/whois.sk-nic.sk.rb +0 -103
- data/lib/whois/record/parser/whois.smallregistry.net.rb +0 -133
- data/lib/whois/record/parser/whois.srs.net.nz.rb +0 -161
- data/lib/whois/record/parser/whois.sx.rb +0 -134
- data/lib/whois/record/parser/whois.tcinet.ru.rb +0 -116
- data/lib/whois/record/parser/whois.thnic.co.th.rb +0 -81
- data/lib/whois/record/parser/whois.tld.ee.rb +0 -136
- data/lib/whois/record/parser/whois.tld.sy.rb +0 -36
- data/lib/whois/record/parser/whois.tonic.to.rb +0 -88
- data/lib/whois/record/parser/whois.tucows.com.rb +0 -30
- data/lib/whois/record/parser/whois.twnic.net.tw.rb +0 -74
- data/lib/whois/record/parser/whois.tznic.or.tz.rb +0 -27
- data/lib/whois/record/parser/whois.ua.rb +0 -242
- data/lib/whois/record/parser/whois.udag.net.rb +0 -30
- data/lib/whois/record/parser/whois.uniregistry.net.rb +0 -68
- data/lib/whois/record/parser/whois.usp.ac.fj.rb +0 -74
- data/lib/whois/record/parser/whois.verisign-grs.com.rb +0 -51
- data/lib/whois/record/parser/whois.website.ws.rb +0 -76
- data/lib/whois/record/parser/whois.wildwestdomains.com.rb +0 -37
- data/lib/whois/record/parser/whois.yoursrs.com.rb +0 -127
- data/lib/whois/record/parser/whois.za.net.rb +0 -74
- data/lib/whois/record/parser/whois.za.org.rb +0 -74
- data/lib/whois/record/parser/whois1.nic.bi.rb +0 -27
- data/lib/whois/record/parser/za_central_registry.rb +0 -70
- data/lib/whois/record/registrar.rb +0 -34
- data/lib/whois/record/scanners/base.rb +0 -126
- data/lib/whois/record/scanners/base_afilias.rb +0 -63
- data/lib/whois/record/scanners/base_cocca2.rb +0 -55
- data/lib/whois/record/scanners/base_icann_compliant.rb +0 -57
- data/lib/whois/record/scanners/base_iisse.rb +0 -48
- data/lib/whois/record/scanners/base_shared1.rb +0 -43
- data/lib/whois/record/scanners/base_shared2.rb +0 -47
- data/lib/whois/record/scanners/base_shared3.rb +0 -49
- data/lib/whois/record/scanners/base_whoisd.rb +0 -56
- data/lib/whois/record/scanners/iana.rb +0 -101
- data/lib/whois/record/scanners/scannable.rb +0 -77
- data/lib/whois/record/scanners/verisign.rb +0 -112
- data/lib/whois/record/scanners/whois.ati.tn.rb +0 -44
- data/lib/whois/record/scanners/whois.audns.net.au.rb +0 -37
- data/lib/whois/record/scanners/whois.cctld.by.rb +0 -47
- data/lib/whois/record/scanners/whois.centralnic.com.rb +0 -44
- data/lib/whois/record/scanners/whois.cira.ca.rb +0 -84
- data/lib/whois/record/scanners/whois.cnnic.cn.rb +0 -54
- data/lib/whois/record/scanners/whois.denic.de.rb +0 -108
- data/lib/whois/record/scanners/whois.dns.hr.rb +0 -37
- data/lib/whois/record/scanners/whois.domainregistry.ie.rb +0 -58
- data/lib/whois/record/scanners/whois.fi.rb +0 -51
- data/lib/whois/record/scanners/whois.nc.rb +0 -44
- data/lib/whois/record/scanners/whois.nic.cz.rb +0 -34
- data/lib/whois/record/scanners/whois.nic.it.rb +0 -104
- data/lib/whois/record/scanners/whois.pir.org.rb +0 -29
- data/lib/whois/record/scanners/whois.registry.net.za.rb +0 -104
- data/lib/whois/record/scanners/whois.rnids.rs.rb +0 -64
- data/lib/whois/record/scanners/whois.smallregistry.net.rb +0 -61
- data/lib/whois/record/scanners/whois.srs.net.nz.rb +0 -35
- data/lib/whois/record/scanners/whois.sx.rb +0 -49
- data/lib/whois/record/scanners/whois.tld.ee.rb +0 -57
- data/lib/whois/record/scanners/whois.tucows.com.rb +0 -35
- data/lib/whois/record/scanners/whois.yoursrs.com.rb +0 -36
- data/lib/whois/record/super_struct.rb +0 -62
@@ -1,77 +0,0 @@
|
|
1
|
-
#--
|
2
|
-
# Ruby Whois
|
3
|
-
#
|
4
|
-
# An intelligent pure Ruby WHOIS client and parser.
|
5
|
-
#
|
6
|
-
# Copyright (c) 2009-2015 Simone Carletti <weppos@weppos.net>
|
7
|
-
#++
|
8
|
-
|
9
|
-
|
10
|
-
require 'strscan'
|
11
|
-
|
12
|
-
|
13
|
-
module Whois
|
14
|
-
class Record
|
15
|
-
module Scanners
|
16
|
-
|
17
|
-
# The Scannable module tries to emulate a super-simple Abstract Syntax Tree structure
|
18
|
-
# including method for accessing ast nodes.
|
19
|
-
#
|
20
|
-
# == Usage
|
21
|
-
#
|
22
|
-
# Include the Scannable module and set the `self.scanner` value.
|
23
|
-
#
|
24
|
-
# class ParserFoo
|
25
|
-
# include Scannable
|
26
|
-
#
|
27
|
-
# self.scanner = ScannerFoo
|
28
|
-
# end
|
29
|
-
#
|
30
|
-
# Now you can access the AST using the <tt>node</tt> method.
|
31
|
-
#
|
32
|
-
# node "created_on"
|
33
|
-
# # => "2009-12-12"
|
34
|
-
#
|
35
|
-
# node? "created_on"
|
36
|
-
# # => true
|
37
|
-
#
|
38
|
-
# node? "created_at"
|
39
|
-
# # => false
|
40
|
-
#
|
41
|
-
module Scannable
|
42
|
-
|
43
|
-
def self.included(base)
|
44
|
-
base.class_attribute :scanner
|
45
|
-
end
|
46
|
-
|
47
|
-
def node(key)
|
48
|
-
if block_given?
|
49
|
-
value = ast[key]
|
50
|
-
value = yield(value) unless value.nil?
|
51
|
-
value
|
52
|
-
else
|
53
|
-
ast[key]
|
54
|
-
end
|
55
|
-
end
|
56
|
-
|
57
|
-
def node?(key)
|
58
|
-
!ast[key].nil?
|
59
|
-
end
|
60
|
-
|
61
|
-
def parse
|
62
|
-
scanner = self.scanner.is_a?(Array) ? self.scanner.first : self.scanner
|
63
|
-
settings = self.scanner.is_a?(Array) ? self.scanner.last : {}
|
64
|
-
scanner.new(settings).parse(content_for_scanner)
|
65
|
-
end
|
66
|
-
|
67
|
-
private
|
68
|
-
|
69
|
-
def ast
|
70
|
-
@ast ||= parse
|
71
|
-
end
|
72
|
-
|
73
|
-
end
|
74
|
-
|
75
|
-
end
|
76
|
-
end
|
77
|
-
end
|
@@ -1,112 +0,0 @@
|
|
1
|
-
#--
|
2
|
-
# Ruby Whois
|
3
|
-
#
|
4
|
-
# An intelligent pure Ruby WHOIS client and parser.
|
5
|
-
#
|
6
|
-
# Copyright (c) 2009-2015 Simone Carletti <weppos@weppos.net>
|
7
|
-
#++
|
8
|
-
|
9
|
-
|
10
|
-
require 'whois/record/scanners/base'
|
11
|
-
|
12
|
-
|
13
|
-
module Whois
|
14
|
-
class Record
|
15
|
-
module Scanners
|
16
|
-
|
17
|
-
class Verisign < Base
|
18
|
-
|
19
|
-
self.tokenizers += [
|
20
|
-
:skip_empty_line,
|
21
|
-
:scan_response_unavailable,
|
22
|
-
:scan_available,
|
23
|
-
:scan_disclaimer,
|
24
|
-
:scan_notice,
|
25
|
-
:scan_keyvalue_indented,
|
26
|
-
:skip_ianaservice,
|
27
|
-
:skip_lastupdate,
|
28
|
-
:skip_fuffa,
|
29
|
-
]
|
30
|
-
|
31
|
-
|
32
|
-
tokenizer :scan_response_unavailable do
|
33
|
-
# Check if the string starts with /*
|
34
|
-
# If it does, match until the end of all /* lines
|
35
|
-
# or the end of the file and check for the content.
|
36
|
-
#
|
37
|
-
# Flag the block as visited to force the scanner to ignore this tokenizer
|
38
|
-
# if already used and the content didn't match the unavailable message.
|
39
|
-
if @input.match?(/^\*\n/) && !visited?
|
40
|
-
p = /^[^\*]|\z/
|
41
|
-
y = @input.check_until(p) =~ /^\* Sorry, the Whois database is currently down/
|
42
|
-
|
43
|
-
if y
|
44
|
-
@input.skip_until(p)
|
45
|
-
@ast["response:unavailable"] = true
|
46
|
-
else
|
47
|
-
visited!
|
48
|
-
end
|
49
|
-
end
|
50
|
-
end
|
51
|
-
|
52
|
-
tokenizer :scan_available do
|
53
|
-
if @input.scan(/No match for "(.+?)"\.\n/)
|
54
|
-
@ast["Domain Name"] = @input[1].strip
|
55
|
-
end
|
56
|
-
end
|
57
|
-
|
58
|
-
tokenizer :scan_disclaimer do
|
59
|
-
if @input.match?(/^TERMS OF USE:/)
|
60
|
-
@ast["Disclaimer"] = _scan_lines_to_array(/(.+)\n/).join(" ")
|
61
|
-
end
|
62
|
-
end
|
63
|
-
|
64
|
-
tokenizer :scan_notice do
|
65
|
-
if @input.match?(/^NOTICE:/)
|
66
|
-
@ast["Notice"] = _scan_lines_to_array(/(.+)\n/).join(" ")
|
67
|
-
end
|
68
|
-
end
|
69
|
-
|
70
|
-
tokenizer :scan_keyvalue_indented do
|
71
|
-
if @input.scan(/\s+(.+?):(.*?)\n/)
|
72
|
-
key, value = @input[1].strip, @input[2].strip
|
73
|
-
if @ast[key].nil?
|
74
|
-
@ast[key] = value
|
75
|
-
else
|
76
|
-
@ast[key] = [@ast[key]] unless @ast[key].is_a?(Array)
|
77
|
-
@ast[key] << value
|
78
|
-
end
|
79
|
-
end
|
80
|
-
end
|
81
|
-
|
82
|
-
tokenizer :skip_lastupdate do
|
83
|
-
@input.skip(/>>>(.+?)<<<\n/)
|
84
|
-
end
|
85
|
-
|
86
|
-
tokenizer :skip_fuffa do
|
87
|
-
@input.scan(/^\S(.+)(?:\n|\z)/)
|
88
|
-
end
|
89
|
-
|
90
|
-
tokenizer :skip_ianaservice do
|
91
|
-
if @input.match?(/IANA Whois Service/)
|
92
|
-
@ast["IANA"] = true
|
93
|
-
@input.terminate
|
94
|
-
end
|
95
|
-
end
|
96
|
-
|
97
|
-
private
|
98
|
-
|
99
|
-
def visited?
|
100
|
-
!!@tmp["visited:#{@input.pos}"]
|
101
|
-
end
|
102
|
-
|
103
|
-
def visited!
|
104
|
-
@tmp["visited:#{@input.pos}"] = true
|
105
|
-
nil
|
106
|
-
end
|
107
|
-
|
108
|
-
end
|
109
|
-
|
110
|
-
end
|
111
|
-
end
|
112
|
-
end
|
@@ -1,44 +0,0 @@
|
|
1
|
-
#--
|
2
|
-
# Ruby Whois
|
3
|
-
#
|
4
|
-
# An intelligent pure Ruby WHOIS client and parser.
|
5
|
-
#
|
6
|
-
# Copyright (c) 2009-2015 Simone Carletti <weppos@weppos.net>
|
7
|
-
#++
|
8
|
-
|
9
|
-
|
10
|
-
require 'whois/record/scanners/base'
|
11
|
-
|
12
|
-
|
13
|
-
module Whois
|
14
|
-
class Record
|
15
|
-
module Scanners
|
16
|
-
|
17
|
-
# Scanner for the whois.ati.tn record.
|
18
|
-
class WhoisAtiTn < Base
|
19
|
-
|
20
|
-
self.tokenizers += [
|
21
|
-
:skip_empty_line,
|
22
|
-
:scan_available,
|
23
|
-
:scan_disclaimer,
|
24
|
-
:scan_keyvalue,
|
25
|
-
]
|
26
|
-
|
27
|
-
|
28
|
-
tokenizer :scan_available do
|
29
|
-
if @input.skip(/^Domain (.+) not found/)
|
30
|
-
@ast["status:available"] = true
|
31
|
-
end
|
32
|
-
end
|
33
|
-
|
34
|
-
tokenizer :scan_disclaimer do
|
35
|
-
if @input.match?(/^All rights reserved/)
|
36
|
-
@ast["field:disclaimer"] = _scan_lines_to_array(/(.+)\n/).join("\n")
|
37
|
-
end
|
38
|
-
end
|
39
|
-
|
40
|
-
end
|
41
|
-
|
42
|
-
end
|
43
|
-
end
|
44
|
-
end
|
@@ -1,37 +0,0 @@
|
|
1
|
-
#--
|
2
|
-
# Ruby Whois
|
3
|
-
#
|
4
|
-
# An intelligent pure Ruby WHOIS client and parser.
|
5
|
-
#
|
6
|
-
# Copyright (c) 2009-2015 Simone Carletti <weppos@weppos.net>
|
7
|
-
#++
|
8
|
-
|
9
|
-
|
10
|
-
require 'whois/record/scanners/base'
|
11
|
-
|
12
|
-
|
13
|
-
module Whois
|
14
|
-
class Record
|
15
|
-
module Scanners
|
16
|
-
|
17
|
-
# Scanner for the whois.audns.net.au record.
|
18
|
-
class WhoisAudnsNetAu < Base
|
19
|
-
|
20
|
-
self.tokenizers += [
|
21
|
-
:skip_empty_line,
|
22
|
-
:scan_available,
|
23
|
-
:scan_keyvalue,
|
24
|
-
]
|
25
|
-
|
26
|
-
|
27
|
-
tokenizer :scan_available do
|
28
|
-
if @input.skip(/^No Data Found\n/)
|
29
|
-
@ast["status:available"] = true
|
30
|
-
end
|
31
|
-
end
|
32
|
-
|
33
|
-
end
|
34
|
-
|
35
|
-
end
|
36
|
-
end
|
37
|
-
end
|
@@ -1,47 +0,0 @@
|
|
1
|
-
#--
|
2
|
-
# Ruby Whois
|
3
|
-
#
|
4
|
-
# An intelligent pure Ruby WHOIS client and parser.
|
5
|
-
#
|
6
|
-
# Copyright (c) 2009-2015 Simone Carletti <weppos@weppos.net>
|
7
|
-
#++
|
8
|
-
|
9
|
-
|
10
|
-
require 'whois/record/scanners/base'
|
11
|
-
|
12
|
-
|
13
|
-
module Whois
|
14
|
-
class Record
|
15
|
-
module Scanners
|
16
|
-
|
17
|
-
# Scanner for the whois.cctld.by server.
|
18
|
-
#
|
19
|
-
# @author Aliaksei Kliuchnikau <aliaksei.kliuchnikau@gmail.com>
|
20
|
-
class WhoisCctldBy < Base
|
21
|
-
|
22
|
-
self.tokenizers += [
|
23
|
-
:skip_empty_line,
|
24
|
-
:skip_dash_line,
|
25
|
-
:scan_available,
|
26
|
-
:scan_keyvalue,
|
27
|
-
:skip_provider_signature,
|
28
|
-
]
|
29
|
-
|
30
|
-
tokenizer :scan_available do
|
31
|
-
if @input.skip(/^Object does not exist/)
|
32
|
-
@ast["status:available"] = true
|
33
|
-
end
|
34
|
-
end
|
35
|
-
|
36
|
-
tokenizer :skip_dash_line do
|
37
|
-
@input.skip(/^-+\n/)
|
38
|
-
end
|
39
|
-
|
40
|
-
tokenizer :skip_provider_signature do
|
41
|
-
@input.scan(/^(.+)\n/)
|
42
|
-
end
|
43
|
-
|
44
|
-
end
|
45
|
-
end
|
46
|
-
end
|
47
|
-
end
|
@@ -1,44 +0,0 @@
|
|
1
|
-
#--
|
2
|
-
# Ruby Whois
|
3
|
-
#
|
4
|
-
# An intelligent pure Ruby WHOIS client and parser.
|
5
|
-
#
|
6
|
-
# Copyright (c) 2009-2015 Simone Carletti <weppos@weppos.net>
|
7
|
-
#++
|
8
|
-
|
9
|
-
|
10
|
-
require 'whois/record/scanners/base'
|
11
|
-
|
12
|
-
|
13
|
-
module Whois
|
14
|
-
class Record
|
15
|
-
module Scanners
|
16
|
-
|
17
|
-
# Scanner for the whois.centralnic.com record.
|
18
|
-
class WhoisCentralnicCom < Base
|
19
|
-
|
20
|
-
self.tokenizers += [
|
21
|
-
:skip_empty_line,
|
22
|
-
:scan_available,
|
23
|
-
:scan_disclaimer,
|
24
|
-
:scan_keyvalue,
|
25
|
-
]
|
26
|
-
|
27
|
-
|
28
|
-
tokenizer :scan_available do
|
29
|
-
if @input.skip(/^DOMAIN NOT FOUND\n/)
|
30
|
-
@ast["status:available"] = true
|
31
|
-
end
|
32
|
-
end
|
33
|
-
|
34
|
-
tokenizer :scan_disclaimer do
|
35
|
-
if @input.match?(/^\S([^:]+)\n/)
|
36
|
-
@ast["field:disclaimer"] = _scan_lines_to_array(/(.+)\n/).join(" ")
|
37
|
-
end
|
38
|
-
end
|
39
|
-
|
40
|
-
end
|
41
|
-
|
42
|
-
end
|
43
|
-
end
|
44
|
-
end
|
@@ -1,84 +0,0 @@
|
|
1
|
-
#--
|
2
|
-
# Ruby Whois
|
3
|
-
#
|
4
|
-
# An intelligent pure Ruby WHOIS client and parser.
|
5
|
-
#
|
6
|
-
# Copyright (c) 2009-2015 Simone Carletti <weppos@weppos.net>
|
7
|
-
#++
|
8
|
-
|
9
|
-
|
10
|
-
require 'whois/record/scanners/base'
|
11
|
-
|
12
|
-
|
13
|
-
module Whois
|
14
|
-
class Record
|
15
|
-
module Scanners
|
16
|
-
|
17
|
-
# Scanner for the whois.cira.ca record.
|
18
|
-
class WhoisCiraCa < Base
|
19
|
-
|
20
|
-
self.tokenizers += [
|
21
|
-
:skip_empty_line,
|
22
|
-
:scan_disclaimer,
|
23
|
-
:skip_comment,
|
24
|
-
:scan_header,
|
25
|
-
:scan_keyvalue,
|
26
|
-
:scan_nameserver,
|
27
|
-
]
|
28
|
-
|
29
|
-
|
30
|
-
tokenizer :scan_disclaimer do
|
31
|
-
if @input.match?(/^% Use of CIRA/)
|
32
|
-
@ast["field:disclaimer"] = _scan_lines_to_array(/^%(.*)\n/).join("\n")
|
33
|
-
end
|
34
|
-
end
|
35
|
-
|
36
|
-
tokenizer :scan_header do
|
37
|
-
if @input.scan(/^(.+?):\n/)
|
38
|
-
@tmp["group"] = @input[1]
|
39
|
-
end
|
40
|
-
end
|
41
|
-
|
42
|
-
tokenizer :scan_keyvalue do
|
43
|
-
if @input.scan(/^(.+?):(.*?)\n/)
|
44
|
-
start = @input[1]
|
45
|
-
key, value = start.strip, @input[2].strip
|
46
|
-
|
47
|
-
# This is a nested key
|
48
|
-
target = if start.index(" ") == 0
|
49
|
-
error!("Expected group.") if @tmp["group"].nil?
|
50
|
-
@ast[@tmp["group"]] ||= {}
|
51
|
-
@ast[@tmp["group"]]
|
52
|
-
else
|
53
|
-
@tmp.delete("group")
|
54
|
-
@ast
|
55
|
-
end
|
56
|
-
|
57
|
-
more = _scan_lines_to_array(/^\s{#{start.size}}(.+)\n/)
|
58
|
-
value = more.unshift(value).join("\n") unless more.empty?
|
59
|
-
|
60
|
-
if target[key].nil?
|
61
|
-
target[key] = value
|
62
|
-
else
|
63
|
-
target[key] = Array.wrap(target[key])
|
64
|
-
target[key] << value
|
65
|
-
end
|
66
|
-
end
|
67
|
-
end
|
68
|
-
|
69
|
-
tokenizer :scan_nameserver do
|
70
|
-
if @input.scan(/^\s+(.+?)\n/) && @tmp["group"] == "Name servers"
|
71
|
-
@ast["field:nameservers"] ||= []
|
72
|
-
@ast["field:nameservers"] << @input[1].strip
|
73
|
-
end
|
74
|
-
end
|
75
|
-
|
76
|
-
tokenizer :skip_comment do
|
77
|
-
@input.skip(/^%.*\n/)
|
78
|
-
end
|
79
|
-
|
80
|
-
end
|
81
|
-
|
82
|
-
end
|
83
|
-
end
|
84
|
-
end
|