whois 2.6.2 → 2.6.3
Sign up to get free protection for your applications and to get access to all the features.
- data/.yardopts +1 -1
- data/CHANGELOG.md +13 -0
- data/README.md +11 -13
- data/lib/whois.rb +2 -2
- data/lib/whois/errors.rb +1 -1
- data/lib/whois/record.rb +49 -43
- data/lib/whois/record/parser.rb +102 -102
- data/lib/whois/record/parser/base.rb +4 -4
- data/lib/whois/record/parser/whois.aero.rb +4 -0
- data/lib/whois/record/parser/whois.ati.tn.rb +1 -1
- data/lib/whois/record/parser/whois.audns.net.au.rb +1 -1
- data/lib/whois/record/parser/whois.cira.ca.rb +1 -1
- data/lib/whois/record/parser/whois.dns.hr.rb +1 -1
- data/lib/whois/record/parser/whois.dreamhost.com.rb +1 -1
- data/lib/whois/record/parser/whois.enom.com.rb +1 -1
- data/lib/whois/record/parser/whois.fi.rb +1 -1
- data/lib/whois/record/parser/whois.nc.rb +1 -1
- data/lib/whois/record/parser/whois.networksolutions.com.rb +1 -1
- data/lib/whois/record/parser/whois.nic.lk.rb +1 -1
- data/lib/whois/record/parser/whois.registry.om.rb +1 -1
- data/lib/whois/record/parser/whois.registrypro.pro.rb +5 -50
- data/lib/whois/record/parser/whois.rnids.rs.rb +1 -1
- data/lib/whois/record/parser/whois.sx.rb +1 -1
- data/lib/whois/record/parser/whois.ua.rb +2 -2
- data/lib/whois/record/scanners/whois.ati.tn.rb +1 -1
- data/lib/whois/record/scanners/whois.audns.net.au.rb +1 -1
- data/lib/whois/record/scanners/whois.centralnic.com.rb +1 -1
- data/lib/whois/record/scanners/whois.cira.ca.rb +1 -1
- data/lib/whois/record/scanners/whois.dns.hr.rb +1 -1
- data/lib/whois/record/scanners/whois.nc.rb +1 -1
- data/lib/whois/record/scanners/whois.registry.om.rb +1 -1
- data/lib/whois/record/scanners/whois.rnids.rs.rb +1 -1
- data/lib/whois/record/scanners/whois.sx.rb +1 -1
- data/lib/whois/server.rb +9 -5
- data/lib/whois/server/adapters/base.rb +3 -3
- data/lib/whois/version.rb +1 -1
- data/spec/fixtures/responses/whois.aero/status_registered.expected +36 -36
- data/spec/fixtures/responses/whois.registrypro.pro/status_available.expected +34 -0
- data/spec/fixtures/responses/whois.registrypro.pro/status_available.txt +1 -20
- data/spec/fixtures/responses/whois.registrypro.pro/status_registered.expected +87 -9
- data/spec/fixtures/responses/whois.registrypro.pro/status_registered.txt +94 -55
- data/spec/fixtures/responses/whois.ua/property_created_at_outofrange.expected +2 -0
- data/spec/fixtures/responses/whois.ua/property_created_at_outofrange.txt +93 -0
- data/spec/tlds +1 -1
- data/spec/whois/record/parser/responses/whois.aero/status_registered_spec.rb +36 -36
- data/spec/whois/record/parser/responses/whois.registrypro.pro/status_available_spec.rb +48 -0
- data/spec/whois/record/parser/responses/whois.registrypro.pro/status_registered_spec.rb +101 -9
- data/spec/whois/record/parser/responses/whois.ua/property_created_at_outofrange_spec.rb +29 -0
- data/spec/whois/record/parser_spec.rb +4 -0
- data/spec/whois/server_spec.rb +11 -2
- data/whois.gemspec +3 -3
- metadata +5 -2
@@ -211,12 +211,12 @@ module Whois
|
|
211
211
|
# is(:response_throttled?)
|
212
212
|
# # => true
|
213
213
|
#
|
214
|
-
# @api
|
214
|
+
# @api private
|
215
215
|
def is(symbol)
|
216
216
|
respond_to?(symbol) && send(symbol)
|
217
217
|
end
|
218
218
|
|
219
|
-
# @api
|
219
|
+
# @api private
|
220
220
|
def validate!
|
221
221
|
raise ResponseIsThrottled if is(:response_throttled?)
|
222
222
|
raise ResponseIsUnavailable if is(:response_unavailable?)
|
@@ -365,7 +365,7 @@ module Whois
|
|
365
365
|
|
366
366
|
private
|
367
367
|
|
368
|
-
# @api
|
368
|
+
# @api private
|
369
369
|
def typecast(value, type)
|
370
370
|
if Array == type
|
371
371
|
Array.wrap(value)
|
@@ -374,7 +374,7 @@ module Whois
|
|
374
374
|
end
|
375
375
|
end
|
376
376
|
|
377
|
-
# @api
|
377
|
+
# @api private
|
378
378
|
def handle_property(property, *args)
|
379
379
|
unless property_supported?(property)
|
380
380
|
return send(:"_property_#{property}", *args)
|
@@ -7,64 +7,19 @@
|
|
7
7
|
#++
|
8
8
|
|
9
9
|
|
10
|
-
require 'whois/record/parser/
|
10
|
+
require 'whois/record/parser/base_afilias'
|
11
11
|
|
12
12
|
|
13
13
|
module Whois
|
14
14
|
class Record
|
15
15
|
class Parser
|
16
16
|
|
17
|
-
#
|
18
|
-
# = whois.registrypro.pro parser
|
19
|
-
#
|
20
17
|
# Parser for the whois.registrypro.pro server.
|
18
|
+
#
|
19
|
+
# @see Whois::Record::Parser::Example
|
20
|
+
# The Example parser for the list of all available methods.
|
21
21
|
#
|
22
|
-
|
23
|
-
# to check for domain availability and get domain status.
|
24
|
-
# Please consider to contribute implementing missing methods.
|
25
|
-
# See WhoisNicIt parser for an explanation of all available methods
|
26
|
-
# and examples.
|
27
|
-
#
|
28
|
-
class WhoisRegistryproPro < Base
|
29
|
-
|
30
|
-
property_supported :status do
|
31
|
-
content_for_scanner.scan(/Status:(.*?)\n/).flatten
|
32
|
-
end
|
33
|
-
|
34
|
-
property_supported :available? do
|
35
|
-
!!(content_for_scanner =~ /No match/)
|
36
|
-
end
|
37
|
-
|
38
|
-
property_supported :registered? do
|
39
|
-
!available?
|
40
|
-
end
|
41
|
-
|
42
|
-
|
43
|
-
property_supported :created_on do
|
44
|
-
if content_for_scanner =~ /Created On:(.*)\n/
|
45
|
-
Time.parse($1)
|
46
|
-
end
|
47
|
-
end
|
48
|
-
|
49
|
-
property_supported :updated_on do
|
50
|
-
if content_for_scanner =~ /Last Updated On:(.*)\n/
|
51
|
-
Time.parse($1)
|
52
|
-
end
|
53
|
-
end
|
54
|
-
|
55
|
-
property_supported :expires_on do
|
56
|
-
if content_for_scanner =~ /Expiration Date:(.*)\n/
|
57
|
-
Time.parse($1)
|
58
|
-
end
|
59
|
-
end
|
60
|
-
|
61
|
-
|
62
|
-
property_supported :nameservers do
|
63
|
-
content_for_scanner.scan(/Name Server:(.+)\n/).flatten.map do |name|
|
64
|
-
Record::Nameserver.new(:name => name.downcase)
|
65
|
-
end
|
66
|
-
end
|
67
|
-
|
22
|
+
class WhoisRegistryproPro < BaseAfilias
|
68
23
|
end
|
69
24
|
|
70
25
|
end
|
@@ -16,7 +16,7 @@ module Whois
|
|
16
16
|
|
17
17
|
# Parser for the whois.ua server.
|
18
18
|
#
|
19
|
-
# @since
|
19
|
+
# @since 2.4.0
|
20
20
|
class WhoisUa < Base
|
21
21
|
|
22
22
|
property_supported :domain do
|
@@ -58,7 +58,7 @@ module Whois
|
|
58
58
|
property_supported :created_on do
|
59
59
|
if content_for_scanner =~ /created:\s+(.+)\n/
|
60
60
|
time = $1.split(" ").last
|
61
|
-
Time.parse(time)
|
61
|
+
Time.parse(time) unless time =~ /\A[0]+\z/
|
62
62
|
end
|
63
63
|
end
|
64
64
|
|
data/lib/whois/server.rb
CHANGED
@@ -239,12 +239,16 @@ module Whois
|
|
239
239
|
|
240
240
|
|
241
241
|
def self.find_for_ip(string)
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
242
|
+
begin
|
243
|
+
ip = IPAddr.new(string)
|
244
|
+
type = ip.ipv4? ? :ipv4 : :ipv6
|
245
|
+
definitions(type).each do |definition|
|
246
|
+
if IPAddr.new(definition.first).include?(ip)
|
247
|
+
return factory(type, *definition)
|
248
|
+
end
|
247
249
|
end
|
250
|
+
rescue ArgumentError => error
|
251
|
+
# continue
|
248
252
|
end
|
249
253
|
raise AllocationUnknown, "IP Allocation for `#{string}' unknown. Server definitions might be outdated."
|
250
254
|
end
|
@@ -44,7 +44,7 @@ module Whois
|
|
44
44
|
|
45
45
|
# Temporary internal response buffer.
|
46
46
|
#
|
47
|
-
# @api
|
47
|
+
# @api private
|
48
48
|
# @return [Array]
|
49
49
|
attr_reader :buffer
|
50
50
|
|
@@ -144,7 +144,7 @@ module Whois
|
|
144
144
|
@buffer << Whois::Record::Part.new(:body => body, :host => host)
|
145
145
|
end
|
146
146
|
|
147
|
-
# @api
|
147
|
+
# @api private
|
148
148
|
def buffer_start
|
149
149
|
@buffer = []
|
150
150
|
result = yield(@buffer)
|
@@ -184,7 +184,7 @@ module Whois
|
|
184
184
|
#
|
185
185
|
# This is for internal use only!
|
186
186
|
#
|
187
|
-
# @api
|
187
|
+
# @api private
|
188
188
|
def ask_the_socket(query, *args)
|
189
189
|
client = TCPSocket.new(*args)
|
190
190
|
client.write("#{query}\r\n") # I could use put(foo) and forget the \n
|
data/lib/whois/version.rb
CHANGED
@@ -49,52 +49,52 @@
|
|
49
49
|
should: %s CLASS(array)
|
50
50
|
should: %s SIZE(1)
|
51
51
|
should: %s[0] CLASS(contact)
|
52
|
-
should: %s[0].type
|
53
|
-
should: %s[0].id
|
54
|
-
should: %s[0].name
|
55
|
-
should: %s[0].organization
|
56
|
-
should: %s[0].address
|
57
|
-
should: %s[0].city
|
58
|
-
should: %s[0].zip
|
59
|
-
should: %s[0].state
|
60
|
-
should: %s[0].country_code
|
61
|
-
should: %s[0].phone
|
62
|
-
should: %s[0].fax
|
63
|
-
should: %s[0].email
|
52
|
+
should: %s[0].type == Whois::Record::Contact::TYPE_REGISTRANT
|
53
|
+
should: %s[0].id == "C4526901-AERO"
|
54
|
+
should: %s[0].name == "Domain Name Administrator"
|
55
|
+
should: %s[0].organization == "SriLankan Airlines Ltd"
|
56
|
+
should: %s[0].address == "Admin Bldg"
|
57
|
+
should: %s[0].city == "Katunayaka"
|
58
|
+
should: %s[0].zip == "11450"
|
59
|
+
should: %s[0].state == "WP"
|
60
|
+
should: %s[0].country_code == "LK"
|
61
|
+
should: %s[0].phone == "+94.197331600"
|
62
|
+
should: %s[0].fax == "+94.197335160"
|
63
|
+
should: %s[0].email == "domregister@srilankan.aero"
|
64
64
|
|
65
65
|
#admin_contacts
|
66
66
|
should: %s CLASS(array)
|
67
67
|
should: %s SIZE(1)
|
68
68
|
should: %s[0] CLASS(contact)
|
69
|
-
should: %s[0].type
|
70
|
-
should: %s[0].id
|
71
|
-
should: %s[0].name
|
72
|
-
should: %s[0].organization
|
73
|
-
should: %s[0].address
|
74
|
-
should: %s[0].city
|
75
|
-
should: %s[0].zip
|
76
|
-
should: %s[0].state
|
77
|
-
should: %s[0].country_code
|
78
|
-
should: %s[0].phone
|
79
|
-
should: %s[0].fax
|
80
|
-
should: %s[0].email
|
69
|
+
should: %s[0].type == Whois::Record::Contact::TYPE_ADMIN
|
70
|
+
should: %s[0].id == "C4526901-AERO"
|
71
|
+
should: %s[0].name == "Domain Name Administrator"
|
72
|
+
should: %s[0].organization == "SriLankan Airlines Ltd"
|
73
|
+
should: %s[0].address == "Admin Bldg"
|
74
|
+
should: %s[0].city == "Katunayaka"
|
75
|
+
should: %s[0].zip == "11450"
|
76
|
+
should: %s[0].state == "WP"
|
77
|
+
should: %s[0].country_code == "LK"
|
78
|
+
should: %s[0].phone == "+94.197331600"
|
79
|
+
should: %s[0].fax == "+94.197335160"
|
80
|
+
should: %s[0].email == "domregister@srilankan.aero"
|
81
81
|
|
82
82
|
#technical_contacts
|
83
83
|
should: %s CLASS(array)
|
84
84
|
should: %s SIZE(1)
|
85
85
|
should: %s[0] CLASS(contact)
|
86
|
-
should: %s[0].type
|
87
|
-
should: %s[0].id
|
88
|
-
should: %s[0].name
|
89
|
-
should: %s[0].organization
|
90
|
-
should: %s[0].address
|
91
|
-
should: %s[0].city
|
92
|
-
should: %s[0].zip
|
93
|
-
should: %s[0].state
|
94
|
-
should: %s[0].country_code
|
95
|
-
should: %s[0].phone
|
96
|
-
should: %s[0].fax
|
97
|
-
should: %s[0].email
|
86
|
+
should: %s[0].type == Whois::Record::Contact::TYPE_TECHNICAL
|
87
|
+
should: %s[0].id == "C4526901-AERO"
|
88
|
+
should: %s[0].name == "Domain Name Administrator"
|
89
|
+
should: %s[0].organization == "SriLankan Airlines Ltd"
|
90
|
+
should: %s[0].address == "Admin Bldg"
|
91
|
+
should: %s[0].city == "Katunayaka"
|
92
|
+
should: %s[0].zip == "11450"
|
93
|
+
should: %s[0].state == "WP"
|
94
|
+
should: %s[0].country_code == "LK"
|
95
|
+
should: %s[0].phone == "+94.197331600"
|
96
|
+
should: %s[0].fax == "+94.197335160"
|
97
|
+
should: %s[0].email == "domregister@srilankan.aero"
|
98
98
|
|
99
99
|
|
100
100
|
#nameservers
|