whois 1.0.8 → 1.0.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (36) hide show
  1. data/CHANGELOG.rdoc +17 -0
  2. data/Manifest +25 -0
  3. data/lib/whois/answer/parser/whois.arnes.si.rb +75 -0
  4. data/lib/whois/answer/parser/whois.cnnic.net.cn.rb +73 -0
  5. data/lib/whois/answer/parser/whois.domreg.lt.rb +71 -0
  6. data/lib/whois/answer/parser/whois.nic.at.rb +73 -0
  7. data/lib/whois/answer/parser/whois.nic.ch.rb +2 -2
  8. data/lib/whois/answer/parser/whois.nic.lv.rb +73 -0
  9. data/lib/whois/answer/parser/whois.nic.ly.rb +2 -2
  10. data/lib/whois/answer/parser/whois.pandi.or.id.rb +79 -0
  11. data/lib/whois/answer/parser/whois.ripn.net.rb +7 -1
  12. data/lib/whois/definitions/tlds.rb +1 -1
  13. data/lib/whois/version.rb +1 -1
  14. data/test/answer/parser/whois.arnes.si_test.rb +72 -0
  15. data/test/answer/parser/whois.cnnic.net.cn_test.rb +73 -0
  16. data/test/answer/parser/whois.domreg.lt_test.rb +60 -0
  17. data/test/answer/parser/whois.nic.at_test.rb +65 -0
  18. data/test/answer/parser/whois.nic.lv_test.rb +65 -0
  19. data/test/answer/parser/whois.pandi.or.id_test.rb +79 -0
  20. data/test/answer/parser/whois.ripn.net_test.rb +7 -0
  21. data/test/list_tld +5 -5
  22. data/test/testcases/responses/whois.arnes.si/available.txt +29 -0
  23. data/test/testcases/responses/whois.arnes.si/registered.txt +55 -0
  24. data/test/testcases/responses/whois.cnnic.net.cn/available.txt +1 -0
  25. data/test/testcases/responses/whois.cnnic.net.cn/registered.txt +19 -0
  26. data/test/testcases/responses/whois.domreg.lt/available.txt +18 -0
  27. data/test/testcases/responses/whois.domreg.lt/registered.txt +37 -0
  28. data/test/testcases/responses/whois.nic.at/available.txt +25 -0
  29. data/test/testcases/responses/whois.nic.at/registered.txt +65 -0
  30. data/test/testcases/responses/whois.nic.lv/available.txt +7 -0
  31. data/test/testcases/responses/whois.nic.lv/registered.txt +33 -0
  32. data/test/testcases/responses/whois.pandi.or.id/available.txt +9 -0
  33. data/test/testcases/responses/whois.pandi.or.id/registered.txt +33 -0
  34. data/test/testcases/responses/whois.ripn.net/ru/property_nameservers_with_ip.txt +22 -0
  35. data/whois.gemspec +5 -5
  36. metadata +40 -3
data/CHANGELOG.rdoc CHANGED
@@ -1,6 +1,23 @@
1
1
  = Changelog
2
2
 
3
3
 
4
+ == Release 1.0.9
5
+
6
+ * ADDED: Added simple .lt TLD parser (whois.domreg.lt).
7
+
8
+ * ADDED: Added simple .at TLD parser (whois.nic.at).
9
+
10
+ * ADDED: Added simple .cn TLD parser (whois.cnnic.net.cn).
11
+
12
+ * ADDED: Added simple .lv TLD parser (whois.nic.lv).
13
+
14
+ * ADDED: Added simple .si TLD parser (whois.arnes.si).
15
+
16
+ * ADDED: Added simple .id TLD parser (whois.pandi.or.id).
17
+
18
+ * FIXED: With some .ru domains, whois.ripn.net parser returns invalid values for nameservers.
19
+
20
+
4
21
  == Release 1.0.8
5
22
 
6
23
  * ADDED: Added simple .nz TLD parser (whois.srs.net.nz).
data/Manifest CHANGED
@@ -28,14 +28,17 @@ lib/whois/answer/parser/whois.aeda.net.ae.rb
28
28
  lib/whois/answer/parser/whois.aero.rb
29
29
  lib/whois/answer/parser/whois.afilias-grs.info.rb
30
30
  lib/whois/answer/parser/whois.afilias.info.rb
31
+ lib/whois/answer/parser/whois.arnes.si.rb
31
32
  lib/whois/answer/parser/whois.biz.rb
32
33
  lib/whois/answer/parser/whois.cat.rb
33
34
  lib/whois/answer/parser/whois.cira.ca.rb
35
+ lib/whois/answer/parser/whois.cnnic.net.cn.rb
34
36
  lib/whois/answer/parser/whois.crsnic.net.rb
35
37
  lib/whois/answer/parser/whois.denic.de.rb
36
38
  lib/whois/answer/parser/whois.dk-hostmaster.dk.rb
37
39
  lib/whois/answer/parser/whois.domain-registry.nl.rb
38
40
  lib/whois/answer/parser/whois.domainregistry.ie.rb
41
+ lib/whois/answer/parser/whois.domreg.lt.rb
39
42
  lib/whois/answer/parser/whois.dotmobiregistry.net.rb
40
43
  lib/whois/answer/parser/whois.educause.edu.rb
41
44
  lib/whois/answer/parser/whois.eu.org.rb
@@ -47,6 +50,7 @@ lib/whois/answer/parser/whois.museum.rb
47
50
  lib/whois/answer/parser/whois.nic-se.se.rb
48
51
  lib/whois/answer/parser/whois.nic.ac.rb
49
52
  lib/whois/answer/parser/whois.nic.asia.rb
53
+ lib/whois/answer/parser/whois.nic.at.rb
50
54
  lib/whois/answer/parser/whois.nic.cc.rb
51
55
  lib/whois/answer/parser/whois.nic.cd.rb
52
56
  lib/whois/answer/parser/whois.nic.ch.rb
@@ -58,6 +62,7 @@ lib/whois/answer/parser/whois.nic.hu.rb
58
62
  lib/whois/answer/parser/whois.nic.im.rb
59
63
  lib/whois/answer/parser/whois.nic.io.rb
60
64
  lib/whois/answer/parser/whois.nic.it.rb
65
+ lib/whois/answer/parser/whois.nic.lv.rb
61
66
  lib/whois/answer/parser/whois.nic.ly.rb
62
67
  lib/whois/answer/parser/whois.nic.mu.rb
63
68
  lib/whois/answer/parser/whois.nic.name.rb
@@ -70,6 +75,7 @@ lib/whois/answer/parser/whois.nic.uk.rb
70
75
  lib/whois/answer/parser/whois.nic.us.rb
71
76
  lib/whois/answer/parser/whois.nic.ve.rb
72
77
  lib/whois/answer/parser/whois.norid.no.rb
78
+ lib/whois/answer/parser/whois.pandi.or.id.rb
73
79
  lib/whois/answer/parser/whois.publicinterestregistry.net.rb
74
80
  lib/whois/answer/parser/whois.register.bg.rb
75
81
  lib/whois/answer/parser/whois.registro.br.rb
@@ -111,14 +117,17 @@ test/answer/parser/whois.aeda.net.ae_test.rb
111
117
  test/answer/parser/whois.aero_test.rb
112
118
  test/answer/parser/whois.afilias-grs.info_test.rb
113
119
  test/answer/parser/whois.afilias.info_test.rb
120
+ test/answer/parser/whois.arnes.si_test.rb
114
121
  test/answer/parser/whois.biz_test.rb
115
122
  test/answer/parser/whois.cat_test.rb
116
123
  test/answer/parser/whois.cira.ca_test.rb
124
+ test/answer/parser/whois.cnnic.net.cn_test.rb
117
125
  test/answer/parser/whois.crsnic.net_test.rb
118
126
  test/answer/parser/whois.denic.de_test.rb
119
127
  test/answer/parser/whois.dk-hostmaster.dk_test.rb
120
128
  test/answer/parser/whois.domain-registry.nl_test.rb
121
129
  test/answer/parser/whois.domainregistry.ie_test.rb
130
+ test/answer/parser/whois.domreg.lt_test.rb
122
131
  test/answer/parser/whois.dotmobiregistry.net_test.rb
123
132
  test/answer/parser/whois.educause.edu_test.rb
124
133
  test/answer/parser/whois.eu.org_test.rb
@@ -130,6 +139,7 @@ test/answer/parser/whois.museum_test.rb
130
139
  test/answer/parser/whois.nic-se.se_test.rb
131
140
  test/answer/parser/whois.nic.ac_test.rb
132
141
  test/answer/parser/whois.nic.asia_test.rb
142
+ test/answer/parser/whois.nic.at_test.rb
133
143
  test/answer/parser/whois.nic.cc_test.rb
134
144
  test/answer/parser/whois.nic.cd_test.rb
135
145
  test/answer/parser/whois.nic.ch_test.rb
@@ -141,6 +151,7 @@ test/answer/parser/whois.nic.hu_test.rb
141
151
  test/answer/parser/whois.nic.im_test.rb
142
152
  test/answer/parser/whois.nic.io_test.rb
143
153
  test/answer/parser/whois.nic.it_test.rb
154
+ test/answer/parser/whois.nic.lv_test.rb
144
155
  test/answer/parser/whois.nic.ly_test.rb
145
156
  test/answer/parser/whois.nic.mu_test.rb
146
157
  test/answer/parser/whois.nic.name_test.rb
@@ -153,6 +164,7 @@ test/answer/parser/whois.nic.uk_test.rb
153
164
  test/answer/parser/whois.nic.us_test.rb
154
165
  test/answer/parser/whois.nic.ve_test.rb
155
166
  test/answer/parser/whois.norid.no_test.rb
167
+ test/answer/parser/whois.pandi.or.id_test.rb
156
168
  test/answer/parser/whois.publicinterestregistry.net_test.rb
157
169
  test/answer/parser/whois.register.bg_test.rb
158
170
  test/answer/parser/whois.registro.br_test.rb
@@ -217,12 +229,16 @@ test/testcases/responses/whois.afilias-grs.info/vc/available.txt
217
229
  test/testcases/responses/whois.afilias-grs.info/vc/registered.txt
218
230
  test/testcases/responses/whois.afilias.info/available.txt
219
231
  test/testcases/responses/whois.afilias.info/registered.txt
232
+ test/testcases/responses/whois.arnes.si/available.txt
233
+ test/testcases/responses/whois.arnes.si/registered.txt
220
234
  test/testcases/responses/whois.biz/available.txt
221
235
  test/testcases/responses/whois.biz/registered.txt
222
236
  test/testcases/responses/whois.cat/available.txt
223
237
  test/testcases/responses/whois.cat/registered.txt
224
238
  test/testcases/responses/whois.cira.ca/available.txt
225
239
  test/testcases/responses/whois.cira.ca/registered.txt
240
+ test/testcases/responses/whois.cnnic.net.cn/available.txt
241
+ test/testcases/responses/whois.cnnic.net.cn/registered.txt
226
242
  test/testcases/responses/whois.crsnic.net/MULTIPLE.txt
227
243
  test/testcases/responses/whois.crsnic.net/available.txt
228
244
  test/testcases/responses/whois.crsnic.net/nameservers_with_no_nameserver.txt
@@ -239,6 +255,8 @@ test/testcases/responses/whois.domain-registry.nl/available.txt
239
255
  test/testcases/responses/whois.domain-registry.nl/registered.txt
240
256
  test/testcases/responses/whois.domainregistry.ie/available.txt
241
257
  test/testcases/responses/whois.domainregistry.ie/registered.txt
258
+ test/testcases/responses/whois.domreg.lt/available.txt
259
+ test/testcases/responses/whois.domreg.lt/registered.txt
242
260
  test/testcases/responses/whois.dotmobiregistry.net/available.txt
243
261
  test/testcases/responses/whois.dotmobiregistry.net/registered.txt
244
262
  test/testcases/responses/whois.educause.edu/available.txt
@@ -264,6 +282,8 @@ test/testcases/responses/whois.nic.ac/available.txt
264
282
  test/testcases/responses/whois.nic.ac/registered.txt
265
283
  test/testcases/responses/whois.nic.asia/available.txt
266
284
  test/testcases/responses/whois.nic.asia/registered.txt
285
+ test/testcases/responses/whois.nic.at/available.txt
286
+ test/testcases/responses/whois.nic.at/registered.txt
267
287
  test/testcases/responses/whois.nic.cc/available.txt
268
288
  test/testcases/responses/whois.nic.cc/registered.txt
269
289
  test/testcases/responses/whois.nic.cd/available.txt
@@ -302,6 +322,8 @@ test/testcases/responses/whois.nic.it/contact.txt
302
322
  test/testcases/responses/whois.nic.it/registered.txt
303
323
  test/testcases/responses/whois.nic.it/status_active.txt
304
324
  test/testcases/responses/whois.nic.it/status_available.txt
325
+ test/testcases/responses/whois.nic.lv/available.txt
326
+ test/testcases/responses/whois.nic.lv/registered.txt
305
327
  test/testcases/responses/whois.nic.ly/available.txt
306
328
  test/testcases/responses/whois.nic.ly/registered.txt
307
329
  test/testcases/responses/whois.nic.mu/ki/available.txt
@@ -330,6 +352,8 @@ test/testcases/responses/whois.nic.ve/available.txt
330
352
  test/testcases/responses/whois.nic.ve/registered.txt
331
353
  test/testcases/responses/whois.norid.no/available.txt
332
354
  test/testcases/responses/whois.norid.no/registered.txt
355
+ test/testcases/responses/whois.pandi.or.id/available.txt
356
+ test/testcases/responses/whois.pandi.or.id/registered.txt
333
357
  test/testcases/responses/whois.publicinterestregistry.net/available.txt
334
358
  test/testcases/responses/whois.publicinterestregistry.net/registered.txt
335
359
  test/testcases/responses/whois.register.bg/available.txt
@@ -349,6 +373,7 @@ test/testcases/responses/whois.ripe.net/sm/registered.txt
349
373
  test/testcases/responses/whois.ripe.net/va/available.txt
350
374
  test/testcases/responses/whois.ripe.net/va/registered.txt
351
375
  test/testcases/responses/whois.ripn.net/ru/available.txt
376
+ test/testcases/responses/whois.ripn.net/ru/property_nameservers_with_ip.txt
352
377
  test/testcases/responses/whois.ripn.net/ru/registered.txt
353
378
  test/testcases/responses/whois.ripn.net/su/available.txt
354
379
  test/testcases/responses/whois.ripn.net/su/registered.txt
@@ -0,0 +1,75 @@
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.arnes.si parser
26
+ #
27
+ # Parser for the whois.arnes.si 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 WhoisArnesSi < Base
36
+
37
+ property_supported :status do
38
+ @status ||= if content_for_scanner =~ /status:\s+(.*)\n/
39
+ $1.downcase.to_sym
40
+ end
41
+ end
42
+
43
+ property_supported :available? do
44
+ @available ||= !!(content_for_scanner =~ /% No entries found/)
45
+ end
46
+
47
+ property_supported :registered? do
48
+ !available?
49
+ end
50
+
51
+
52
+ property_supported :created_on do
53
+ @created_on ||= if content_for_scanner =~ /created:\s+(.*)\n/
54
+ Time.parse($1)
55
+ end
56
+ end
57
+
58
+ property_not_supported :updated_on
59
+
60
+ property_supported :expires_on do
61
+ @expires_on ||= if content_for_scanner =~ /expire:\s+(.*)\n/
62
+ Time.parse($1)
63
+ end
64
+ end
65
+
66
+
67
+ property_supported :nameservers do
68
+ @nameservers ||= content_for_scanner.scan(/nameserver:\s+(.+)\n/).flatten
69
+ end
70
+
71
+ end
72
+
73
+ end
74
+ end
75
+ end
@@ -0,0 +1,73 @@
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.cnnic.net.cn parser
26
+ #
27
+ # Parser for the whois.cnnic.net.cn 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 WhoisCnnicNetCn < Base
36
+
37
+ property_supported :status do
38
+ @status ||= content_for_scanner.scan(/Domain Status:\s+(.*?)\n/).flatten
39
+ end
40
+
41
+ property_supported :available? do
42
+ @available ||= (content_for_scanner.strip == "no matching record")
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 =~ /Registration Date:\s+(.*)\n/
52
+ Time.parse($1)
53
+ end
54
+ end
55
+
56
+ property_not_supported :updated_on
57
+
58
+ property_supported :expires_on do
59
+ @expires_on ||= if content_for_scanner =~ /Expiration Date:\s+(.*)\n/
60
+ Time.parse($1)
61
+ end
62
+ end
63
+
64
+
65
+ property_supported :nameservers do
66
+ @nameservers ||= content_for_scanner.scan(/Name Server:(.*)\n/).flatten.map(&:downcase)
67
+ end
68
+
69
+ end
70
+
71
+ end
72
+ end
73
+ end
@@ -0,0 +1,71 @@
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.domreg.lt parser
26
+ #
27
+ # Parser for the whois.domreg.lt 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 WhoisDomregLt < Base
36
+
37
+ property_supported :status do
38
+ @status ||= if content_for_scanner =~ /Status:\s+(.*)\n/
39
+ $1.to_sym
40
+ end
41
+ end
42
+
43
+ property_supported :available? do
44
+ @available ||= (status == :available)
45
+ end
46
+
47
+ property_supported :registered? do
48
+ !available?
49
+ end
50
+
51
+
52
+ property_supported :created_on do
53
+ @created_on ||= if content_for_scanner =~ /Registered:\s+(.*)\n/
54
+ Time.parse($1)
55
+ end
56
+ end
57
+
58
+ property_not_supported :updated_on
59
+
60
+ property_not_supported :expires_on
61
+
62
+
63
+ property_supported :nameservers do
64
+ @nameservers ||= content_for_scanner.scan(/Nameserver:\s+(.*)\n/).flatten.map(&:strip)
65
+ end
66
+
67
+ end
68
+
69
+ end
70
+ end
71
+ end
@@ -0,0 +1,73 @@
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.nic.at parser
26
+ #
27
+ # Parser for the whois.nic.at 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 WhoisNicAt < Base
36
+
37
+ property_supported :status do
38
+ @status ||= if available?
39
+ :available
40
+ else
41
+ :registered
42
+ end
43
+ end
44
+
45
+ property_supported :available? do
46
+ @available ||= !!(content_for_scanner =~ /% nothing found/)
47
+ end
48
+
49
+ property_supported :registered? do
50
+ !available?
51
+ end
52
+
53
+
54
+ property_not_supported :created_on
55
+
56
+ property_supported :updated_on do
57
+ @updated_on ||= if content_for_scanner =~ /changed:\s+(.*)\n/
58
+ Time.parse($1)
59
+ end
60
+ end
61
+
62
+ property_not_supported :expires_on
63
+
64
+
65
+ property_supported :nameservers do
66
+ @nameservers ||= content_for_scanner.scan(/nserver:\s+(.+)\n/).flatten
67
+ end
68
+
69
+ end
70
+
71
+ end
72
+ end
73
+ end
@@ -60,8 +60,8 @@ module Whois
60
60
 
61
61
  # Nameservers are listed in the following formats:
62
62
  #
63
- # Nserver: ns1.prodns.de 213.160.64.75
64
- # Nserver: ns1.prodns.de
63
+ # ns1.citrin.ch
64
+ # ns1.citrin.ch [193.247.72.8]
65
65
  #
66
66
  # In both cases, always return only the name.
67
67
  property_supported :nameservers do
@@ -0,0 +1,73 @@
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.nic.lv parser
26
+ #
27
+ # Parser for the whois.nic.lv 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 WhoisNicLv < Base
36
+
37
+ property_supported :status do
38
+ if available?
39
+ :available
40
+ else
41
+ :registered
42
+ end
43
+ end
44
+
45
+ property_supported :available? do
46
+ @available ||= !!(content_for_scanner =~ /%ERR - Nothing found/)
47
+ end
48
+
49
+ property_supported :registered? do
50
+ !available?
51
+ end
52
+
53
+
54
+ property_not_supported :created_on
55
+
56
+ property_supported :updated_on do
57
+ @updated_on ||= if content_for_scanner =~ /changed:\s+(.*)\n/
58
+ Time.parse($1.split(" ", 2).last)
59
+ end
60
+ end
61
+
62
+ property_not_supported :expires_on
63
+
64
+
65
+ property_supported :nameservers do
66
+ @nameservers ||= content_for_scanner.scan(/nserver:\s+(.+)\n/).flatten
67
+ end
68
+
69
+ end
70
+
71
+ end
72
+ end
73
+ end
@@ -56,13 +56,13 @@ module Whois
56
56
  Time.parse($1)
57
57
  end
58
58
  end
59
-
59
+
60
60
  property_supported :updated_on do
61
61
  @updated_on ||= if content_for_scanner =~ /Updated:\s+(.*)\n/
62
62
  Time.parse($1)
63
63
  end
64
64
  end
65
-
65
+
66
66
  property_supported :expires_on do
67
67
  @expires_on ||= if content_for_scanner =~ /Expired:\s+(.*)\n/
68
68
  Time.parse($1)
@@ -0,0 +1,79 @@
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.pandi.or.id parser
26
+ #
27
+ # Parser for the whois.pandi.or.id 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 WhoisPandiOrId < Base
36
+
37
+ property_supported :status do
38
+ @status ||= if content_for_scanner =~ /domain-status:\s+(.*)\n/
39
+ $1
40
+ end
41
+ end
42
+
43
+ property_supported :available? do
44
+ @available ||= !!(content_for_scanner =~ /%ERROR:101: no entries found/)
45
+ end
46
+
47
+ property_supported :registered? do
48
+ !available?
49
+ end
50
+
51
+
52
+ property_supported :created_on do
53
+ @created_on ||= if content_for_scanner =~ /created:\s+(.*)\n/
54
+ Time.parse($1)
55
+ end
56
+ end
57
+
58
+ property_supported :updated_on do
59
+ @updated_on ||= if content_for_scanner =~ /last-update:\s+(.*)\n/
60
+ Time.parse($1)
61
+ end
62
+ end
63
+
64
+ property_supported :expires_on do
65
+ @expires_on ||= if content_for_scanner =~ /expires:\s+(.*)\n/
66
+ Time.parse($1)
67
+ end
68
+ end
69
+
70
+
71
+ property_supported :nameservers do
72
+ @nameservers ||= content_for_scanner.scan(/nserver:\s+(.+)\n/).flatten
73
+ end
74
+
75
+ end
76
+
77
+ end
78
+ end
79
+ end
@@ -66,8 +66,14 @@ module Whois
66
66
  end
67
67
 
68
68
 
69
+ # Nameservers are listed in the following formats:
70
+ #
71
+ # nserver: ns.masterhost.ru.
72
+ # nserver: ns.masterhost.ru. 217.16.20.30
73
+ #
74
+ # In both cases, always return only the name.
69
75
  property_supported :nameservers do
70
- @nameservers ||= content_for_scanner.scan(/nserver:\s+(.+)\n/).flatten.map { |value| value.chomp(".") }
76
+ @nameservers ||= content_for_scanner.scan(/nserver:\s+(.+)\n/).flatten.map { |value| value.split(" ").first.chomp(".") }
71
77
  end
72
78
 
73
79
  end
@@ -93,7 +93,7 @@ Whois::Server.define :tld, ".ck", "whois.nic.ck"
93
93
  Whois::Server.define :tld, ".cl", "whois.nic.cl"
94
94
  Whois::Server.define :tld, ".cm", nil, {:web=>"http://netcom.cm/whois.php", :adapter=>Whois::Server::Adapters::Web}
95
95
  Whois::Server.define :tld, ".edu.cn", "whois.edu.cn"
96
- Whois::Server.define :tld, ".cn", "whois.cnnic.net.cn"
96
+ Whois::Server.define :tld, ".cn", "whois.cnnic.cn"
97
97
  Whois::Server.define :tld, ".uk.co", "whois.uk.co"
98
98
  Whois::Server.define :tld, ".co", nil, {:web=>"https://www.whois.co/", :adapter=>Whois::Server::Adapters::Web}
99
99
  Whois::Server.define :tld, ".cr", nil, {:web=>"http://www.nic.cr/niccr_publico/showRegistroDominiosScreen.do", :adapter=>Whois::Server::Adapters::Web}
data/lib/whois/version.rb CHANGED
@@ -19,7 +19,7 @@ module Whois
19
19
  module Version
20
20
  MAJOR = 1
21
21
  MINOR = 0
22
- PATCH = 8
22
+ PATCH = 9
23
23
 
24
24
  STRING = [MAJOR, MINOR, PATCH].compact.join('.')
25
25
  end