whois 1.6.1 → 1.6.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (31) hide show
  1. data/CHANGELOG.rdoc +44 -1
  2. data/bin/ruby-whois +3 -3
  3. data/lib/whois/answer/parser/NOTES.txt +4 -0
  4. data/lib/whois/answer/parser/whois.aero.rb +1 -1
  5. data/lib/whois/answer/parser/whois.cnnic.cn.rb +4 -4
  6. data/lib/whois/answer/parser/whois.co.pl.rb +106 -0
  7. data/lib/whois/answer/parser/whois.co.ug.rb +1 -1
  8. data/lib/whois/answer/parser/whois.coza.net.za.rb +106 -0
  9. data/lib/whois/answer/parser/whois.dk-hostmaster.dk.rb +1 -1
  10. data/lib/whois/answer/parser/whois.dns.pl.rb +77 -0
  11. data/lib/whois/answer/parser/whois.gov.za.rb +71 -0
  12. data/lib/whois/answer/parser/whois.iam.net.ma.rb +72 -0
  13. data/lib/whois/answer/parser/whois.ja.net.rb +85 -0
  14. data/lib/whois/answer/parser/whois.nic.cd.rb +4 -4
  15. data/lib/whois/answer/parser/whois.nic.ci.rb +77 -0
  16. data/lib/whois/answer/parser/whois.nic.ck.rb +1 -1
  17. data/lib/whois/answer/parser/whois.nic.nu.rb +3 -3
  18. data/lib/whois/answer/parser/whois.nic.pr.rb +75 -0
  19. data/lib/whois/answer/parser/whois.nic.sh.rb +99 -0
  20. data/lib/whois/answer/parser/whois.nic.sl.rb +83 -0
  21. data/lib/whois/answer/parser/whois.org.za.rb +96 -0
  22. data/lib/whois/answer/parser/whois.registry.gy.rb +90 -0
  23. data/lib/whois/answer/parser/whois.registry.hm.rb +79 -0
  24. data/lib/whois/answer/parser/whois.sgnic.sg.rb +77 -0
  25. data/lib/whois/answer/parser/whois.sk-nic.sk.rb +81 -0
  26. data/lib/whois/answer/parser/whois.thnic.co.th.rb +85 -0
  27. data/lib/whois/answer/parser/whois.twnic.net.tw.rb +81 -0
  28. data/lib/whois/definitions/tlds.rb +3 -3
  29. data/lib/whois/version.rb +1 -1
  30. data/whois.gemspec +2 -2
  31. metadata +21 -4
@@ -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.sgnic.sg parser
26
+ #
27
+ # Parser for the whois.sgnic.sg 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 WhoisSgnicSg < Base
36
+
37
+ property_supported :status do
38
+ @status ||= content_for_scanner.scan(/^\s+Domain Status:\s+(.+?)\n/).flatten
39
+ end
40
+
41
+ property_supported :available? do
42
+ @available ||= !!(content_for_scanner.strip == "Domain Not Found")
43
+ end
44
+
45
+ property_supported :registered? do
46
+ @registered ||= !available?
47
+ end
48
+
49
+
50
+ property_supported :created_on do
51
+ @created_on ||= if content_for_scanner =~ /^\s+Creation 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 =~ /^\s+Expiration Date:\s+(.*)\n/
60
+ Time.parse($1)
61
+ end
62
+ end
63
+
64
+
65
+ property_supported :nameservers do
66
+ @nameservers ||= if content_for_scanner =~ /^\s+Name Servers:\n((.+\n)+)\n/
67
+ $1.split("\n").map { |value| value.strip.downcase }
68
+ else
69
+ []
70
+ end
71
+ end
72
+
73
+ end
74
+
75
+ end
76
+ end
77
+ end
@@ -0,0 +1,81 @@
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.sk-nic.sk parser
26
+ #
27
+ # Parser for the whois.sk-nic.sk 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 WhoisSkNicSk < Base
36
+
37
+ property_supported :status do
38
+ @status ||= if content_for_scanner =~ /^Domain-status\s+(.+)\n/
39
+ case $1.downcase
40
+ when "dom_ok" then :registered
41
+ else
42
+ Whois.bug!(ParserError, "Unknown status `#{$1}'.")
43
+ end
44
+ else
45
+ :available
46
+ end
47
+ end
48
+
49
+ property_supported :available? do
50
+ @available ||= !!(content_for_scanner =~ /^Not found/)
51
+ end
52
+
53
+ property_supported :registered? do
54
+ @registered ||= !available?
55
+ end
56
+
57
+
58
+ property_not_supported :created_on
59
+
60
+ property_supported :updated_on do
61
+ @updated_on ||= if content_for_scanner =~ /^Last-update\s+(.*)\n/
62
+ Time.parse($1)
63
+ end
64
+ end
65
+
66
+ property_supported :expires_on do
67
+ @expires_on ||= if content_for_scanner =~ /^Valid-date\s+(.*)\n/
68
+ Time.parse($1)
69
+ end
70
+ end
71
+
72
+
73
+ property_supported :nameservers do
74
+ @nameservers ||= content_for_scanner.scan(/dns_name\s+(.+)\n/).flatten
75
+ end
76
+
77
+ end
78
+
79
+ end
80
+ end
81
+ end
@@ -0,0 +1,85 @@
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.thnic.co.th parser
26
+ #
27
+ # Parser for the whois.thnic.co.th 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 WhoisThnicCoTh < Base
36
+
37
+ property_supported :status do
38
+ @status ||= if content_for_scanner =~ /Status: (.+?)\n/
39
+ case $1.downcase
40
+ when "active" then :registered
41
+ else
42
+ Whois.bug!(ParserError, "Unknown status `#{$1}'.")
43
+ end
44
+ else
45
+ :available
46
+ end
47
+ end
48
+
49
+ property_supported :available? do
50
+ @available ||= !!(content_for_scanner =~ /^% No entries found for the selected source/)
51
+ end
52
+
53
+ property_supported :registered? do
54
+ @registered ||= !available?
55
+ end
56
+
57
+
58
+ property_supported :created_on do
59
+ @created_on ||= if content_for_scanner =~ /^Created Date: (.+?)\n/
60
+ Time.parse($1)
61
+ end
62
+ end
63
+
64
+ property_supported :updated_on do
65
+ @updated_on ||= if content_for_scanner =~ /^Updated Date: (.+?)\n/
66
+ Time.parse($1)
67
+ end
68
+ end
69
+
70
+ property_supported :expires_on do
71
+ @expires_on ||= if content_for_scanner =~ /^Exp Date: (.+?)\n/
72
+ Time.parse($1)
73
+ end
74
+ end
75
+
76
+
77
+ property_supported :nameservers do
78
+ @nameservers ||= content_for_scanner.scan(/^Name Server: (.+)\n/).flatten.map(&:downcase)
79
+ end
80
+
81
+ end
82
+
83
+ end
84
+ end
85
+ end
@@ -0,0 +1,81 @@
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>, Mikkel Kristensen <mikkel@tdx.dk>
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.twnic.net.tw
26
+ #
27
+ # Parser for the whois.twnic.net.tw 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 WhoisTwnicNetTw < 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.strip == "No Found")
47
+ end
48
+
49
+ property_supported :registered? do
50
+ @registered ||= !available?
51
+ end
52
+
53
+
54
+ property_supported :created_on do
55
+ @created_on ||= if content_for_scanner =~ /Record created on ([^ ]+) .+\n/
56
+ Time.parse($1)
57
+ end
58
+ end
59
+
60
+ property_not_supported :updated_on
61
+
62
+ property_supported :expires_on do
63
+ @expires_on ||= if content_for_scanner =~ /Record expires on ([^ ]+) .+\n/
64
+ Time.parse($1)
65
+ end
66
+ end
67
+
68
+
69
+ property_supported :nameservers do
70
+ @nameservers ||= if content_for_scanner =~ /Domain servers in listed order:\n((.+\n)+)\n/
71
+ $1.split("\n").map { |value| value.strip }
72
+ else
73
+ []
74
+ end
75
+ end
76
+
77
+ end
78
+
79
+ end
80
+ end
81
+ end
@@ -244,7 +244,7 @@ Whois::Server.define :tld, ".sb", "whois.nic.net.sb"
244
244
  Whois::Server.define :tld, ".sc", "whois.afilias-grs.info", {:adapter=>Whois::Server::Adapters::Afilias}
245
245
  Whois::Server.define :tld, ".sd", nil, {:adapter=>Whois::Server::Adapters::None}
246
246
  Whois::Server.define :tld, ".se", "whois.nic-se.se"
247
- Whois::Server.define :tld, ".sg", "whois.nic.net.sg"
247
+ Whois::Server.define :tld, ".sg", "whois.sgnic.sg"
248
248
  Whois::Server.define :tld, ".sh", "whois.nic.sh"
249
249
  Whois::Server.define :tld, ".si", "whois.arnes.si"
250
250
  Whois::Server.define :tld, ".sj", nil, {:adapter=>Whois::Server::Adapters::None}
@@ -263,7 +263,7 @@ Whois::Server.define :tld, ".tc", "whois.adamsnames.tc"
263
263
  Whois::Server.define :tld, ".td", nil, {:adapter=>Whois::Server::Adapters::None}
264
264
  Whois::Server.define :tld, ".tf", "whois.nic.fr"
265
265
  Whois::Server.define :tld, ".tg", nil, {:web=>"http://www.nic.tg/", :adapter=>Whois::Server::Adapters::Web}
266
- Whois::Server.define :tld, ".th", "whois.thnic.net"
266
+ Whois::Server.define :tld, ".th", "whois.thnic.co.th"
267
267
  Whois::Server.define :tld, ".tj", nil, {:web=>"http://www.nic.tj/whois.html", :adapter=>Whois::Server::Adapters::Web}
268
268
  Whois::Server.define :tld, ".tk", "whois.dot.tk"
269
269
  Whois::Server.define :tld, ".tl", "whois.nic.tl"
@@ -309,7 +309,7 @@ Whois::Server.define :tld, ".yt", "whois.nic.fr"
309
309
  Whois::Server.define :tld, ".ac.za", "whois.ac.za"
310
310
  Whois::Server.define :tld, ".co.za", "whois.coza.net.za"
311
311
  Whois::Server.define :tld, ".gov.za", "whois.gov.za"
312
- Whois::Server.define :tld, ".org.za", nil, {:web=>"http://www.org.za/", :adapter=>Whois::Server::Adapters::Web}
312
+ Whois::Server.define :tld, ".org.za", "whois.org.za"
313
313
  Whois::Server.define :tld, ".za", nil, {:adapter=>Whois::Server::Adapters::None}
314
314
  Whois::Server.define :tld, ".zm", nil, {:adapter=>Whois::Server::Adapters::None}
315
315
  Whois::Server.define :tld, ".zw", nil, {:adapter=>Whois::Server::Adapters::None}
data/lib/whois/version.rb CHANGED
@@ -19,7 +19,7 @@ module Whois
19
19
  module Version
20
20
  MAJOR = 1
21
21
  MINOR = 6
22
- PATCH = 1
22
+ PATCH = 2
23
23
  BUILD = nil
24
24
 
25
25
  STRING = [MAJOR, MINOR, PATCH, BUILD].compact.join(".")
data/whois.gemspec CHANGED
@@ -2,11 +2,11 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{whois}
5
- s.version = "1.6.0"
5
+ s.version = "1.6.1"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Simone Carletti"]
9
- s.date = %q{2010-10-31}
9
+ s.date = %q{2010-11-08}
10
10
  s.default_executable = %q{ruby-whois}
11
11
  s.description = %q{ Whois is an intelligent WHOIS client and parser written in pure Ruby. It can query registry data for IPv4, IPv6 and top level domains, parse and convert responses into easy-to-use Ruby objects.
12
12
  }
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: whois
3
3
  version: !ruby/object:Gem::Version
4
- hash: 13
4
+ hash: 11
5
5
  prerelease: false
6
6
  segments:
7
7
  - 1
8
8
  - 6
9
- - 1
10
- version: 1.6.1
9
+ - 2
10
+ version: 1.6.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - Simone Carletti
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-11-08 00:00:00 +01:00
18
+ date: 2010-11-17 00:00:00 +01:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -77,12 +77,15 @@ files:
77
77
  - lib/whois/answer/parser/whois.cnnic.cn.rb
78
78
  - lib/whois/answer/parser/whois.cnnic.net.cn.rb
79
79
  - lib/whois/answer/parser/whois.co.ca.rb
80
+ - lib/whois/answer/parser/whois.co.pl.rb
80
81
  - lib/whois/answer/parser/whois.co.ug.rb
82
+ - lib/whois/answer/parser/whois.coza.net.za.rb
81
83
  - lib/whois/answer/parser/whois.crsnic.net.rb
82
84
  - lib/whois/answer/parser/whois.denic.de.rb
83
85
  - lib/whois/answer/parser/whois.dk-hostmaster.dk.rb
84
86
  - lib/whois/answer/parser/whois.dns.be.rb
85
87
  - lib/whois/answer/parser/whois.dns.lu.rb
88
+ - lib/whois/answer/parser/whois.dns.pl.rb
86
89
  - lib/whois/answer/parser/whois.dns.pt.rb
87
90
  - lib/whois/answer/parser/whois.domain-registry.nl.rb
88
91
  - lib/whois/answer/parser/whois.domain.kg.rb
@@ -97,12 +100,15 @@ files:
97
100
  - lib/whois/answer/parser/whois.eu.rb
98
101
  - lib/whois/answer/parser/whois.ficora.fi.rb
99
102
  - lib/whois/answer/parser/whois.gg.rb
103
+ - lib/whois/answer/parser/whois.gov.za.rb
100
104
  - lib/whois/answer/parser/whois.hkdnr.net.hk.rb
101
105
  - lib/whois/answer/parser/whois.hkirc.hk.rb
106
+ - lib/whois/answer/parser/whois.iam.net.ma.rb
102
107
  - lib/whois/answer/parser/whois.iana.org.rb
103
108
  - lib/whois/answer/parser/whois.in.ua.rb
104
109
  - lib/whois/answer/parser/whois.isnic.is.rb
105
110
  - lib/whois/answer/parser/whois.isoc.org.il.rb
111
+ - lib/whois/answer/parser/whois.ja.net.rb
106
112
  - lib/whois/answer/parser/whois.je.rb
107
113
  - lib/whois/answer/parser/whois.jprs.jp.rb
108
114
  - lib/whois/answer/parser/whois.kenic.or.ke.rb
@@ -123,6 +129,7 @@ files:
123
129
  - lib/whois/answer/parser/whois.nic.cc.rb
124
130
  - lib/whois/answer/parser/whois.nic.cd.rb
125
131
  - lib/whois/answer/parser/whois.nic.ch.rb
132
+ - lib/whois/answer/parser/whois.nic.ci.rb
126
133
  - lib/whois/answer/parser/whois.nic.ck.rb
127
134
  - lib/whois/answer/parser/whois.nic.cl.rb
128
135
  - lib/whois/answer/parser/whois.nic.co.rb
@@ -159,7 +166,10 @@ files:
159
166
  - lib/whois/answer/parser/whois.nic.nu.rb
160
167
  - lib/whois/answer/parser/whois.nic.or.kr.rb
161
168
  - lib/whois/answer/parser/whois.nic.org.uy.rb
169
+ - lib/whois/answer/parser/whois.nic.pr.rb
162
170
  - lib/whois/answer/parser/whois.nic.priv.at.rb
171
+ - lib/whois/answer/parser/whois.nic.sh.rb
172
+ - lib/whois/answer/parser/whois.nic.sl.rb
163
173
  - lib/whois/answer/parser/whois.nic.sn.rb
164
174
  - lib/whois/answer/parser/whois.nic.st.rb
165
175
  - lib/whois/answer/parser/whois.nic.tel.rb
@@ -172,19 +182,26 @@ files:
172
182
  - lib/whois/answer/parser/whois.nic.us.rb
173
183
  - lib/whois/answer/parser/whois.nic.ve.rb
174
184
  - lib/whois/answer/parser/whois.norid.no.rb
185
+ - lib/whois/answer/parser/whois.org.za.rb
175
186
  - lib/whois/answer/parser/whois.pandi.or.id.rb
176
187
  - lib/whois/answer/parser/whois.pnina.ps.rb
177
188
  - lib/whois/answer/parser/whois.publicinterestregistry.net.rb
178
189
  - lib/whois/answer/parser/whois.register.bg.rb
179
190
  - lib/whois/answer/parser/whois.registro.br.rb
191
+ - lib/whois/answer/parser/whois.registry.gy.rb
192
+ - lib/whois/answer/parser/whois.registry.hm.rb
180
193
  - lib/whois/answer/parser/whois.registry.in.rb
181
194
  - lib/whois/answer/parser/whois.registrypro.pro.rb
182
195
  - lib/whois/answer/parser/whois.ripe.net.rb
183
196
  - lib/whois/answer/parser/whois.ripn.net.rb
184
197
  - lib/whois/answer/parser/whois.rotld.ro.rb
185
198
  - lib/whois/answer/parser/whois.samoanic.ws.rb
199
+ - lib/whois/answer/parser/whois.sgnic.sg.rb
200
+ - lib/whois/answer/parser/whois.sk-nic.sk.rb
186
201
  - lib/whois/answer/parser/whois.srs.net.nz.rb
202
+ - lib/whois/answer/parser/whois.thnic.co.th.rb
187
203
  - lib/whois/answer/parser/whois.tonic.to.rb
204
+ - lib/whois/answer/parser/whois.twnic.net.tw.rb
188
205
  - lib/whois/answer/parser/whois.tznic.or.tz.rb
189
206
  - lib/whois/answer/parser/whois.usp.ac.fj.rb
190
207
  - lib/whois/answer/parser/whois.za.net.rb