whois 3.1.3 → 3.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (49) hide show
  1. data/CHANGELOG.md +26 -2
  2. data/data/tld.json +8 -2
  3. data/lib/whois/record/parser/base.rb +1 -1
  4. data/lib/whois/record/parser/base_afilias.rb +3 -11
  5. data/lib/whois/record/parser/base_cocca2.rb +4 -3
  6. data/lib/whois/record/parser/base_icb.rb +95 -0
  7. data/lib/whois/record/parser/base_shared1.rb +4 -11
  8. data/lib/whois/record/parser/base_shared2.rb +4 -11
  9. data/lib/whois/record/parser/base_shared3.rb +5 -12
  10. data/lib/whois/record/parser/base_whoisd.rb +4 -13
  11. data/lib/whois/record/parser/jobswhois.verisign-grs.com.rb +8 -11
  12. data/lib/whois/record/parser/whois.ati.tn.rb +6 -15
  13. data/lib/whois/record/parser/whois.audns.net.au.rb +4 -12
  14. data/lib/whois/record/parser/whois.cctld.by.rb +4 -11
  15. data/lib/whois/record/parser/whois.centralnic.com.rb +4 -12
  16. data/lib/whois/record/parser/whois.cira.ca.rb +15 -20
  17. data/lib/whois/record/parser/whois.cnnic.cn.rb +3 -11
  18. data/lib/whois/record/parser/whois.crsnic.net.rb +5 -12
  19. data/lib/whois/record/parser/whois.denic.de.rb +4 -11
  20. data/lib/whois/record/parser/whois.dns.hr.rb +4 -12
  21. data/lib/whois/record/parser/whois.dns.pl.rb +12 -1
  22. data/lib/whois/record/parser/whois.domainregistry.ie.rb +4 -11
  23. data/lib/whois/record/parser/whois.fi.rb +54 -20
  24. data/lib/whois/record/parser/whois.iana.org.rb +4 -11
  25. data/lib/whois/record/parser/whois.jprs.jp.rb +7 -0
  26. data/lib/whois/record/parser/whois.nc.rb +5 -13
  27. data/lib/whois/record/parser/whois.nic.ac.rb +5 -53
  28. data/lib/whois/record/parser/whois.nic.cc.rb +4 -11
  29. data/lib/whois/record/parser/whois.nic.hu.rb +4 -11
  30. data/lib/whois/record/parser/whois.nic.io.rb +5 -53
  31. data/lib/whois/record/parser/whois.nic.it.rb +3 -10
  32. data/lib/whois/record/parser/whois.nic.sh.rb +5 -53
  33. data/lib/whois/record/parser/whois.nic.tv.rb +4 -11
  34. data/lib/whois/record/parser/whois.norid.no.rb +7 -9
  35. data/lib/whois/record/parser/whois.registry.net.za.rb +6 -7
  36. data/lib/whois/record/parser/whois.rnids.rs.rb +4 -12
  37. data/lib/whois/record/parser/whois.smallregistry.net.rb +4 -11
  38. data/lib/whois/record/parser/whois.srs.net.nz.rb +64 -22
  39. data/lib/whois/record/parser/whois.sx.rb +5 -13
  40. data/lib/whois/record/parser/whois1.nic.bi.rb +2 -2
  41. data/lib/whois/record/scanners/{nodable.rb → scannable.rb} +15 -7
  42. data/lib/whois/record/scanners/whois.centralnic.com.rb +0 -2
  43. data/lib/whois/record/scanners/whois.fi.rb +44 -0
  44. data/lib/whois/record/scanners/whois.srs.net.nz.rb +35 -0
  45. data/lib/whois/server/adapters/arin.rb +2 -3
  46. data/lib/whois/version.rb +2 -2
  47. data/whois.gemspec +5 -5
  48. metadata +19 -6
  49. checksums.yaml +0 -15
@@ -1,5 +1,29 @@
1
1
  # Changelog
2
2
 
3
+
4
+ ## Release 3.2.0
5
+
6
+ - SERVER: Added .JP.NET (GH-240), XN--J1AMH TLD definition.
7
+
8
+ - NEW: Added #domain_id to CoCCA parsers.
9
+
10
+ - NEW: Added full whois.srs.net.nz parser.
11
+
12
+ - NEW: Added full whois.fi parser.
13
+
14
+ - NEW: whois.dns.pl parser now recognizes throttled responses.
15
+
16
+ - CHANGED: Updated whois.nic.ac, whois.nic.io, and whois.nic.sh parsers to the new response format (GH-238).
17
+
18
+ - CHANGED: Updated whois1.nic.bi parser to the new response format.
19
+
20
+ - CHANGED: Updated whois.norid.no parser to the new response format.
21
+
22
+ - FIXED: whois.jprs.jp crashes when status is `reserved` for ne.jp SLD.
23
+
24
+ - FIXED: Arin adapter is incorrectly passing an Arin flag to referral queries.
25
+
26
+
3
27
  ## Release 3.1.3
4
28
 
5
29
  - SERVER: Updated .GD (GH-227), .TC (GH-228) TLD definitions.
@@ -106,7 +130,7 @@
106
130
 
107
131
  - CHANGED: Dropped support for Ruby 1.8
108
132
 
109
- - CHANGED: Renamed Whois::Record::Scanners::Ast to Renamed Whois::Record::Scanners::Nodable
133
+ - CHANGED: Renamed Whois::Record::Scanners::Ast to Renamed Whois::Record::Scanners::Scannable
110
134
 
111
135
  - CHANGED: Definitions are now stored as JSON.
112
136
 
@@ -197,7 +221,7 @@
197
221
 
198
222
  - Removed compatibility with Ruby 1.8
199
223
 
200
- - Renamed Whois::Record::Scanners::Ast to Renamed Whois::Record::Scanners::Nodable
224
+ - Renamed Whois::Record::Scanners::Ast to Renamed Whois::Record::Scanners::Scannable
201
225
 
202
226
  - Whois::Server#query has been renamed to Whois::Server#lookup
203
227
 
@@ -32,6 +32,9 @@
32
32
  ".hu.com": {
33
33
  "host": "whois.centralnic.com"
34
34
  },
35
+ ".jp.net": {
36
+ "host": "whois.centralnic.com"
37
+ },
35
38
  ".jpn.com": {
36
39
  "host": "whois.centralnic.com"
37
40
  },
@@ -1141,7 +1144,7 @@
1141
1144
  ".vn": {
1142
1145
  "host": null,
1143
1146
  "adapter": "web",
1144
- "url": "http://en.vnnic.vn/"
1147
+ "url": "http://www.vnnic.vn/en/domain"
1145
1148
  },
1146
1149
  ".vu": {
1147
1150
  "host": null,
@@ -1226,6 +1229,9 @@
1226
1229
  "host": null,
1227
1230
  "adapter": "none"
1228
1231
  },
1232
+ ".xn--j1amh": {
1233
+ "host": "whois.ua"
1234
+ },
1229
1235
  ".xn--j6w193g": {
1230
1236
  "host": "whois.hkirc.hk"
1231
1237
  },
@@ -1300,4 +1306,4 @@
1300
1306
  ".xn--ygbi2ammx": {
1301
1307
  "host": "whois.pnina.ps"
1302
1308
  }
1303
- }
1309
+ }
@@ -11,7 +11,7 @@ require 'time'
11
11
  require 'whois/record/contact'
12
12
  require 'whois/record/registrar'
13
13
  require 'whois/record/nameserver'
14
- require 'whois/record/scanners/nodable'
14
+ require 'whois/record/scanners/scannable'
15
15
 
16
16
 
17
17
  module Whois
@@ -19,7 +19,9 @@ module Whois
19
19
  #
20
20
  # @abstract
21
21
  class BaseAfilias < Base
22
- include Scanners::Nodable
22
+ include Scanners::Scannable
23
+
24
+ self.scanner = Scanners::BaseAfilias
23
25
 
24
26
 
25
27
  property_supported :disclaimer do
@@ -101,16 +103,6 @@ module Whois
101
103
  end
102
104
 
103
105
 
104
- # Initializes a new {Scanners::Afilias} instance
105
- # passing the {#content_for_scanner}
106
- # and calls +parse+ on it.
107
- #
108
- # @return [Hash]
109
- def parse
110
- Scanners::BaseAfilias.new(content_for_scanner).parse
111
- end
112
-
113
-
114
106
  private
115
107
 
116
108
  def build_contact(element, type)
@@ -20,11 +20,12 @@ module Whois
20
20
  class BaseCocca2 < Base
21
21
 
22
22
  property_supported :domain do
23
- content_for_scanner =~ /Domain Name: (.+)\n/
24
- $1 || Whois.bug!(ParserError, "Unable to parse domain.")
23
+ content_for_scanner.slice(/Domain Name: (.+)\n/, 1)
25
24
  end
26
25
 
27
- property_not_supported :domain_id
26
+ property_supported :domain_id do
27
+ content_for_scanner.slice(/Domain ID: (.+)\n/, 1)
28
+ end
28
29
 
29
30
  # TODO: /pending delete/ => :redemption
30
31
  # TODO: /pending purge/ => :redemption
@@ -0,0 +1,95 @@
1
+ #--
2
+ # Ruby Whois
3
+ #
4
+ # An intelligent pure Ruby WHOIS client and parser.
5
+ #
6
+ # Copyright (c) 2009-2013 Simone Carletti <weppos@weppos.net>
7
+ #++
8
+
9
+
10
+ require 'whois/record/parser/base'
11
+
12
+
13
+ module Whois
14
+ class Record
15
+ class Parser
16
+
17
+ class BaseIcb < Base
18
+
19
+ property_not_supported :disclaimer
20
+
21
+
22
+ property_supported :domain do
23
+ if registered?
24
+ content_for_scanner.match(/^Domain : (.+)\n/)[1]
25
+ elsif available?
26
+ content_for_scanner.match(/^Domain (.+) is available/)[1]
27
+ end
28
+ end
29
+
30
+ property_not_supported :domain_id
31
+
32
+
33
+ property_supported :status do
34
+ if available?
35
+ :available
36
+ else
37
+ :registered
38
+ end
39
+ end
40
+
41
+ property_supported :available? do
42
+ !!(content_for_scanner =~ /^Domain (.+?) is available/)
43
+ end
44
+
45
+ property_supported :registered? do
46
+ !available?
47
+ end
48
+
49
+
50
+ property_not_supported :created_on
51
+
52
+ property_not_supported :updated_on
53
+
54
+ property_supported :expires_on do
55
+ if content_for_scanner =~ /Expiry : (.+?)\n/
56
+ Time.parse($1)
57
+ end
58
+ end
59
+
60
+
61
+ property_not_supported :registrar
62
+
63
+ property_supported :registrant_contacts do
64
+ textblock = content_for_scanner.slice(/Owner((?:\s*: .+\n)+)/, 1)
65
+ return unless textblock
66
+
67
+ lines = textblock.scan(/^\s+: (.+)\n/).flatten
68
+ Record::Contact.new(
69
+ type: Record::Contact::TYPE_REGISTRANT,
70
+ name: lines[0],
71
+ organization: lines[1],
72
+ address: lines[2],
73
+ zip: nil,
74
+ state: lines[4],
75
+ city: lines[3],
76
+ country: lines[5]
77
+ )
78
+ end
79
+
80
+ property_not_supported :admin_contacts
81
+
82
+ property_not_supported :technical_contacts
83
+
84
+
85
+ property_supported :nameservers do
86
+ content_for_scanner.scan(/^NS \d\s+: (.+)/).flatten.map do |name|
87
+ Record::Nameserver.new(name: name)
88
+ end
89
+ end
90
+
91
+ end
92
+
93
+ end
94
+ end
95
+ end
@@ -19,7 +19,10 @@ module Whois
19
19
  #
20
20
  # @abstract
21
21
  class BaseShared1 < Base
22
- include Scanners::Nodable
22
+ include Scanners::Scannable
23
+
24
+ self.scanner = Scanners::BaseShared1
25
+
23
26
 
24
27
  property_not_supported :disclaimer
25
28
 
@@ -83,16 +86,6 @@ module Whois
83
86
  end
84
87
 
85
88
 
86
- # Initializes a new {Scanners::BaseShared1} instance
87
- # passing the {#content_for_scanner}
88
- # and calls +parse+ on it.
89
- #
90
- # @return [Hash]
91
- def parse
92
- Scanners::BaseShared1.new(content_for_scanner).parse
93
- end
94
-
95
-
96
89
  private
97
90
 
98
91
  def build_contact(element, type)
@@ -19,7 +19,10 @@ module Whois
19
19
  #
20
20
  # @abstract
21
21
  class BaseShared2 < Base
22
- include Scanners::Nodable
22
+ include Scanners::Scannable
23
+
24
+ self.scanner = Scanners::BaseShared2
25
+
23
26
 
24
27
  # Actually the :disclaimer is supported,
25
28
  # but extracting it with the current scanner
@@ -92,16 +95,6 @@ module Whois
92
95
  end
93
96
 
94
97
 
95
- # Initializes a new {Scanners::BaseShared2} instance
96
- # passing the {#content_for_scanner}
97
- # and calls +parse+ on it.
98
- #
99
- # @return [Hash]
100
- def parse
101
- Scanners::BaseShared2.new(content_for_scanner).parse
102
- end
103
-
104
-
105
98
  private
106
99
 
107
100
  def build_contact(element, type)
@@ -19,7 +19,10 @@ module Whois
19
19
  #
20
20
  # @abstract
21
21
  class BaseShared3 < Base
22
- include Scanners::Nodable
22
+ include Scanners::Scannable
23
+
24
+ self.scanner = Scanners::BaseShared3
25
+
23
26
 
24
27
  property_supported :disclaimer do
25
28
  node("field:disclaimer")
@@ -96,17 +99,7 @@ module Whois
96
99
  end
97
100
 
98
101
 
99
- # Initializes a new {Scanners::BaseShared3} instance
100
- # passing the {#content_for_scanner}
101
- # and calls +parse+ on it.
102
- #
103
- # @return [Hash]
104
- def parse
105
- Scanners::BaseShared3.new(content_for_scanner).parse
106
- end
107
-
108
-
109
- private
102
+ private
110
103
 
111
104
  def build_contact(element, type)
112
105
  node("#{element}-contact") do |raw|
@@ -18,10 +18,11 @@ module Whois
18
18
  # Base parser for Whoisd servers.
19
19
  #
20
20
  # @abstract
21
- #
22
- # @since 2.6.4
23
21
  class BaseWhoisd < Base
24
- include Scanners::Nodable
22
+ include Scanners::Scannable
23
+
24
+ self.scanner = Scanners::BaseWhoisd
25
+
25
26
 
26
27
  class_attribute :status_mapping
27
28
  self.status_mapping = {
@@ -113,16 +114,6 @@ module Whois
113
114
  end
114
115
 
115
116
 
116
- # Initializes a new {Scanners::Whoisd} instance
117
- # passing the {#content_for_scanner}
118
- # and calls +parse+ on it.
119
- #
120
- # @return [Hash]
121
- def parse
122
- Scanners::BaseWhoisd.new(content_for_scanner).parse
123
- end
124
-
125
-
126
117
  private
127
118
 
128
119
  def node_nsset
@@ -16,8 +16,15 @@ module Whois
16
16
  class Parser
17
17
 
18
18
  # Parser for the jobswhois.verisign-grs.com server.
19
+ #
20
+ # @see Whois::Record::Parser::Example
21
+ # The Example parser for the list of all available methods.
22
+ #
19
23
  class JobswhoisVerisignGrsCom < Base
20
- include Scanners::Nodable
24
+ include Scanners::Scannable
25
+
26
+ self.scanner = Scanners::Verisign
27
+
21
28
 
22
29
  property_supported :disclaimer do
23
30
  node("Disclaimer")
@@ -86,16 +93,6 @@ module Whois
86
93
  node("Referral URL")
87
94
  end
88
95
 
89
-
90
- # Initializes a new {Scanners::Verisign} instance
91
- # passing the {#content_for_scanner}
92
- # and calls +parse+ on it.
93
- #
94
- # @return [Hash]
95
- def parse
96
- Scanners::Verisign.new(content_for_scanner).parse
97
- end
98
-
99
96
  end
100
97
 
101
98
  end
@@ -20,9 +20,11 @@ module Whois
20
20
  # @see Whois::Record::Parser::Example
21
21
  # The Example parser for the list of all available methods.
22
22
  #
23
- # @since 2.6.0
24
23
  class WhoisAtiTn < Base
25
- include Scanners::Nodable
24
+ include Scanners::Scannable
25
+
26
+ self.scanner = Scanners::WhoisAtiTn
27
+
26
28
 
27
29
  property_supported :disclaimer do
28
30
  node("field:disclaimer")
@@ -63,15 +65,14 @@ module Whois
63
65
 
64
66
 
65
67
  property_supported :registrar do
66
- node("Registrar") do |str|
68
+ node("Registrar") do |value|
67
69
  Record::Registrar.new(
68
70
  :id => nil,
69
- :name => node("Registrar")
71
+ :name => value
70
72
  )
71
73
  end
72
74
  end
73
75
 
74
-
75
76
  property_supported :registrant_contacts do
76
77
  build_contact("Owner", Whois::Record::Contact::TYPE_REGISTRANT)
77
78
  end
@@ -93,16 +94,6 @@ module Whois
93
94
  end
94
95
 
95
96
 
96
- # Initializes a new {Scanners::WhoisAtiTn} instance
97
- # passing the {#content_for_scanner}
98
- # and calls +parse+ on it.
99
- #
100
- # @return [Hash]
101
- def parse
102
- Scanners::WhoisAtiTn.new(content_for_scanner).parse
103
- end
104
-
105
-
106
97
  private
107
98
 
108
99
  def build_contact(element, type)
@@ -20,9 +20,11 @@ module Whois
20
20
  # @see Whois::Record::Parser::Example
21
21
  # The Example parser for the list of all available methods.
22
22
  #
23
- # @since 2.5.0
24
23
  class WhoisAudnsNetAu < Base
25
- include Scanners::Nodable
24
+ include Scanners::Scannable
25
+
26
+ self.scanner = Scanners::WhoisAudnsNetAu
27
+
26
28
 
27
29
  property_not_supported :disclaimer
28
30
 
@@ -91,16 +93,6 @@ module Whois
91
93
  end
92
94
 
93
95
 
94
- # Initializes a new {Scanners::WhoisAudnsNetAu} instance
95
- # passing the {#content_for_scanner}
96
- # and calls +parse+ on it.
97
- #
98
- # @return [Hash]
99
- def parse
100
- Scanners::WhoisAudnsNetAu.new(content_for_scanner).parse
101
- end
102
-
103
-
104
96
  private
105
97
 
106
98
  def build_contact(element, type)