whois 3.4.2 → 3.4.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (31) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +23 -0
  3. data/README.md +91 -107
  4. data/bin/ruby-whois +2 -2
  5. data/data/tld.json +4 -4
  6. data/lib/whois/record/parser/base_cocca2.rb +1 -1
  7. data/lib/whois/record/parser/{whois.nic.cc.rb → base_verisign.rb} +23 -11
  8. data/lib/whois/record/parser/ccwhois.verisign-grs.com.rb +27 -0
  9. data/lib/whois/record/parser/jobswhois.verisign-grs.com.rb +2 -75
  10. data/lib/whois/record/parser/whois.hkirc.hk.rb +1 -1
  11. data/lib/whois/record/parser/whois.markmonitor.com.rb +5 -94
  12. data/lib/whois/record/parser/whois.nic.af.rb +0 -6
  13. data/lib/whois/record/parser/whois.nic.cd.rb +6 -0
  14. data/lib/whois/record/parser/whois.nic.dz.rb +3 -7
  15. data/lib/whois/record/parser/whois.nic.gl.rb +2 -2
  16. data/lib/whois/record/parser/whois.nic.gs.rb +6 -0
  17. data/lib/whois/record/parser/whois.nic.mu.rb +6 -0
  18. data/lib/whois/record/parser/whois.nic.name.rb +1 -1
  19. data/lib/whois/record/parser/whois.nic.net.ng.rb +6 -0
  20. data/lib/whois/record/parser/whois.nic.net.sb.rb +6 -0
  21. data/lib/whois/record/parser/whois.nic.tv.rb +6 -68
  22. data/lib/whois/record/parser/whois.pnina.ps.rb +8 -8
  23. data/lib/whois/record/parser/whois.rotld.ro.rb +3 -3
  24. data/lib/whois/record/parser/whois.tld.sy.rb +6 -0
  25. data/lib/whois/record/parser/whois.usp.ac.fj.rb +3 -2
  26. data/lib/whois/record/parser/whois.verisign-grs.com.rb +46 -0
  27. data/lib/whois/record/parser/{whois.samoanic.ws.rb → whois.website.ws.rb} +8 -10
  28. data/lib/whois/version.rb +1 -1
  29. data/whois.gemspec +5 -5
  30. metadata +7 -6
  31. data/lib/whois/record/parser/whois.crsnic.net.rb +0 -112
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8f72e28e106b7b9c580a317d9c6fa19c332c9980
4
- data.tar.gz: 6e549c5658c2263d53433c7495fed9f17e69a548
3
+ metadata.gz: 8d440fc4c1d38dd789676e9476281c9ac1597400
4
+ data.tar.gz: 329897f66061372ff1f9c2531ac9f859fa03a71e
5
5
  SHA512:
6
- metadata.gz: d0da324153f425c52070d31c30d5a7dd0acf697fc12051584fdf5534deb8981d97aaecf000758e8177d87346fb8c11579ea89021bf9d0d5f06a158a6e105bce2
7
- data.tar.gz: 09e45d1b72e0b4df256d3996ba9f71945e62ebed8d9d25c060f0c6c89fe661f7a03ad0869bc853016be9bd3ae1f1d6a1ab587e9d0c7223dc1e30adbbf97e9ea5
6
+ metadata.gz: 044f5336675cca6b663858f6f7580d93171accec1ef8c3185106b9e273b23c489d3d1a7bbd35c3c75e1013bc8230bbe8dfe7c28fab9347a7ebdae030048756a0
7
+ data.tar.gz: 2cccf7d7e509d0880be5be2318556a6868e07fb5d00153475bf03d360210e947757fca80cc7abef01c12630346563e78c5c27f9fb336fcdad0b09688cd886264
data/CHANGELOG.md CHANGED
@@ -1,6 +1,29 @@
1
1
  # Changelog
2
2
 
3
3
 
4
+ ## Release 3.4.3
5
+
6
+ - SERVER: Updated .COM, .NET, .CC, .WS TLD definitions.
7
+
8
+ - FIXED: .HK domains not correctly identified as available (GH-290).
9
+
10
+ - CHANGED: Updated whois.nic.tv parser to the new response format (GH-283).
11
+
12
+ - CHANGED: Updated Verisign parsers, extract common parser.
13
+
14
+ - CHANGED: Updated whois.markmonitor.com parser to the new response format.
15
+
16
+ - CHANGED: Updated Cocca parsers to the new response format (GH-291).
17
+
18
+ - CHANGED: Updated whois.nic.dz parser to the new response format.
19
+
20
+ - CHANGED: Updated whois.rotld.ro parser to the new response format.
21
+
22
+ - CHANGED: Updated whois.pnina.ps parser to the new response format.
23
+
24
+ - CHANGED: Updated whois.nic.gl parser to the new response format.
25
+
26
+
4
27
  ## Release 3.4.2
5
28
 
6
29
  - CHANGED: Updated whois.registry.net.za parser to the new response format.
data/README.md CHANGED
@@ -1,23 +1,19 @@
1
1
  # Whois
2
2
 
3
- *Whois* is an intelligent pure Ruby WHOIS client and parser.
3
+ <tt>Whois</tt> is an intelligent pure Ruby WHOIS client and parser.
4
4
 
5
5
  [![Build Status](https://secure.travis-ci.org/weppos/whois.png)](http://travis-ci.org/weppos/whois)
6
6
 
7
- *Whois* is a OS-independent library and doesn't require any external binaries or C libraries: it is a 100% Ruby software.
7
+ <tt>Whois</tt> is a OS-independent library and doesn't require any external binaries or C libraries: it is a 100% Ruby software.
8
8
 
9
- This library was developed to power [RoboWhois](https://www.robowhois.com/) and [RoboDomain](https://www.robodomain.com/). It has been performing queries in production since July 2009.
9
+ This library was created to power [RoboWhois](https://www.robowhois.com/) and [RoboDomain](https://www.robodomain.com/). It has been performing queries in production since July 2009.
10
10
 
11
- An extensive test suite is available to verify the library correctness but you must be aware that registrant might change WHOIS interfaces without notice and at any time causing queries to specific hosts to stop working.
12
11
 
12
+ ## Donate a coffee
13
13
 
14
- ## Donations
14
+ <p id="pledgie" class="alignright"><a href="https://pledgie.com/campaigns/11383"><img alt="Click here to lend your support to: whois and make a donation at pledgie.com !" src="https://pledgie.com/campaigns/11383.png?skin_name=chrome" border="0" style="max-width:100%;"></a></p>
15
15
 
16
- [Support Whois at Pledgie](http://www.pledgie.com/campaigns/11383).
17
-
18
- <a href='https://pledgie.com/campaigns/11383'><img alt='Click here to lend your support to: whois and make a donation at pledgie.com !' src='https://pledgie.com/campaigns/11383.png?skin_name=chrome' border='0' ></a>
19
-
20
- *Whois* is free software, but it costs money to write, test, and distribute it. You can support the development by sending a donation. **Any amount, even $5, is greatly appreciated**.
16
+ <tt>Whois</tt> is free software, but it requires a lot of coffee to write, test, and distribute it. You can support the development by [donating a coffee](https://pledgie.com/campaigns/11383).
21
17
 
22
18
 
23
19
  ## Features
@@ -34,75 +30,79 @@ An extensive test suite is available to verify the library correctness but you m
34
30
 
35
31
  * Ruby >= 1.9.2
36
32
 
37
- For older versions of Ruby, see the [CHANGELOG](CHANGELOG.md) file.
33
+ For older versions of Ruby, see the [CHANGELOG](CHANGELOG.md).
38
34
 
39
- In addition to the standard Ruby interpreter (MRI),
40
- Whois has been successfully tested against several
41
- [Ruby implementations](http://www.ruby-whois.org/manual/interpreters/).
42
35
 
36
+ ## Install
43
37
 
44
- ## Installation
45
-
46
- The best way to install *Whois* is via [RubyGems](https://rubygems.org/).
38
+ The best way to install <tt>Whois</tt> is via [RubyGems](https://rubygems.org/) - [Learn more](http://www.ruby-whois.org/manual/installing/)
47
39
 
48
40
  $ gem install whois
49
41
 
50
- You might need administrator privileges on your system to install the gem.
42
+ For more details visit the [installation page](/manual/installing/).
51
43
 
52
44
 
53
45
  ## Getting Started
54
46
 
55
47
  Note. This section covers only the essentials for getting started with the Whois library. The [documentation](http://www.ruby-whois.org/documentation/) provides a more accurate explanation including tutorials, more examples and technical details about the client/server/record/parser architecture.
56
48
 
57
- ### Querying the Server
49
+ ### Querying a WHOIS
58
50
 
59
- Whois provides the ability to get WHOIS information for TLD, domain names, IPv4 and IPv6 addresses. The client is smart enough to guess the best WHOIS server according to given query, send the request and return the response.
51
+ <tt>Whois</tt> provides the ability to get WHOIS information for TLD, domain names, IPv4 and IPv6 addresses. The client is smart enough to guess the best WHOIS server according to given query, send the request and return the response.
60
52
 
61
53
  Check out the following examples:
62
54
 
63
- # Domain WHOIS
64
- w = Whois::Client.new
65
- w.lookup("google.com")
66
- # => #<Whois::Record>
55
+ ```ruby
56
+ # Domain WHOIS
57
+ w = Whois::Client.new
58
+ w.lookup("google.com")
59
+ # => #<Whois::Record>
67
60
 
68
- # TLD WHOIS
69
- w = Whois::Client.new
70
- w.lookup(".com")
71
- # => #<Whois::Record>
61
+ # TLD WHOIS
62
+ w = Whois::Client.new
63
+ w.lookup(".com")
64
+ # => #<Whois::Record>
72
65
 
73
- # IPv4 WHOIS
74
- w = Whois::Client.new
75
- w.lookup("74.125.67.100")
76
- # => #<Whois::Record>
66
+ # IPv4 WHOIS
67
+ w = Whois::Client.new
68
+ w.lookup("74.125.67.100")
69
+ # => #<Whois::Record>
77
70
 
78
- # IPv6 WHOIS
79
- w = Whois::Client.new
80
- w.lookup("2001:db8::1428:57ab")
81
- # => #<Whois::Record>
71
+ # IPv6 WHOIS
72
+ w = Whois::Client.new
73
+ w.lookup("2001:db8::1428:57ab")
74
+ # => #<Whois::Record>
75
+ ```
82
76
 
83
77
  The query method is stateless. For this reason, you can safely re-use the same client instance for multiple queries.
84
78
 
85
- w = Whois::Client.new
86
- w.lookup("google.com")
87
- w.lookup(".com")
88
- w.lookup("74.125.67.100")
89
- w.lookup("2001:db8::1428:57ab")
90
- w.lookup("google.it")
79
+ ```ruby
80
+ w = Whois::Client.new
81
+ w.lookup("google.com")
82
+ w.lookup(".com")
83
+ w.lookup("74.125.67.100")
84
+ w.lookup("2001:db8::1428:57ab")
85
+ w.lookup("google.it")
86
+ ```
91
87
 
92
- If you just need a WHOIS response and you don't care about a full control of the WHOIS client, the {Whois} module provides an all-in-one method called {Whois.whois}. This is the simplest way to send a WHOIS request.
88
+ If you just need a WHOIS response and you don't care about a full control of the WHOIS client, the `Whois` module provides an all-in-one method called `Whois.whois`. This is the simplest way to send a WHOIS request.
93
89
 
94
- Whois.whois("google.com")
95
- # => #<Whois::Record>
90
+ ```ruby
91
+ Whois.whois("google.com")
92
+ # => #<Whois::Record>
93
+ ```
96
94
 
97
95
  Did I mention you can even use blocks?
98
96
 
99
- Whois::Client.new do |w|
100
- w.lookup("google.com")
101
- w.lookup(".com")
102
- w.lookup("74.125.67.100")
103
- w.lookup("2001:db8::1428:57ab")
104
- w.lookup("google.it")
105
- end
97
+ ```ruby
98
+ Whois::Client.new do |w|
99
+ w.lookup("google.com")
100
+ w.lookup(".com")
101
+ w.lookup("74.125.67.100")
102
+ w.lookup("2001:db8::1428:57ab")
103
+ w.lookup("google.it")
104
+ end
105
+ ```
106
106
 
107
107
  ### Consuming the Record
108
108
 
@@ -110,86 +110,70 @@ Any WHOIS query returns a `Whois::Record`. This object looks like a String, but
110
110
 
111
111
  `Whois::Record` encapsulates a WHOIS record and provides the ability to parse the WHOIS response programmatically, by using an object oriented syntax.
112
112
 
113
- r = Whois.whois("google.it")
114
- # => #<Whois::Record>
115
-
116
- r.available?
117
- # => false
118
- r.registered?
119
- # => true
120
-
121
- r.created_on
122
- # => Fri Dec 10 00:00:00 +0100 1999
123
-
124
- t = r.technical_contact
125
- # => #<Whois::Record::Contact>
126
- t.id
127
- # => "TS7016-ITNIC"
128
- t.name
129
- # => "Technical Services"
130
-
131
- r.nameservers.each do |nameserver|
132
- puts nameserver
133
- end
134
-
135
- This feature is made possible by the *Whois* record parsers. Unfortunately, due to the lack of a global standard, each WHOIS server requires a specific parser. For this reason, the library doesn't support all existing WHOIS servers.
136
-
137
- If you create a new parser, please consider releasing it to the public so that it can be included in a next version.
113
+ ```ruby
114
+ r = Whois.whois("google.it")
115
+ # => #<Whois::Record>
138
116
 
139
- ### Timeout
117
+ r.available?
118
+ # => false
119
+ r.registered?
120
+ # => true
140
121
 
141
- By default, each query run though the client has a timeout value of 5 seconds. If the execution exceeds timeout limit, the client raises a `Timeout::Error` exception.
122
+ r.created_on
123
+ # => Fri Dec 10 00:00:00 +0100 1999
142
124
 
143
- Off course, you can customize the timeout value setting a different value. If timeout is `nil`, the client will until the response is sent back from the server or the process is killed. Don't disable the timeout unless you really know you are doing!
125
+ t = r.technical_contact
126
+ # => #<Whois::Record::Contact>
127
+ t.id
128
+ # => "TS7016-ITNIC"
129
+ t.name
130
+ # => "Technical Services"
144
131
 
145
- w = Whois::Client.new(:timeout => 10)
146
- w.timeout # => 10
147
- w.timeout = 5
148
- w.timeout # => 5
149
-
150
- w.lookup("google.com")
132
+ r.nameservers.each do |nameserver|
133
+ puts nameserver
134
+ end
135
+ ```
151
136
 
137
+ This feature is made possible by the <tt>Whois</tt> record parsers. Unfortunately, due to the lack of a global standard, each WHOIS server requires a specific parser. For this reason, the library doesn't support all existing WHOIS servers.
152
138
 
153
- ## Acknowledgments
139
+ If you create a new parser, please consider releasing it to the public so that it can be included in a next version.
154
140
 
155
- First of all, I would like to express my most sincere thanks to Cyril Mougel, the author of the first Ruby Whois gem that has been available since 2007. Cyril has been kind enough to yield me the privilege of using the RubyForge Whois project and the Whois package name to publish this library. To express all my gratitude, the release 0.5.0 and all sub sequential versions of the new Whois up to 0.9.x are 100% compatible with Cyril's Whois.
141
+ ### Timeout
156
142
 
157
- Whois is largely inspired by other notable Whois projects, most of all the Debian Whois library written and maintained by Marco D'Itri. Other good ideas and design decisions come from the PERL `Net::DRI` package.
143
+ By default, each query run though the client has a timeout value of 5 seconds. If the execution exceeds timeout limit, the client raises a `Timeout::Error` exception.
158
144
 
159
- I would lie if I say I'm completely unaware of the other Ruby Whois projects. Before starting this Ruby Whois library I deeply investigated the available resources and, despite none of them was a good candidate for a refactoring, some of them expose a really cool API.
160
- They didn't directly influence this library or any design decision, but they have been a really interesting code-reading.
145
+ Off course, you can customize the timeout value setting a different value. If timeout is `nil`, the client will until the response is sent back from the server or the process is killed. Don't disable the timeout unless you really know you are doing!
161
146
 
162
- The parser architecture has been inspired by the [PHPWhois](http://phpwhois.sourceforge.net/) project. The authors puts lot of effort to create whois-specific parsers normalizing the different responses in a single tree-based structure. So far, this is the only one open source project that offers such this feature in all the programming language ecosystem.
147
+ ```ruby
148
+ w = Whois::Client.new(:timeout => 10)
149
+ w.timeout # => 10
150
+ w.timeout = 5
151
+ w.timeout # => 5
163
152
 
164
- Despite I spent weeks reading source code from the available whois libraries, Ruby *Whois* has been built from scratch trying to focus on long-term maintainability and flexibility and cannot be considered a Ruby port of any of other existing Whois libraries.
153
+ w.lookup("google.com")
154
+ ```
165
155
 
166
156
 
167
157
  ## Credits
168
158
 
169
- - [Simone Carletti](http://www.simonecarletti.com/) <weppos@weppos.net> - Author
170
- - [Contributors](https://github.com/weppos/whois/contributors)
159
+ <tt>Whois</tt> was created and is maintained by [Simone Carletti](http://www.simonecarletti.com/). Many improvements and bugfixes were contributed by the [open source community](https://github.com/weppos/whois/graphs/contributors).
171
160
 
172
161
 
173
- ## Contribute
162
+ ## Contributing
174
163
 
175
- Direct questions and discussions to the [mailing list](http://groups.google.com/group/ruby-whois).
164
+ Direct questions and discussions to [Stack Overflow](http://stackoverflow.com/questions/tagged/whois-ruby).
176
165
 
177
- Pull requests are very welcome! Please include spec and/or feature coverage for every patch, and create a topic branch for every separate change you make.
166
+ [Pull requests](https://github.com/weppos/whois/pulls) are very welcome! Please include spec and/or feature coverage for every patch, and create a topic branch for every separate change you make.
178
167
 
179
168
  Report issues or feature requests to [GitHub Issues](https://github.com/weppos/whois/issues).
180
169
 
181
170
 
182
- ## More
171
+ ## More Information
183
172
 
184
173
  - [Homepage](http://www.ruby-whois.org/)
185
- - [Repository](https://github.com/weppos/whois)
186
- - [Documentation](http://www.ruby-whois.org/documentation/) - The official documentation, see also the [API Documentation](http://www.ruby-whois.org/api).
187
- - [Discussion Group](http://groups.google.com/group/ruby-whois)
188
-
189
-
190
- ## Changelog
191
-
192
- See the [CHANGELOG](CHANGELOG.md) file for details.
174
+ - [RubyGems](https://rubygems.org/gems/whois)
175
+ - [Issues](https://github.com/weppos/whois)
176
+ - [Stack Overflow](http://stackoverflow.com/questions/tagged/whois-ruby)
193
177
 
194
178
 
195
179
  ## License
data/bin/ruby-whois CHANGED
@@ -1,4 +1,4 @@
1
- #!/usr/bin/env ruby -wKU
1
+ #!/usr/bin/env ruby -w
2
2
 
3
3
  $:.unshift(File.expand_path("../../lib", __FILE__))
4
4
 
@@ -59,6 +59,6 @@ begin
59
59
  puts @client.lookup(object)
60
60
  rescue Whois::Error => e
61
61
  abort(e.message)
62
- rescue Timeout::Error => e
62
+ rescue Timeout::Error
63
63
  abort("Request Timeout")
64
64
  end
data/data/tld.json CHANGED
@@ -78,14 +78,14 @@
78
78
  "host": "whois.centralnic.com"
79
79
  },
80
80
  ".com": {
81
- "host": "whois.crsnic.net",
81
+ "host": "whois.verisign-grs.com",
82
82
  "adapter": "verisign"
83
83
  },
84
84
  ".za.net": {
85
85
  "host": "whois.za.net"
86
86
  },
87
87
  ".net": {
88
- "host": "whois.crsnic.net",
88
+ "host": "whois.verisign-grs.com",
89
89
  "adapter": "verisign"
90
90
  },
91
91
  ".eu.org": {
@@ -312,7 +312,7 @@
312
312
  "host": "whois.cira.ca"
313
313
  },
314
314
  ".cc": {
315
- "host": "whois.nic.cc",
315
+ "host": "ccwhois.verisign-grs.com",
316
316
  "adapter": "verisign"
317
317
  },
318
318
  ".cd": {
@@ -1152,7 +1152,7 @@
1152
1152
  "host": "whois.nic.fr"
1153
1153
  },
1154
1154
  ".ws": {
1155
- "host": "whois.samoanic.ws"
1155
+ "host": "whois.website.ws"
1156
1156
  },
1157
1157
  ".xxx": {
1158
1158
  "host": "whois.nic.xxx"
@@ -38,7 +38,7 @@ module Whois
38
38
  property_supported :status do
39
39
  list = Array.wrap(node("Domain Status")).map(&:downcase)
40
40
  case
41
- when list.include?("available")
41
+ when list.include?("no object found")
42
42
  :available
43
43
  when list.include?("ok")
44
44
  :registered
@@ -15,8 +15,7 @@ module Whois
15
15
  class Record
16
16
  class Parser
17
17
 
18
- # Parser for the whois.nic.cc server.
19
- class WhoisNicCc < Base
18
+ class BaseVerisign < Base
20
19
  include Scanners::Scannable
21
20
 
22
21
  self.scanner = Scanners::Verisign
@@ -37,11 +36,16 @@ module Whois
37
36
 
38
37
 
39
38
  property_supported :status do
40
- node("Domain Status")
39
+ # node("Status")
40
+ if available?
41
+ :available
42
+ else
43
+ :registered
44
+ end
41
45
  end
42
46
 
43
47
  property_supported :available? do
44
- node("Sponsoring Registrar").nil?
48
+ !!(content_for_scanner =~ /^No match for/)
45
49
  end
46
50
 
47
51
  property_supported :registered? do
@@ -65,10 +69,9 @@ module Whois
65
69
  property_supported :registrar do
66
70
  node("Sponsoring Registrar") do |value|
67
71
  Whois::Record::Registrar.new(
68
- :id => node("Sponsoring Registrar IANA ID"),
69
- :name => value,
70
- :organization => value,
71
- :url => referral_url
72
+ id: last_useful_item(node("Sponsoring Registrar IANA ID")),
73
+ name: last_useful_item(value),
74
+ url: referral_url
72
75
  )
73
76
  end
74
77
  end
@@ -76,7 +79,7 @@ module Whois
76
79
 
77
80
  property_supported :nameservers do
78
81
  Array.wrap(node("Name Server")).reject { |value| value =~ /no nameserver/i }.map do |name|
79
- Record::Nameserver.new(:name => name.downcase)
82
+ Nameserver.new(name: name.downcase)
80
83
  end
81
84
  end
82
85
 
@@ -86,11 +89,20 @@ module Whois
86
89
  end
87
90
 
88
91
  def referral_url
89
- node("Referral URL")
92
+ last_useful_item(node("Referral URL"))
93
+ end
94
+
95
+
96
+ private
97
+
98
+ # In case of "SPAM Response", the response contains more than one item
99
+ # for the same value and the value becomes an Array.
100
+ def last_useful_item(values)
101
+ values.is_a?(Array) ? values.last : values
90
102
  end
91
103
 
92
104
  end
93
105
 
94
106
  end
95
107
  end
96
- end
108
+ end