whois 1.3.1 → 1.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/CHANGELOG.rdoc CHANGED
@@ -1,6 +1,17 @@
1
1
  = Changelog
2
2
 
3
3
 
4
+ == Release 1.3.2
5
+
6
+ * FIXED: .nl TLD parser doesn't understand quarantine status (closes #34)
7
+
8
+ * CHANGED: Parser aliases are now created aliasing constants instead subclassing.
9
+
10
+ * CHANGED: Updated .hk parser to whois.hkirc.hk (closes #30)
11
+
12
+ * CHANGED: Updated .tw parser to whois.twnic.net.tw (closes #31)
13
+
14
+
4
15
  == Release 1.3.1
5
16
 
6
17
  * SERVER: Added the following 10 new IDN TLD:
data/README.rdoc CHANGED
@@ -16,19 +16,20 @@ An extensive test suite is available to verify the library correctness but you m
16
16
  * Flexible and extensible interface (e.g. You can define custom servers on the fly)
17
17
  * Object oriented design, featuring 10 different design patterns
18
18
  * Pure Ruby library, without any external dependency other than Ruby itself
19
- * Compatible with Ruby 1.8.6 and greater, including Ruby 1.9 branch
20
- * Successfully tested against multiple Ruby platforms and versions including Ruby, Ruby Enterprise Edition and MacRuby
19
+ * Compatible with {Ruby 1.8.6 and greater}[http://www.ruby-whois.org/manual/installation.html#s-requirements], including Ruby 1.9 branch
20
+ * Successfully tested against multiple Ruby versions and interpreters, including Ruby, Ruby Enterprise Edition, jRuby, and MacRuby
21
21
 
22
22
 
23
23
  == Requirements
24
24
 
25
25
  * Ruby >= 1.8.6
26
26
 
27
- Whois has been {successfully tested}[http://www.ruby-whois.org/manual/installation.html] against the following Ruby interpreters:
27
+ Whois has been successfully tested against several Ruby interpreters, including
28
28
 
29
- * Ruby 1.8.6 / 1.8.7 / 1.9.1 / 1.9.2
30
- * MacRuby
29
+ * Ruby 1.8.6 / 1.8.7 / 1.9.1 / 1.9.2 (MRI)
31
30
  * Ruby Enterprise Edition
31
+ * MacRuby
32
+ * jRuby
32
33
 
33
34
  Do you run any other Ruby platform or version? Are you experiencing any problem? Join our {discussion group}[http://groups.google.com/group/ruby-whois].
34
35
 
@@ -14,7 +14,6 @@
14
14
  #++
15
15
 
16
16
 
17
- require 'whois/answer/parser/base'
18
17
  require 'whois/answer/parser/whois.nic.net.sa'
19
18
 
20
19
 
@@ -22,14 +21,9 @@ module Whois
22
21
  class Answer
23
22
  class Parser
24
23
 
25
- #
26
- # = saudinic.net.sa parser
27
- #
28
- # Parser for the saudinic.net.sa server.
29
- # Aliases the whois.nic.net.sa parser.
30
- #
31
- class SaudinicNetSa < WhoisNicNetSa
32
- end
24
+ # Parser for the <tt>saudinic.net.sa</tt> server.
25
+ # Aliases the <tt>whois.nic.net.sa</tt> parser.
26
+ SaudinicNetSa = WhoisNicNetSa
33
27
 
34
28
  end
35
29
  end
@@ -21,14 +21,9 @@ module Whois
21
21
  class Answer
22
22
  class Parser
23
23
 
24
- #
25
- # = whois.ausregistry.net.au parser
26
- #
27
- # Parser for the whois.ausregistry.net.au server.
28
- # Aliases the whois.audns.net.au.
29
- #
30
- class WhoisAusregistryNetAu < WhoisAudnsNetAu
31
- end
24
+ # Parser for the <tt>whois.ausregistry.net.au</tt> server.
25
+ # Aliases the <tt>whois.audns.net.au</tt>.
26
+ WhoisAusregistryNetAu = WhoisAudnsNetAu
32
27
 
33
28
  end
34
29
  end
@@ -36,19 +36,22 @@ module Whois
36
36
 
37
37
  property_supported :status do
38
38
  @status ||= if content_for_scanner =~ /Domain status:\s+(.*?)\n/
39
- case $1.downcase.to_sym
40
- when :exist then :registered
41
- when :avail then :available
39
+ case $1.downcase
40
+ when "exist" then :registered
41
+ when "avail" then :available
42
+ else
43
+ raise ParserError, "Unknown status `#{$1}'. " +
44
+ "Please report the issue at http://github.com/weppos/whois/issues"
42
45
  end
43
46
  end
44
47
  end
45
48
 
46
49
  property_supported :available? do
47
- @available ||= (status == :available)
50
+ @available ||= (status == :available)
48
51
  end
49
52
 
50
53
  property_supported :registered? do
51
- !available?
54
+ @registered ||= !available?
52
55
  end
53
56
 
54
57
 
@@ -21,14 +21,9 @@ module Whois
21
21
  class Answer
22
22
  class Parser
23
23
 
24
- #
25
- # = whois.cnnic.net.cn parser
26
- #
27
- # Parser for the whois.cnnic.net.cn server.
28
- # Aliases the whois.cnnic.cn parser.
29
- #
30
- class WhoisCnnicNetCn < WhoisCnnicCn
31
- end
24
+ # Parser for the <tt>whois.cnnic.net.cn</tt> server.
25
+ # Aliases the <tt>whois.cnnic.cn</tt> parser.
26
+ WhoisCnnicNetCn = WhoisCnnicCn
32
27
 
33
28
  end
34
29
  end
@@ -35,19 +35,25 @@ module Whois
35
35
  class WhoisDomainRegistryNl < Base
36
36
 
37
37
  property_supported :status do
38
- if available?
39
- :available
38
+ @status ||= if content_for_scanner =~ /Status:\s+(.*?)\n/
39
+ case $1.downcase
40
+ when "active" then :registered
41
+ when "in quarantine" then :quarantine
42
+ else
43
+ raise ParserError, "Unknown status `#{$1}'. " +
44
+ "Please report the issue at http://github.com/weppos/whois/issues"
45
+ end
40
46
  else
41
- :registered
47
+ :available
42
48
  end
43
49
  end
44
50
 
45
51
  property_supported :available? do
46
- @available ||= !(content_for_scanner =~ /Status: active/)
52
+ @available ||= (status == :available)
47
53
  end
48
54
 
49
55
  property_supported :registered? do
50
- !available?
56
+ @registered ||= [:registered, :quarantine].include?(status)
51
57
  end
52
58
 
53
59
 
@@ -14,67 +14,16 @@
14
14
  #++
15
15
 
16
16
 
17
- require 'whois/answer/parser/base'
17
+ require 'whois/answer/parser/whois.hkirc.hk'
18
18
 
19
19
 
20
20
  module Whois
21
21
  class Answer
22
22
  class Parser
23
23
 
24
- #
25
- # = whois.hkdnr.net.hk parser
26
- #
27
- # Parser for the whois.hkdnr.net.hk 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 WhoisHkdnrNetHk < 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 == "Domain Not Found")
47
- end
48
-
49
- property_supported :registered? do
50
- !available?
51
- end
52
-
53
-
54
- property_supported :created_on do
55
- @created_on ||= if content_for_scanner =~ /Domain Name Commencement Date:\s(.*?)\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 =~ /Expiry Date:\s(.*?)\n/
64
- Time.parse($1)
65
- end
66
- end
67
-
68
-
69
- property_supported :nameservers do
70
- @nameservers ||= if content_for_scanner =~ /Name Servers Information:\n\n((.+\n)+)\n/
71
- $1.split("\n").map { |value| value.strip.downcase }
72
- else
73
- []
74
- end
75
- end
76
-
77
- end
24
+ # Parser for the <tt>whois.hkdnr.net.hk</tt> server.
25
+ # Aliases the <tt>whois.hkirc.hk</tt> parser.
26
+ WhoisHkdnrNetHk = WhoisHkircHk
78
27
 
79
28
  end
80
29
  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.hkirc.hk parser
26
+ #
27
+ # Parser for the whois.hkirc.hk 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 WhoisHkircHk < 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 == "Domain Not Found")
47
+ end
48
+
49
+ property_supported :registered? do
50
+ !available?
51
+ end
52
+
53
+
54
+ property_supported :created_on do
55
+ @created_on ||= if content_for_scanner =~ /Domain Name Commencement Date:\s(.*?)\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 =~ /Expiry Date:\s(.*?)\n/
64
+ Time.parse($1)
65
+ end
66
+ end
67
+
68
+
69
+ property_supported :nameservers do
70
+ @nameservers ||= if content_for_scanner =~ /Name Servers Information:\n\n((.+\n)+)\n/
71
+ $1.split("\n").map { |value| value.strip.downcase }
72
+ else
73
+ []
74
+ end
75
+ end
76
+
77
+ end
78
+
79
+ end
80
+ end
81
+ end
@@ -141,7 +141,7 @@ Whois::Server.define :tld, ".gt", nil, {:adapter=>Whois::Server::Adapters::Web,
141
141
  Whois::Server.define :tld, ".gu", nil, {:adapter=>Whois::Server::Adapters::Web, :web=>"http://gadao.gov.gu/domainsearch.htm"}
142
142
  Whois::Server.define :tld, ".gw", nil, {:adapter=>Whois::Server::Adapters::None}
143
143
  Whois::Server.define :tld, ".gy", "whois.registry.gy"
144
- Whois::Server.define :tld, ".hk", "whois.hkdnr.net.hk"
144
+ Whois::Server.define :tld, ".hk", "whois.hkirc.hk"
145
145
  Whois::Server.define :tld, ".hm", "whois.registry.hm"
146
146
  Whois::Server.define :tld, ".hn", "whois.afilias-grs.info", {:adapter=>Whois::Server::Adapters::Afilias}
147
147
  Whois::Server.define :tld, ".hr", nil, {:web=>"http://www.dns.hr/pretrazivanje.html", :adapter=>Whois::Server::Adapters::Web}
@@ -275,7 +275,7 @@ Whois::Server.define :tld, ".tp", nil, {:adapter=>Whois::Server::Adapters::None}
275
275
  Whois::Server.define :tld, ".tr", "whois.nic.tr"
276
276
  Whois::Server.define :tld, ".tt", nil, {:web=>"http://www.nic.tt/cgi-bin/search.pl", :adapter=>Whois::Server::Adapters::Web}
277
277
  Whois::Server.define :tld, ".tv", "whois.nic.tv", {:adapter=>Whois::Server::Adapters::Verisign}
278
- Whois::Server.define :tld, ".tw", "whois.twnic.net"
278
+ Whois::Server.define :tld, ".tw", "whois.twnic.net.tw"
279
279
  Whois::Server.define :tld, ".tz", "whois.tznic.or.tz"
280
280
  Whois::Server.define :tld, ".in.ua", "whois.in.ua"
281
281
  Whois::Server.define :tld, ".ua", "whois.net.ua"
data/lib/whois/version.rb CHANGED
@@ -19,7 +19,7 @@ module Whois
19
19
  module Version
20
20
  MAJOR = 1
21
21
  MINOR = 3
22
- PATCH = 1
22
+ PATCH = 2
23
23
  BUILD = nil
24
24
 
25
25
  STRING = [MAJOR, MINOR, PATCH, BUILD].compact.join(".")
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: 25
4
+ hash: 31
5
5
  prerelease: false
6
6
  segments:
7
7
  - 1
8
8
  - 3
9
- - 1
10
- version: 1.3.1
9
+ - 2
10
+ version: 1.3.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-08-24 00:00:00 +02:00
18
+ date: 2010-08-26 00:00:00 +02:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -91,6 +91,7 @@ files:
91
91
  - lib/whois/answer/parser/whois.eu.org.rb
92
92
  - lib/whois/answer/parser/whois.eu.rb
93
93
  - lib/whois/answer/parser/whois.hkdnr.net.hk.rb
94
+ - lib/whois/answer/parser/whois.hkirc.hk.rb
94
95
  - lib/whois/answer/parser/whois.iana.org.rb
95
96
  - lib/whois/answer/parser/whois.in.ua.rb
96
97
  - lib/whois/answer/parser/whois.isnic.is.rb