whois 1.0.11 → 1.0.12
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.rdoc +9 -0
- data/Manifest +9 -0
- data/lib/whois/answer/parser/NOTES.txt +1 -1
- data/lib/whois/answer/parser/whois.cnnic.net.cn.rb +1 -1
- data/lib/whois/answer/parser/whois.dns.lu.rb +1 -1
- data/lib/whois/answer/parser/whois.jprs.jp.rb +82 -0
- data/lib/whois/answer/parser/whois.registry.in.rb +77 -0
- data/lib/whois/version.rb +1 -1
- data/test/answer/parser/jobswhois.verisign-grs.com_test.rb +1 -1
- data/test/answer/parser/whois.adamsnames.tc_test.rb +1 -1
- data/test/answer/parser/whois.aero_test.rb +1 -1
- data/test/answer/parser/whois.afilias-grs.info_test.rb +1 -1
- data/test/answer/parser/whois.afilias.info_test.rb +1 -1
- data/test/answer/parser/whois.ai_test.rb +1 -1
- data/test/answer/parser/whois.arnes.si_test.rb +1 -1
- data/test/answer/parser/whois.biz_test.rb +1 -1
- data/test/answer/parser/whois.cat_test.rb +1 -1
- data/test/answer/parser/whois.cira.ca_test.rb +1 -1
- data/test/answer/parser/whois.cnnic.cn_test.rb +1 -1
- data/test/answer/parser/whois.cnnic.net.cn_test.rb +1 -1
- data/test/answer/parser/whois.dk-hostmaster.dk_test.rb +1 -1
- data/test/answer/parser/whois.dns.be_test.rb +1 -1
- data/test/answer/parser/whois.dns.lu_test.rb +8 -1
- data/test/answer/parser/whois.domain-registry.nl_test.rb +1 -1
- data/test/answer/parser/whois.domainregistry.ie_test.rb +1 -1
- data/test/answer/parser/whois.domreg.lt_test.rb +1 -1
- data/test/answer/parser/whois.dotmobiregistry.net_test.rb +1 -1
- data/test/answer/parser/whois.educause.edu_test.rb +1 -1
- data/test/answer/parser/whois.eu.org_test.rb +1 -1
- data/test/answer/parser/whois.eu_test.rb +1 -1
- data/test/answer/parser/whois.hkdnr.net.hk_test.rb +1 -1
- data/test/answer/parser/whois.iana.org_test.rb +1 -1
- data/test/answer/parser/whois.isnic.is_test.rb +1 -1
- data/test/answer/parser/whois.jprs.jp_test.rb +86 -0
- data/test/answer/parser/whois.meregistry.net_test.rb +1 -1
- data/test/answer/parser/whois.museum_test.rb +1 -1
- data/test/answer/parser/whois.nic-se.se_test.rb +1 -1
- data/test/answer/parser/whois.nic.ac_test.rb +1 -1
- data/test/answer/parser/whois.nic.af_test.rb +1 -1
- data/test/answer/parser/whois.nic.ag_test.rb +1 -1
- data/test/answer/parser/whois.nic.asia_test.rb +1 -1
- data/test/answer/parser/whois.nic.at_test.rb +1 -1
- data/test/answer/parser/whois.nic.cd_test.rb +1 -1
- data/test/answer/parser/whois.nic.ch_test.rb +1 -1
- data/test/answer/parser/whois.nic.coop_test.rb +1 -1
- data/test/answer/parser/whois.nic.fr_test.rb +1 -1
- data/test/answer/parser/whois.nic.gl_test.rb +1 -1
- data/test/answer/parser/whois.nic.gov_test.rb +1 -1
- data/test/answer/parser/whois.nic.hu_test.rb +1 -1
- data/test/answer/parser/whois.nic.im_test.rb +1 -1
- data/test/answer/parser/whois.nic.io_test.rb +1 -1
- data/test/answer/parser/whois.nic.it_test.rb +1 -1
- data/test/answer/parser/whois.nic.lv_test.rb +1 -1
- data/test/answer/parser/whois.nic.ly_test.rb +1 -1
- data/test/answer/parser/whois.nic.mu_test.rb +1 -1
- data/test/answer/parser/whois.nic.mx_test.rb +1 -1
- data/test/answer/parser/whois.nic.name_test.rb +1 -1
- data/test/answer/parser/whois.nic.nu_test.rb +1 -1
- data/test/answer/parser/whois.nic.or.kr_test.rb +1 -1
- data/test/answer/parser/whois.nic.tl_test.rb +1 -1
- data/test/answer/parser/whois.nic.travel_test.rb +1 -1
- data/test/answer/parser/whois.nic.uk_test.rb +1 -1
- data/test/answer/parser/whois.nic.us_test.rb +1 -1
- data/test/answer/parser/whois.nic.ve_test.rb +1 -1
- data/test/answer/parser/whois.norid.no_test.rb +1 -1
- data/test/answer/parser/whois.pandi.or.id_test.rb +1 -1
- data/test/answer/parser/whois.register.bg_test.rb +1 -1
- data/test/answer/parser/whois.registro.br_test.rb +1 -1
- data/test/answer/parser/whois.registry.in_test.rb +69 -0
- data/test/answer/parser/whois.registrypro.pro_test.rb +1 -1
- data/test/answer/parser/whois.ripe.net_test.rb +1 -1
- data/test/answer/parser/whois.ripn.net_test.rb +1 -1
- data/test/answer/parser/whois.rotld.ro_test.rb +1 -1
- data/test/answer/parser/whois.samoanic.ws_test.rb +1 -1
- data/test/answer/parser/whois.srs.net.nz_test.rb +1 -1
- data/test/answer/parser/whois.za.net_test.rb +1 -1
- data/test/answer/parser/whois.za.org_test.rb +1 -1
- data/test/list_tld +2 -2
- data/test/testcases/responses/whois.dns.lu/property_nameservers_with_ip.txt +55 -0
- data/test/testcases/responses/whois.jprs.jp/available.txt +8 -0
- data/test/testcases/responses/whois.jprs.jp/registered.txt +30 -0
- data/test/testcases/responses/whois.registry.in/available.txt +1 -0
- data/test/testcases/responses/whois.registry.in/registered.txt +83 -0
- data/whois.gemspec +5 -5
- metadata +16 -3
data/CHANGELOG.rdoc
CHANGED
@@ -1,6 +1,15 @@
|
|
1
1
|
= Changelog
|
2
2
|
|
3
3
|
|
4
|
+
== master
|
5
|
+
|
6
|
+
* NEW: Added simple .in TLD parser (whois.registry.in).
|
7
|
+
|
8
|
+
* NEW: Added simple .jp TLD parser (whois.jprs.jp).
|
9
|
+
|
10
|
+
* FIXED: With some .lu domains, whois.dns.lu parser returns invalid values for nameservers.
|
11
|
+
|
12
|
+
|
4
13
|
== Release 1.0.11
|
5
14
|
|
6
15
|
* NEW: Added simple .af TLD parser (whois.nic.af).
|
data/Manifest
CHANGED
@@ -50,6 +50,7 @@ lib/whois/answer/parser/whois.eu.rb
|
|
50
50
|
lib/whois/answer/parser/whois.hkdnr.net.hk.rb
|
51
51
|
lib/whois/answer/parser/whois.iana.org.rb
|
52
52
|
lib/whois/answer/parser/whois.isnic.is.rb
|
53
|
+
lib/whois/answer/parser/whois.jprs.jp.rb
|
53
54
|
lib/whois/answer/parser/whois.meregistry.net.rb
|
54
55
|
lib/whois/answer/parser/whois.museum.rb
|
55
56
|
lib/whois/answer/parser/whois.nic-se.se.rb
|
@@ -88,6 +89,7 @@ lib/whois/answer/parser/whois.pandi.or.id.rb
|
|
88
89
|
lib/whois/answer/parser/whois.publicinterestregistry.net.rb
|
89
90
|
lib/whois/answer/parser/whois.register.bg.rb
|
90
91
|
lib/whois/answer/parser/whois.registro.br.rb
|
92
|
+
lib/whois/answer/parser/whois.registry.in.rb
|
91
93
|
lib/whois/answer/parser/whois.registrypro.pro.rb
|
92
94
|
lib/whois/answer/parser/whois.ripe.net.rb
|
93
95
|
lib/whois/answer/parser/whois.ripn.net.rb
|
@@ -148,6 +150,7 @@ test/answer/parser/whois.eu_test.rb
|
|
148
150
|
test/answer/parser/whois.hkdnr.net.hk_test.rb
|
149
151
|
test/answer/parser/whois.iana.org_test.rb
|
150
152
|
test/answer/parser/whois.isnic.is_test.rb
|
153
|
+
test/answer/parser/whois.jprs.jp_test.rb
|
151
154
|
test/answer/parser/whois.meregistry.net_test.rb
|
152
155
|
test/answer/parser/whois.museum_test.rb
|
153
156
|
test/answer/parser/whois.nic-se.se_test.rb
|
@@ -186,6 +189,7 @@ test/answer/parser/whois.pandi.or.id_test.rb
|
|
186
189
|
test/answer/parser/whois.publicinterestregistry.net_test.rb
|
187
190
|
test/answer/parser/whois.register.bg_test.rb
|
188
191
|
test/answer/parser/whois.registro.br_test.rb
|
192
|
+
test/answer/parser/whois.registry.in_test.rb
|
189
193
|
test/answer/parser/whois.registrypro.pro_test.rb
|
190
194
|
test/answer/parser/whois.ripe.net_test.rb
|
191
195
|
test/answer/parser/whois.ripn.net_test.rb
|
@@ -275,6 +279,7 @@ test/testcases/responses/whois.dk-hostmaster.dk/registered.txt
|
|
275
279
|
test/testcases/responses/whois.dns.be/available.txt
|
276
280
|
test/testcases/responses/whois.dns.be/registered.txt
|
277
281
|
test/testcases/responses/whois.dns.lu/available.txt
|
282
|
+
test/testcases/responses/whois.dns.lu/property_nameservers_with_ip.txt
|
278
283
|
test/testcases/responses/whois.dns.lu/registered.txt
|
279
284
|
test/testcases/responses/whois.domain-registry.nl/available.txt
|
280
285
|
test/testcases/responses/whois.domain-registry.nl/registered.txt
|
@@ -299,6 +304,8 @@ test/testcases/responses/whois.iana.org/available.txt
|
|
299
304
|
test/testcases/responses/whois.iana.org/registered.txt
|
300
305
|
test/testcases/responses/whois.isnic.is/available.txt
|
301
306
|
test/testcases/responses/whois.isnic.is/registered.txt
|
307
|
+
test/testcases/responses/whois.jprs.jp/available.txt
|
308
|
+
test/testcases/responses/whois.jprs.jp/registered.txt
|
302
309
|
test/testcases/responses/whois.meregistry.net/available.txt
|
303
310
|
test/testcases/responses/whois.meregistry.net/registered.txt
|
304
311
|
test/testcases/responses/whois.museum/available.txt
|
@@ -397,6 +404,8 @@ test/testcases/responses/whois.register.bg/property_nameservers_with_ip.txt
|
|
397
404
|
test/testcases/responses/whois.register.bg/registered.txt
|
398
405
|
test/testcases/responses/whois.registro.br/available.txt
|
399
406
|
test/testcases/responses/whois.registro.br/registered.txt
|
407
|
+
test/testcases/responses/whois.registry.in/available.txt
|
408
|
+
test/testcases/responses/whois.registry.in/registered.txt
|
400
409
|
test/testcases/responses/whois.registrypro.pro/available.txt
|
401
410
|
test/testcases/responses/whois.registrypro.pro/registered.txt
|
402
411
|
test/testcases/responses/whois.ripe.net/fo/available.txt
|
@@ -62,7 +62,7 @@ module Whois
|
|
62
62
|
|
63
63
|
|
64
64
|
property_supported :nameservers do
|
65
|
-
@nameservers ||= content_for_scanner.scan(/nserver:\s+(.+)\n/).flatten
|
65
|
+
@nameservers ||= content_for_scanner.scan(/nserver:\s+(.+)\n/).flatten.map { |value| value.split(" ").first }
|
66
66
|
end
|
67
67
|
|
68
68
|
end
|
@@ -0,0 +1,82 @@
|
|
1
|
+
#
|
2
|
+
# = Ruby Whois
|
3
|
+
#
|
4
|
+
# An intelligent pure Ruby WHOIS client and parser.
|
5
|
+
#
|
6
|
+
#
|
7
|
+
# Category:: Net
|
8
|
+
# Package:: Whois
|
9
|
+
# Author:: Simone Carletti <weppos@weppos.net>
|
10
|
+
# License:: MIT License
|
11
|
+
#
|
12
|
+
#--
|
13
|
+
#
|
14
|
+
#++
|
15
|
+
|
16
|
+
|
17
|
+
require 'whois/answer/parser/base'
|
18
|
+
|
19
|
+
|
20
|
+
module Whois
|
21
|
+
class Answer
|
22
|
+
class Parser
|
23
|
+
|
24
|
+
#
|
25
|
+
# = whois.jprs.jp parser
|
26
|
+
#
|
27
|
+
# Parser for the whois.jprs.jp server.
|
28
|
+
#
|
29
|
+
# NOTE: This parser is just a stub and provides only a few basic methods
|
30
|
+
# to check for domain availability and get domain status.
|
31
|
+
# Please consider to contribute implementing missing methods.
|
32
|
+
# See WhoisNicIt parser for an explanation of all available methods
|
33
|
+
# and examples.
|
34
|
+
#
|
35
|
+
class WhoisJprsJp < Base
|
36
|
+
|
37
|
+
property_supported :status do
|
38
|
+
@status ||= if content_for_scanner =~ /\[Status\]\s+(.*)\n/
|
39
|
+
$1
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
43
|
+
property_supported :available? do
|
44
|
+
@available ||= !!(content_for_scanner =~ /No match!!/)
|
45
|
+
end
|
46
|
+
|
47
|
+
property_supported :registered? do
|
48
|
+
!available?
|
49
|
+
end
|
50
|
+
|
51
|
+
|
52
|
+
# TODO: timezone ('Asia/Tokyo')
|
53
|
+
property_supported :created_on do
|
54
|
+
@created_on ||= if content_for_scanner =~ /\[Created on\]\s+(.*)\n/
|
55
|
+
Time.parse($1)
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
59
|
+
# TODO: timezone ('Asia/Tokyo')
|
60
|
+
property_supported :updated_on do
|
61
|
+
@updated_on ||= if content_for_scanner =~ /\[Last Updated\]\s+(.*)\n/
|
62
|
+
Time.parse($1)
|
63
|
+
end
|
64
|
+
end
|
65
|
+
|
66
|
+
# TODO: timezone ('Asia/Tokyo')
|
67
|
+
property_supported :expires_on do
|
68
|
+
@expires_on ||= if content_for_scanner =~ /\[Expires on\]\s+(.*)\n/
|
69
|
+
Time.parse($1)
|
70
|
+
end
|
71
|
+
end
|
72
|
+
|
73
|
+
|
74
|
+
property_supported :nameservers do
|
75
|
+
@nameservers ||= content_for_scanner.scan(/\[Name Server\]\s+(.*?)\n/).flatten
|
76
|
+
end
|
77
|
+
|
78
|
+
end
|
79
|
+
|
80
|
+
end
|
81
|
+
end
|
82
|
+
end
|
@@ -0,0 +1,77 @@
|
|
1
|
+
#
|
2
|
+
# = Ruby Whois
|
3
|
+
#
|
4
|
+
# An intelligent pure Ruby WHOIS client and parser.
|
5
|
+
#
|
6
|
+
#
|
7
|
+
# Category:: Net
|
8
|
+
# Package:: Whois
|
9
|
+
# Author:: Simone Carletti <weppos@weppos.net>
|
10
|
+
# License:: MIT License
|
11
|
+
#
|
12
|
+
#--
|
13
|
+
#
|
14
|
+
#++
|
15
|
+
|
16
|
+
|
17
|
+
require 'whois/answer/parser/base'
|
18
|
+
|
19
|
+
|
20
|
+
module Whois
|
21
|
+
class Answer
|
22
|
+
class Parser
|
23
|
+
|
24
|
+
#
|
25
|
+
# = whois.registry.in parser
|
26
|
+
#
|
27
|
+
# Parser for the whois.registry.in server.
|
28
|
+
#
|
29
|
+
# NOTE: This parser is just a stub and provides only a few basic methods
|
30
|
+
# to check for domain availability and get domain status.
|
31
|
+
# Please consider to contribute implementing missing methods.
|
32
|
+
# See WhoisNicIt parser for an explanation of all available methods
|
33
|
+
# and examples.
|
34
|
+
#
|
35
|
+
class WhoisRegistryIn < Base
|
36
|
+
|
37
|
+
property_supported :status do
|
38
|
+
@status ||= content_for_scanner.scan(/Status:(.*?)\n/).flatten
|
39
|
+
end
|
40
|
+
|
41
|
+
property_supported :available? do
|
42
|
+
@available ||= (content_for_scanner.strip == "NOT FOUND")
|
43
|
+
end
|
44
|
+
|
45
|
+
property_supported :registered? do
|
46
|
+
!available?
|
47
|
+
end
|
48
|
+
|
49
|
+
|
50
|
+
property_supported :created_on do
|
51
|
+
@created_on ||= if content_for_scanner =~ /Created On:(.*?)\n/
|
52
|
+
Time.parse($1)
|
53
|
+
end
|
54
|
+
end
|
55
|
+
|
56
|
+
property_supported :updated_on do
|
57
|
+
@updated_on ||= if content_for_scanner =~ /Last Updated On:(.*?)\n/
|
58
|
+
Time.parse($1)
|
59
|
+
end
|
60
|
+
end
|
61
|
+
|
62
|
+
property_supported :expires_on do
|
63
|
+
@expires_on ||= if content_for_scanner =~ /Expiration Date:(.*?)\n/
|
64
|
+
Time.parse($1)
|
65
|
+
end
|
66
|
+
end
|
67
|
+
|
68
|
+
|
69
|
+
property_supported :nameservers do
|
70
|
+
@nameservers ||= content_for_scanner.scan(/Name Server:([^\s]*)\n/).flatten.map(&:downcase)
|
71
|
+
end
|
72
|
+
|
73
|
+
end
|
74
|
+
|
75
|
+
end
|
76
|
+
end
|
77
|
+
end
|
data/lib/whois/version.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
require 'test_helper'
|
2
|
-
require 'whois/answer/parser/whois.dns.lu
|
2
|
+
require 'whois/answer/parser/whois.dns.lu'
|
3
3
|
|
4
4
|
class AnswerParserWhoisDnsLuTest < Whois::Answer::Parser::TestCase
|
5
5
|
|
@@ -67,4 +67,11 @@ class AnswerParserWhoisDnsLuTest < Whois::Answer::Parser::TestCase
|
|
67
67
|
assert_equal expected, parser.instance_eval { @nameservers }
|
68
68
|
end
|
69
69
|
|
70
|
+
def test_nameservers_with_ip
|
71
|
+
parser = @klass.new(load_part('/property_nameservers_with_ip.txt'))
|
72
|
+
expected = %w( ns1.arbed.lu ns1.pt.lu ns2.arbed.lu )
|
73
|
+
assert_equal expected, parser.nameservers
|
74
|
+
assert_equal expected, parser.instance_eval { @nameservers }
|
75
|
+
end
|
76
|
+
|
70
77
|
end
|