whois 3.5.4 → 3.5.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d13d589dc72c41ce59b3a1efddf28d37c1ceb407
4
- data.tar.gz: ad650564c13834a800b3c36a879415da5d7ee29e
3
+ metadata.gz: 133907446387f7270b62a6eabb38c74f4811553a
4
+ data.tar.gz: 04c7491c8ca5574250478e947ac8f0252e9a51d5
5
5
  SHA512:
6
- metadata.gz: b5e27e531a9153c8201e2f36d2484c3e22b384383b93f21317e4e870f11bfef3ce99b19c0c2f217b0989a1b8627137b535eec9a8bd97ccc687e64dcf802b7d60
7
- data.tar.gz: 7c429d5a1785ff03fec3924044a4f63eb4338e737c1d79cdb0079bc8b80e33e1f7cca7db7fda243ce1271ab0f6578c86b96ca347f674582e90945760f006ef72
6
+ metadata.gz: e7406e3946918780f42ace027b0234bb9e9c1b39dd90c39c6e368f21f2de68c0ddfe7b1eea8c3b3569bee88fb775d5d623c1432f2c2ad04c6bc3aa7b48e5cbfc
7
+ data.tar.gz: df4a50076cbb1c168e437198abf31e62c43f7ef6ff811d6aa4a966e6c990d26c8cecd25f05309335a3fd287fba45d4c103798fce30c9e5b01aca259b68eb5daa
@@ -1,7 +1,21 @@
1
1
  # Changelog
2
2
 
3
+ #### Release 3.5.5
3
4
 
4
- #### master
5
+ - NEW: Added registrar and contact support for whois.dns.lu (GH-329). [Thanks @huyphan]
6
+
7
+ - CHANGED: Updated whois.iis.se and whois.iis.nu to the new response format (GH-328).
8
+
9
+ - FIXED: whois.fi parser crashes when the domain is reserved (GH-339). [Thanks @case]
10
+
11
+ - FIXED: whois.whois.nic.asia parser crashes when the status is reserved (GH-340). [Thanks @case]
12
+
13
+ - FIXED: whois.netcom.cm parser crashes when the status is suspended (GH-333). [Thanks @case]
14
+
15
+ - FIXED: whois.nic.gd parser crashes when the domain is reserved (GH-335). [Thanks @case]
16
+
17
+
18
+ #### Release 3.5.4
5
19
 
6
20
  - SERVER: Created .QUEBEC, .COLLEGE, .DESI, .FEEDBACK, .ROCKS, .XN, .ASSOCIATES, .CAPITAL, .CAREER, .ENGINEERING, .EUS, .GAL, .GRIPE, .LEASE, .MEDIA, .PICTURES, .REISEN, .SERVICES, .TOWN, .TOYS, .UNIVERSITY, .XN, .FOO, .FROGANS, .PARIS, .SOY, .BLACKFRIDAY, .CLINIC, .FITNESS, .SCHULE, .CARE, .CASH, .DENTAL, .DISCOUNT, .EXCHANGE, .FAIL, .FINANCIAL, .FUND, .FURNITURE, .GRATIS, .INVESTMENTS, .LIMITED, .SURGERY, .TAX, .WTF, .MOSCOW, .XN, .CREDITCARD, .FINANCE, .INSURE, .WTC, .AIRFORCE, .BAYERN, .GLOBO, .ACCOUNTANTS, .CLAIMS, .CREDIT, .DIGITAL
7
21
 
@@ -37,7 +37,9 @@ module Whois
37
37
 
38
38
 
39
39
  property_supported :status do
40
- if available?
40
+ if respond_to?(:reserved?) && reserved?
41
+ :reserved
42
+ elsif available?
41
43
  :available
42
44
  else
43
45
  :registered
@@ -45,7 +47,7 @@ module Whois
45
47
  end
46
48
 
47
49
  property_supported :available? do
48
- !!node("status:available")
50
+ !(respond_to?(:reserved?) && reserved?) && !!node("status:available")
49
51
  end
50
52
 
51
53
  property_supported :registered? do
@@ -28,9 +28,10 @@ module Whois
28
28
  property_supported :status do
29
29
  if content_for_scanner =~ /domaintype:\s+(.+)\n/
30
30
  case $1.downcase
31
- when "active" then :registered
32
- else
33
- Whois.bug!(ParserError, "Unknown status `#{$1}'.")
31
+ when "active"
32
+ :registered
33
+ else
34
+ Whois.bug!(ParserError, "Unknown status `#{$1}'.")
34
35
  end
35
36
  else
36
37
  :available
@@ -58,18 +59,70 @@ module Whois
58
59
  property_not_supported :expires_on
59
60
 
60
61
 
62
+ property_supported :registrar do
63
+ if name = value_for_key('registrar-name')
64
+ Record::Registrar.new(
65
+ name: name,
66
+ url: value_for_key('registrar-url'),
67
+ )
68
+ end
69
+ end
70
+
71
+ property_supported :registrant_contacts do
72
+ build_contact('org', Record::Contact::TYPE_REGISTRANT)
73
+ end
74
+
75
+ property_supported :admin_contacts do
76
+ build_contact('adm', Record::Contact::TYPE_ADMINISTRATIVE)
77
+ end
78
+
79
+ property_supported :technical_contacts do
80
+ build_contact('tec', Record::Contact::TYPE_TECHNICAL)
81
+ end
82
+
83
+
61
84
  property_supported :nameservers do
62
- content_for_scanner.scan(/nserver:\s+(.+)\n/).flatten.map do |line|
85
+ values_for_key('nserver').map do |line|
63
86
  if line =~ /(.+) \[(.+)\]/
64
- Record::Nameserver.new(:name => $1, :ipv4 => $2)
87
+ Record::Nameserver.new(name: $1, ipv4: $2)
65
88
  else
66
- Record::Nameserver.new(:name => line)
89
+ Record::Nameserver.new(name: line)
67
90
  end
68
91
  end
69
92
  end
70
93
 
71
- end
72
94
 
95
+ private
96
+
97
+ def build_contact(element, type)
98
+ if name = value_for_key('%s-name' % element)
99
+ Record::Contact.new(
100
+ type: type,
101
+ id: nil,
102
+ name: name,
103
+ address: value_for_key('%s-address' % element),
104
+ city: value_for_key('%s-city' % element),
105
+ zip: value_for_key('%s-zipcode' % element),
106
+ country_code: value_for_key('%s-country' % element),
107
+ email: value_for_key('%s-email' % element)
108
+ )
109
+ end
110
+ end
111
+
112
+ def value_for_key(key)
113
+ values = values_for_key(key)
114
+ if values.size > 1
115
+ values.join(', ')
116
+ else
117
+ values.first
118
+ end
119
+ end
120
+
121
+ def values_for_key(key)
122
+ content_for_scanner.scan(/#{key}:\s+(.+)\n/).flatten
123
+ end
124
+
125
+ end
73
126
  end
74
127
  end
75
- end
128
+ end
@@ -39,7 +39,9 @@ module Whois
39
39
 
40
40
 
41
41
  property_supported :status do
42
- if registered?
42
+ if reserved?
43
+ :reserved
44
+ elsif registered?
43
45
  case node("status", &:downcase)
44
46
  when "granted"
45
47
  :registered
@@ -76,11 +78,11 @@ module Whois
76
78
 
77
79
 
78
80
  property_not_supported :registrar
79
-
81
+
80
82
  property_supported :registrant_contacts do
81
83
  node("descr") do |array|
82
84
  address = node("address")
83
-
85
+
84
86
  Record::Contact.new(
85
87
  type: Record::Contact::TYPE_REGISTRANT,
86
88
  id: array[1],
@@ -105,6 +107,11 @@ module Whois
105
107
  end
106
108
  end
107
109
 
110
+ # NEWPROPERTY
111
+ def reserved?
112
+ !!content_for_scanner.match(/Domain not available/)
113
+ end
114
+
108
115
  end
109
116
 
110
117
  end
@@ -20,6 +20,7 @@ module Whois
20
20
  # The Example parser for the list of all available methods.
21
21
  #
22
22
  class WhoisMarkmonitorCom < BaseIcannCompliant
23
+
23
24
  self.scanner = Scanners::BaseIcannCompliant, {
24
25
  pattern_available: /^No match for/,
25
26
  pattern_throttled: /^You have exceeded your quota of queries\./,
@@ -16,6 +16,11 @@ module Whois
16
16
 
17
17
  # Parser for the whois.netcom.cm server.
18
18
  class WhoisNetcomCm < BaseCocca
19
+
20
+ self.status_mapping.merge!({
21
+ "suspended" => :registered
22
+ })
23
+
19
24
  end
20
25
 
21
26
  end
@@ -21,8 +21,17 @@ module Whois
21
21
  #
22
22
  class WhoisNicAsia < BaseAfilias
23
23
 
24
+ self.scanner = Scanners::BaseAfilias, {
25
+ pattern_reserved: /^Reserved by DotAsia\n/,
26
+ }
27
+
28
+
24
29
  property_supported :status do
25
- Array.wrap(node("Domain Status"))
30
+ if reserved?
31
+ :reserved
32
+ else
33
+ Array.wrap(node("Domain Status"))
34
+ end
26
35
  end
27
36
 
28
37
 
@@ -61,6 +70,12 @@ module Whois
61
70
  end
62
71
 
63
72
 
73
+ # NEWPROPERTY
74
+ def reserved?
75
+ !!node("status:reserved")
76
+ end
77
+
78
+
64
79
  private
65
80
 
66
81
  def build_contact(element, type)
@@ -20,6 +20,12 @@ module Whois
20
20
  # The Example parser for the list of all available methods.
21
21
  #
22
22
  class WhoisNicGd < BaseShared3
23
+
24
+ # NEWPROPERTY
25
+ def reserved?
26
+ !!content_for_scanner.match(/RESTRICTED/)
27
+ end
28
+
23
29
  end
24
30
 
25
31
  end
@@ -18,7 +18,8 @@ module Whois
18
18
  class WhoisNicXxx < BaseAfilias2
19
19
 
20
20
  self.scanner = Scanners::BaseAfilias, {
21
- pattern_disclaimer: /^Access to/
21
+ pattern_disclaimer: /^Access to/,
22
+ pattern_reserved: /^Reserved by ICM Registry\n/,
22
23
  }
23
24
 
24
25
 
@@ -20,6 +20,20 @@ module Whois
20
20
  # The Example parser for the list of all available methods.
21
21
  #
22
22
  class WhoisRegistryproPro < BaseAfilias
23
+
24
+ property_supported :status do
25
+ if reserved?
26
+ :reserved
27
+ else
28
+ super()
29
+ end
30
+ end
31
+
32
+ # NEWPROPERTY
33
+ def reserved?
34
+ !!content_for_scanner.match(/Governmental Reserved Name/)
35
+ end
36
+
23
37
  end
24
38
 
25
39
  end
@@ -33,9 +33,8 @@ module Whois
33
33
  end
34
34
  end
35
35
 
36
- # .XXX
37
36
  tokenizer :scan_reserved do
38
- if @input.scan(/^Reserved by ICM Registry\n/)
37
+ if settings[:pattern_reserved] && @input.scan(settings[:pattern_reserved])
39
38
  @ast["status:reserved"] = true
40
39
  end
41
40
  end
@@ -34,10 +34,9 @@ module Whois
34
34
  tokenizer :scan_disclaimer do
35
35
  if @input.match?(/# Copyright/)
36
36
  lines = []
37
- while !@input.match?(/# Result of/) && @input.scan(/#?(.*)\n/)
37
+ while @input.scan(/#(.*)\n\n?/)
38
38
  lines << @input[1].strip unless @input[1].strip == ""
39
39
  end
40
- @input.skip_until(/# printed with .+ bits\.\n/m)
41
40
  @ast["field:disclaimer"] = lines.join(" ")
42
41
  end
43
42
  end
@@ -22,6 +22,7 @@ module Whois
22
22
  :scan_available,
23
23
  :scan_disclaimer,
24
24
  :scan_keyvalue,
25
+ :scan_reserved
25
26
  ]
26
27
 
27
28
 
@@ -31,6 +32,12 @@ module Whois
31
32
  end
32
33
  end
33
34
 
35
+ tokenizer :scan_reserved do
36
+ if @input.skip(/^Domain not available/)
37
+ @ast["status:reserved"] = true
38
+ end
39
+ end
40
+
34
41
  tokenizer :scan_disclaimer do
35
42
  if @input.match?(/^More information/)
36
43
  @ast["field:disclaimer"] = @input.scan_until(/(.*)\n\n/).strip
@@ -13,7 +13,7 @@ module Whois
13
13
  module Version
14
14
  MAJOR = 3
15
15
  MINOR = 5
16
- PATCH = 4
16
+ PATCH = 5
17
17
  BUILD = nil
18
18
 
19
19
  STRING = [MAJOR, MINOR, PATCH, BUILD].compact.join(".")
@@ -1,14 +1,14 @@
1
1
  # -*- encoding: utf-8 -*-
2
- # stub: whois 3.5.3 ruby lib
2
+ # stub: whois 3.5.5 ruby lib
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.name = "whois"
6
- s.version = "3.5.3"
6
+ s.version = "3.5.5"
7
7
 
8
8
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
9
9
  s.require_paths = ["lib"]
10
10
  s.authors = ["Simone Carletti"]
11
- s.date = "2014-06-04"
11
+ s.date = "2014-06-22"
12
12
  s.description = "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."
13
13
  s.email = ["weppos@weppos.net"]
14
14
  s.executables = ["ruby-whois"]
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: whois
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.5.4
4
+ version: 3.5.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Simone Carletti
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-06-05 00:00:00.000000000 Z
11
+ date: 2014-06-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport