whois 1.6.5 → 1.6.6

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG.rdoc CHANGED
@@ -1,5 +1,13 @@
1
1
  = Changelog
2
2
 
3
+ == Release 1.6.6
4
+
5
+ * NEW: Backported whois.centralnic.net support from version 2.0.
6
+
7
+ * FIXED: whois.nic-se.se must support :inactive status.
8
+
9
+ * FIXED: whois.cira.ca must support "auto-renew grace" status.
10
+
3
11
 
4
12
  == Release 1.6.5
5
13
 
@@ -0,0 +1,124 @@
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.centralnic.net parser
26
+ #
27
+ # Parser for the whois.centralnic.net 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 WhoisCentralnicCom < Base
36
+
37
+ # property_supported :disclaimer do
38
+ # @disclaimer ||= if content_for_scanner =~ /(This whois service is provided by .*)\n/m
39
+ # $1.gsub("\n", " ")
40
+ # else
41
+ # raise ParserError, "Unexpected response trying to parse `:disclaimer' property. The parser might be outdated."
42
+ # end
43
+ # end
44
+
45
+
46
+ # property_supported :domain do
47
+ # @domain ||= if content_for_scanner =~ /Domain Name: (.*)\n/
48
+ # $1.strip
49
+ # elsif content_for_scanner =~ /^No match for (.*)\n/
50
+ # $1.strip
51
+ # else
52
+ # raise ParserError, "Unexpected response trying to parse `:domain' property. The parser might be outdated."
53
+ # end
54
+ # end
55
+ #
56
+ # property_not_supported :domain_id
57
+
58
+
59
+ property_not_supported :referral_whois
60
+
61
+ property_not_supported :referral_url
62
+
63
+
64
+ property_supported :status do
65
+ @status ||= if content_for_scanner =~ /Status: (.+?)\n/
66
+ case $1.downcase
67
+ when "live" then :registered
68
+ when "live, renewal in progress" then :registered
69
+ else
70
+ Whois.bug!(ParserError, "Unknown status `#{$1}'.")
71
+ end
72
+ else
73
+ :available
74
+ end
75
+ end
76
+
77
+ property_supported :available? do
78
+ @available ||= !!(content_for_scanner =~ /^No match for/)
79
+ end
80
+
81
+ property_supported :registered? do
82
+ @registered ||= !available?
83
+ end
84
+
85
+
86
+ property_supported :created_on do
87
+ @created_on ||= if content_for_scanner =~ /Record created on: (.+)\n/
88
+ Time.parse($1)
89
+ end
90
+ end
91
+
92
+ property_not_supported :updated_on
93
+
94
+ property_supported :expires_on do
95
+ @expires_on ||= if content_for_scanner =~ /Record expires on: (.+)\n/
96
+ Time.parse($1)
97
+ end
98
+ end
99
+
100
+
101
+ # property_supported :registrar do
102
+ # @registrar ||= if content_for_scanner =~ /Registrar: (.*) \((.*)\)\n/
103
+ # Answer::Registrar.new(
104
+ # :id => $1,
105
+ # :name => $2,
106
+ # :organization => $2
107
+ # )
108
+ # end
109
+ # end
110
+
111
+
112
+ property_supported :nameservers do
113
+ @nameservers ||= if content_for_scanner =~ /Domain servers in listed order:\n\n((.+\n)+)\n/
114
+ $1.split("\n").map { |value| value.strip.downcase }
115
+ else
116
+ []
117
+ end
118
+ end
119
+
120
+ end
121
+
122
+ end
123
+ end
124
+ end
@@ -0,0 +1,31 @@
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/whois.centralnic.com'
18
+
19
+
20
+ module Whois
21
+ class Answer
22
+ class Parser
23
+
24
+ # Parser for the <tt>whois.centralnic.net</tt> server.
25
+ # Aliases the <tt>whois.centralnic.com</tt> parser.
26
+ class WhoisCentralnicNet < WhoisCentralnicCom
27
+ end
28
+
29
+ end
30
+ end
31
+ end
@@ -38,9 +38,10 @@ module Whois
38
38
  @status ||= if content_for_scanner =~ /Domain status:\s+(.*?)\n/
39
39
  case $1.downcase
40
40
  # schema-2
41
- when "registered" then :registered
42
- when "redemption" then :registered
43
- when "available" then :available
41
+ when "registered" then :registered
42
+ when "redemption" then :registered
43
+ when "auto-renew grace" then :registered
44
+ when "available" then :available
44
45
  # schema-1
45
46
  when "exist" then :registered
46
47
  when "avail" then :available
@@ -35,9 +35,11 @@ module Whois
35
35
  class WhoisNicSeSe < Base
36
36
 
37
37
  property_supported :status do
38
- @status ||= if content_for_scanner =~ /state:\s+(.+?)\n/
38
+ # Two keys available: state and status.
39
+ @status ||= if content_for_scanner =~ /status:\s+(.+?)\n/
39
40
  case $1.downcase
40
- when "active" then :registered
41
+ when "ok" then :registered
42
+ when "inactive" then :inactive
41
43
  else
42
44
  Whois.bug!(ParserError, "Unknown status `#{$1}'.")
43
45
  end
@@ -1,23 +1,25 @@
1
- Whois::Server.define :tld, ".br.com", "whois.centralnic.net"
2
- Whois::Server.define :tld, ".cn.com", "whois.centralnic.net"
3
- Whois::Server.define :tld, ".de.com", "whois.centralnic.net"
4
- Whois::Server.define :tld, ".eu.com", "whois.centralnic.net"
5
- Whois::Server.define :tld, ".gb.com", "whois.centralnic.net"
6
- Whois::Server.define :tld, ".gb.net", "whois.centralnic.net"
7
- Whois::Server.define :tld, ".hu.com", "whois.centralnic.net"
8
- Whois::Server.define :tld, ".no.com", "whois.centralnic.net"
9
- Whois::Server.define :tld, ".qc.com", "whois.centralnic.net"
10
- Whois::Server.define :tld, ".ru.com", "whois.centralnic.net"
11
- Whois::Server.define :tld, ".sa.com", "whois.centralnic.net"
12
- Whois::Server.define :tld, ".se.com", "whois.centralnic.net"
13
- Whois::Server.define :tld, ".se.net", "whois.centralnic.net"
14
- Whois::Server.define :tld, ".uk.com", "whois.centralnic.net"
15
- Whois::Server.define :tld, ".uk.net", "whois.centralnic.net"
16
- Whois::Server.define :tld, ".us.com", "whois.centralnic.net"
17
- Whois::Server.define :tld, ".uy.com", "whois.centralnic.net"
18
- Whois::Server.define :tld, ".za.com", "whois.centralnic.net"
19
- Whois::Server.define :tld, ".jpn.com", "whois.centralnic.net"
20
- Whois::Server.define :tld, ".web.com", "whois.centralnic.net"
1
+ Whois::Server.define :tld, ".ae.org", "whois.centralnic.com"
2
+ Whois::Server.define :tld, ".ar.com", "whois.centralnic.com"
3
+ Whois::Server.define :tld, ".br.com", "whois.centralnic.com"
4
+ Whois::Server.define :tld, ".cn.com", "whois.centralnic.com"
5
+ Whois::Server.define :tld, ".de.com", "whois.centralnic.com"
6
+ Whois::Server.define :tld, ".eu.com", "whois.centralnic.com"
7
+ Whois::Server.define :tld, ".gb.com", "whois.centralnic.com"
8
+ Whois::Server.define :tld, ".gb.net", "whois.centralnic.com"
9
+ Whois::Server.define :tld, ".hu.com", "whois.centralnic.com"
10
+ Whois::Server.define :tld, ".jpn.com", "whois.centralnic.com"
11
+ Whois::Server.define :tld, ".kr.com", "whois.centralnic.com"
12
+ Whois::Server.define :tld, ".no.com", "whois.centralnic.com"
13
+ Whois::Server.define :tld, ".qc.com", "whois.centralnic.com"
14
+ Whois::Server.define :tld, ".ru.com", "whois.centralnic.com"
15
+ Whois::Server.define :tld, ".sa.com", "whois.centralnic.com"
16
+ Whois::Server.define :tld, ".se.com", "whois.centralnic.com"
17
+ Whois::Server.define :tld, ".se.net", "whois.centralnic.com"
18
+ Whois::Server.define :tld, ".uk.com", "whois.centralnic.com"
19
+ Whois::Server.define :tld, ".uk.net", "whois.centralnic.com"
20
+ Whois::Server.define :tld, ".us.com", "whois.centralnic.com"
21
+ Whois::Server.define :tld, ".uy.com", "whois.centralnic.com"
22
+ Whois::Server.define :tld, ".za.com", "whois.centralnic.com"
21
23
  Whois::Server.define :tld, ".com", "whois.crsnic.net", {:adapter=>Whois::Server::Adapters::Verisign}
22
24
  Whois::Server.define :tld, ".za.net", "whois.za.net"
23
25
  Whois::Server.define :tld, ".net", "whois.crsnic.net", {:adapter=>Whois::Server::Adapters::Verisign}
data/lib/whois/version.rb CHANGED
@@ -19,7 +19,7 @@ module Whois
19
19
  module Version
20
20
  MAJOR = 1
21
21
  MINOR = 6
22
- PATCH = 5
22
+ PATCH = 6
23
23
  BUILD = nil
24
24
 
25
25
  STRING = [MAJOR, MINOR, PATCH, BUILD].compact.join(".")
data/whois.gemspec CHANGED
@@ -2,11 +2,11 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{whois}
5
- s.version = "1.6.4"
5
+ s.version = "1.6.5"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Simone Carletti"]
9
- s.date = %q{2010-11-23}
9
+ s.date = %q{2010-12-07}
10
10
  s.default_executable = %q{ruby-whois}
11
11
  s.description = %q{ 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.
12
12
  }
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: 5
4
+ hash: 3
5
5
  prerelease: false
6
6
  segments:
7
7
  - 1
8
8
  - 6
9
- - 5
10
- version: 1.6.5
9
+ - 6
10
+ version: 1.6.6
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-12-07 00:00:00 +01:00
18
+ date: 2010-12-13 00:00:00 +01:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -89,6 +89,8 @@ files:
89
89
  - lib/whois/answer/parser/whois.biz.rb
90
90
  - lib/whois/answer/parser/whois.cat.rb
91
91
  - lib/whois/answer/parser/whois.cctld.uz.rb
92
+ - lib/whois/answer/parser/whois.centralnic.com.rb
93
+ - lib/whois/answer/parser/whois.centralnic.net.rb
92
94
  - lib/whois/answer/parser/whois.cira.ca.rb
93
95
  - lib/whois/answer/parser/whois.cnnic.cn.rb
94
96
  - lib/whois/answer/parser/whois.cnnic.net.cn.rb