whois 1.5.0 → 1.5.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,5 +1,16 @@
1
1
  = Changelog
2
2
 
3
+ == Release 1.5.1
4
+
5
+ * NEW: Added simple .kg TLD parser (whois.domain.kg).
6
+
7
+ * NEW: Added simple .md TLD parser (whois.nic.md).
8
+
9
+ * FIXED: Fixed Unknown status `Renewal request being processed.' for whois.nic.uk.
10
+
11
+ * FIXED: With some .cz domains, whois.nic.cz parser returns invalid values for nameservers.
12
+
13
+
3
14
  == Release 1.5.0
4
15
 
5
16
  WARNING: Whois >= 1.5.0 requires Ruby 1.8.7 or newer.
@@ -0,0 +1,85 @@
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>, Mikkel Kristensen <mikkel@tdx.dk>
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.domain.kg
26
+ #
27
+ # Parser for the whois.domain.kg 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 WhoisDomainKg < 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 =~ /This domain is available for registration/)
47
+ end
48
+
49
+ property_supported :registered? do
50
+ @registered ||= !available?
51
+ end
52
+
53
+
54
+ property_supported :created_on do
55
+ @created_on ||= if content_for_scanner =~ /Record created: (.+?)\n/
56
+ Time.parse($1)
57
+ end
58
+ end
59
+
60
+ property_supported :updated_on do
61
+ @updated_on ||= if content_for_scanner =~ /Record last updated on (.+?)\n/
62
+ Time.parse($1)
63
+ end
64
+ end
65
+
66
+ property_supported :expires_on do
67
+ @expires_on ||= if content_for_scanner =~ /Record expires on (.+?)\n/
68
+ Time.parse($1)
69
+ end
70
+ end
71
+
72
+
73
+ property_supported :nameservers do
74
+ @nameservers ||= if content_for_scanner =~ /Name servers in the listed order:\n\n((.+\n)+)\n/
75
+ $1.split("\n").map(&:downcase)
76
+ else
77
+ []
78
+ end
79
+ end
80
+
81
+ end
82
+
83
+ end
84
+ end
85
+ end
@@ -56,26 +56,26 @@ module Whois
56
56
 
57
57
 
58
58
  property_supported :created_on do
59
- @created_on ||= if content_for_scanner =~ /registered:\s+(.*)\n/
59
+ @created_on ||= if content_for_scanner =~ /registered:\s+(.+?)\n/
60
60
  Time.parse($1)
61
61
  end
62
62
  end
63
63
 
64
64
  property_supported :updated_on do
65
- @updated_on ||= if content_for_scanner =~ /changed:\s+(.*)\n/
65
+ @updated_on ||= if content_for_scanner =~ /changed:\s+(.+?)\n/
66
66
  Time.parse($1)
67
67
  end
68
68
  end
69
69
 
70
70
  property_supported :expires_on do
71
- @expires_on ||= if content_for_scanner =~ /expire:\s+(.*)\n/
71
+ @expires_on ||= if content_for_scanner =~ /expire:\s+(.+?)\n/
72
72
  Time.parse($1)
73
73
  end
74
74
  end
75
75
 
76
76
 
77
77
  property_supported :nameservers do
78
- @nameservers ||= content_for_scanner.scan(/nserver:\s+(.+)\n/).flatten.map(&:strip)
78
+ @nameservers ||= content_for_scanner.scan(/nserver:\s+(.+)\n/).flatten.map { |value| value.strip.split(" ").first }
79
79
  end
80
80
 
81
81
  end
@@ -0,0 +1,77 @@
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.nic.md parser
26
+ #
27
+ # Parser for the whois.nic.md 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 WhoisNicMd < 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 == "No match for")
47
+ end
48
+
49
+ property_supported :registered? do
50
+ @registered ||= !available?
51
+ end
52
+
53
+
54
+ property_supported :created_on do
55
+ @created_on ||= if content_for_scanner =~ /Created:\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 =~ /Expiration date:\s+(.+?)\n/
64
+ Time.parse($1)
65
+ end
66
+ end
67
+
68
+
69
+ property_supported :nameservers do
70
+ @nameservers ||= content_for_scanner.scan(/Name server:\s(.+?)\n/).flatten.map { |value| value.split(" ").first }
71
+ end
72
+
73
+ end
74
+
75
+ end
76
+ end
77
+ end
@@ -86,4 +86,4 @@ module Whois
86
86
 
87
87
  end
88
88
  end
89
- end
89
+ end
@@ -39,9 +39,10 @@ module Whois
39
39
  property_supported :status do
40
40
  @status ||= if content_for_scanner =~ /\s+Registration status:\s+(.+?)\n/
41
41
  case $1.downcase
42
- when "registered until renewal date." then :registered
42
+ when "registered until renewal date." then :registered
43
+ when "renewal request being processed." then :registered
43
44
  # NEWSTATUS
44
- when "renewal required." then :registered
45
+ when "renewal required." then :registered
45
46
  else
46
47
  Whois.bug!(ParserError, "Unknown status `#{$1}'.")
47
48
  end
@@ -19,7 +19,7 @@ module Whois
19
19
  module Version
20
20
  MAJOR = 1
21
21
  MINOR = 5
22
- PATCH = 0
22
+ PATCH = 1
23
23
  BUILD = nil
24
24
 
25
25
  STRING = [MAJOR, MINOR, PATCH, BUILD].compact.join(".")
@@ -2,9 +2,9 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{whois}
5
- s.version = "1.5.dev"
5
+ s.version = "1.5.0"
6
6
 
7
- s.required_rubygems_version = Gem::Requirement.new("> 1.3.1") if s.respond_to? :required_rubygems_version=
7
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Simone Carletti"]
9
9
  s.date = %q{2010-10-22}
10
10
  s.default_executable = %q{ruby-whois}
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: 3
4
+ hash: 1
5
5
  prerelease: false
6
6
  segments:
7
7
  - 1
8
8
  - 5
9
- - 0
10
- version: 1.5.0
9
+ - 1
10
+ version: 1.5.1
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-10-22 00:00:00 +02:00
18
+ date: 2010-10-24 00:00:00 +02:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -84,6 +84,7 @@ files:
84
84
  - lib/whois/answer/parser/whois.dns.lu.rb
85
85
  - lib/whois/answer/parser/whois.dns.pt.rb
86
86
  - lib/whois/answer/parser/whois.domain-registry.nl.rb
87
+ - lib/whois/answer/parser/whois.domain.kg.rb
87
88
  - lib/whois/answer/parser/whois.domainregistry.ie.rb
88
89
  - lib/whois/answer/parser/whois.domreg.lt.rb
89
90
  - lib/whois/answer/parser/whois.dot.tk.rb
@@ -142,6 +143,7 @@ files:
142
143
  - lib/whois/answer/parser/whois.nic.li.rb
143
144
  - lib/whois/answer/parser/whois.nic.lv.rb
144
145
  - lib/whois/answer/parser/whois.nic.ly.rb
146
+ - lib/whois/answer/parser/whois.nic.md.rb
145
147
  - lib/whois/answer/parser/whois.nic.mu.rb
146
148
  - lib/whois/answer/parser/whois.nic.mx.rb
147
149
  - lib/whois/answer/parser/whois.nic.name.rb