whois 1.0.1 → 1.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (43) hide show
  1. data/CHANGELOG.rdoc +5 -0
  2. data/lib/whois/answer/parser/jobswhois.verisign-grs.com.rb +1 -1
  3. data/lib/whois/answer/parser/whois.adamsnames.tc.rb +1 -1
  4. data/lib/whois/answer/parser/whois.biz.rb +5 -5
  5. data/lib/whois/answer/parser/whois.cira.ca.rb +4 -4
  6. data/lib/whois/answer/parser/whois.denic.de.rb +2 -2
  7. data/lib/whois/answer/parser/whois.dk-hostmaster.dk.rb +5 -5
  8. data/lib/whois/answer/parser/whois.domain-registry.nl.rb +3 -3
  9. data/lib/whois/answer/parser/whois.domainregistry.ie.rb +3 -3
  10. data/lib/whois/answer/parser/whois.educause.edu.rb +4 -4
  11. data/lib/whois/answer/parser/whois.eu.org.rb +1 -1
  12. data/lib/whois/answer/parser/whois.eu.rb +1 -1
  13. data/lib/whois/answer/parser/whois.iana.org.rb +3 -3
  14. data/lib/whois/answer/parser/whois.isnic.is.rb +3 -3
  15. data/lib/whois/answer/parser/whois.nic.ac.rb +3 -3
  16. data/lib/whois/answer/parser/whois.nic.ch.rb +1 -1
  17. data/lib/whois/answer/parser/whois.nic.coop.rb +5 -5
  18. data/lib/whois/answer/parser/whois.nic.fr.rb +4 -4
  19. data/lib/whois/answer/parser/whois.nic.gl.rb +4 -4
  20. data/lib/whois/answer/parser/whois.nic.hu.rb +2 -2
  21. data/lib/whois/answer/parser/whois.nic.im.rb +2 -2
  22. data/lib/whois/answer/parser/whois.nic.io.rb +1 -1
  23. data/lib/whois/answer/parser/whois.nic.it.rb +2 -2
  24. data/lib/whois/answer/parser/whois.nic.mu.rb +4 -4
  25. data/lib/whois/answer/parser/whois.nic.name.rb +1 -1
  26. data/lib/whois/answer/parser/whois.nic.nu.rb +5 -5
  27. data/lib/whois/answer/parser/whois.nic.tel.rb +4 -4
  28. data/lib/whois/answer/parser/whois.nic.tl.rb +4 -4
  29. data/lib/whois/answer/parser/whois.nic.travel.rb +5 -5
  30. data/lib/whois/answer/parser/whois.nic.tv.rb +1 -1
  31. data/lib/whois/answer/parser/whois.nic.uk.rb +6 -6
  32. data/lib/whois/answer/parser/whois.nic.us.rb +5 -5
  33. data/lib/whois/answer/parser/whois.norid.no.rb +3 -3
  34. data/lib/whois/answer/parser/whois.register.bg.rb +4 -4
  35. data/lib/whois/answer/parser/whois.registro.br.rb +1 -1
  36. data/lib/whois/answer/parser/whois.ripe.net.rb +1 -1
  37. data/lib/whois/answer/parser/whois.ripn.net.rb +4 -4
  38. data/lib/whois/answer/parser/whois.rotld.ro.rb +1 -1
  39. data/lib/whois/answer/parser/whois.samoanic.ws.rb +4 -4
  40. data/lib/whois/answer/parser/whois.za.org.rb +3 -3
  41. data/lib/whois/version.rb +1 -1
  42. data/whois.gemspec +1 -1
  43. metadata +1 -1
data/CHANGELOG.rdoc CHANGED
@@ -1,6 +1,11 @@
1
1
  = Changelog
2
2
 
3
3
 
4
+ == Release 1.0.2
5
+
6
+ * CHANGED: Changed Parsers to use a normalized content version called Whois::Parser::Base#content_for_scanner (Dho! I forgot to save some files on TextMate)
7
+
8
+
4
9
  == Release 1.0.1
5
10
 
6
11
  * CHANGED: Changed Parsers to use a normalized content version called Whois::Parser::Base#content_for_scanner
@@ -89,7 +89,7 @@ module Whois
89
89
  protected
90
90
 
91
91
  def parse
92
- Scanners::VerisignScanner.new(content.to_s).parse
92
+ Scanners::VerisignScanner.new(content_for_scanner).parse
93
93
  end
94
94
 
95
95
  end
@@ -43,7 +43,7 @@ module Whois
43
43
  end
44
44
 
45
45
  property_supported :available? do
46
- @available ||= !!(content.to_s =~ /is not registered/)
46
+ @available ||= !!(content_for_scanner =~ /is not registered/)
47
47
  end
48
48
 
49
49
  property_supported :registered? do
@@ -35,11 +35,11 @@ module Whois
35
35
  class WhoisBiz < Base
36
36
 
37
37
  property_supported :status do
38
- @status ||= content.to_s.scan(/Domain Status:\s+(.*?)\n/).flatten
38
+ @status ||= content_for_scanner.scan(/Domain Status:\s+(.*?)\n/).flatten
39
39
  end
40
40
 
41
41
  property_supported :available? do
42
- @available ||= !!(content.to_s =~ /Not found:/)
42
+ @available ||= !!(content_for_scanner =~ /Not found:/)
43
43
  end
44
44
 
45
45
  property_supported :registered? do
@@ -48,19 +48,19 @@ module Whois
48
48
 
49
49
 
50
50
  property_supported :created_on do
51
- @created_on ||= if content.to_s =~ /Domain Registration Date:\s+(.*)\n/
51
+ @created_on ||= if content_for_scanner =~ /Domain Registration Date:\s+(.*)\n/
52
52
  Time.parse($1)
53
53
  end
54
54
  end
55
55
 
56
56
  property_supported :updated_on do
57
- @updated_on ||= if content.to_s =~ /Domain Last Updated Date:\s+(.*)\n/
57
+ @updated_on ||= if content_for_scanner =~ /Domain Last Updated Date:\s+(.*)\n/
58
58
  Time.parse($1)
59
59
  end
60
60
  end
61
61
 
62
62
  property_supported :expires_on do
63
- @expires_on ||= if content.to_s =~ /Domain Expiration Date:\s+(.*)\n/
63
+ @expires_on ||= if content_for_scanner =~ /Domain Expiration Date:\s+(.*)\n/
64
64
  Time.parse($1)
65
65
  end
66
66
  end
@@ -35,7 +35,7 @@ module Whois
35
35
  class WhoisCiraCa < Base
36
36
 
37
37
  property_supported :status do
38
- @status ||= if content.to_s =~ /Domain status:\s+(.*?)\n/
38
+ @status ||= if content_for_scanner =~ /Domain status:\s+(.*?)\n/
39
39
  case $1.downcase.to_sym
40
40
  when :exist then :registered
41
41
  when :avail then :available
@@ -53,19 +53,19 @@ module Whois
53
53
 
54
54
 
55
55
  property_supported :created_on do
56
- @created_on ||= if content.to_s =~ /Approval date:\s+(.*?)\n/
56
+ @created_on ||= if content_for_scanner =~ /Approval date:\s+(.*?)\n/
57
57
  Time.parse($1)
58
58
  end
59
59
  end
60
60
 
61
61
  property_supported :updated_on do
62
- @updated_on ||= if content.to_s =~ /Updated date:\s+(.*?)\n/
62
+ @updated_on ||= if content_for_scanner =~ /Updated date:\s+(.*?)\n/
63
63
  Time.parse($1)
64
64
  end
65
65
  end
66
66
 
67
67
  property_supported :expires_on do
68
- @expires_on ||= if content.to_s =~ /Renewal date:\s+(.*?)\n/
68
+ @expires_on ||= if content_for_scanner =~ /Renewal date:\s+(.*?)\n/
69
69
  Time.parse($1)
70
70
  end
71
71
  end
@@ -91,14 +91,14 @@ module Whois
91
91
  protected
92
92
 
93
93
  def parse
94
- Scanner.new(content.to_s).parse
94
+ Scanner.new(content_for_scanner).parse
95
95
  end
96
96
 
97
97
 
98
98
  class Scanner
99
99
 
100
100
  def initialize(content)
101
- @input = StringScanner.new(content.to_s)
101
+ @input = StringScanner.new(content)
102
102
  end
103
103
 
104
104
  def parse
@@ -35,13 +35,13 @@ module Whois
35
35
  class WhoisDkHostmasterDk < Base
36
36
 
37
37
  property_supported :status do
38
- @status ||= if content.to_s =~ /Status:\s+(.*)\n/
38
+ @status ||= if content_for_scanner =~ /Status:\s+(.*)\n/
39
39
  $1.downcase.to_sym
40
40
  end
41
41
  end
42
42
 
43
43
  property_supported :available? do
44
- @available ||= !!(content.to_s =~ /No entries found for the selected source/)
44
+ @available ||= !!(content_for_scanner =~ /No entries found for the selected source/)
45
45
  end
46
46
 
47
47
  property_supported :registered? do
@@ -50,7 +50,7 @@ module Whois
50
50
 
51
51
 
52
52
  property_supported :created_on do
53
- @created_on ||= if content.to_s =~ /Registered:\s+(.*)\n/
53
+ @created_on ||= if content_for_scanner =~ /Registered:\s+(.*)\n/
54
54
  Time.parse($1)
55
55
  end
56
56
  end
@@ -58,14 +58,14 @@ module Whois
58
58
  property_not_supported :updated_on
59
59
 
60
60
  property_supported :expires_on do
61
- @expires_on ||= if content.to_s =~ /Expires:\s+(.*)\n/
61
+ @expires_on ||= if content_for_scanner =~ /Expires:\s+(.*)\n/
62
62
  Time.parse($1)
63
63
  end
64
64
  end
65
65
 
66
66
 
67
67
  property_supported :nameservers do
68
- @nameservers ||= content.to_s.scan(/Hostname:\s+(.*)\n/).flatten
68
+ @nameservers ||= content_for_scanner.scan(/Hostname:\s+(.*)\n/).flatten
69
69
  end
70
70
 
71
71
  end
@@ -43,7 +43,7 @@ module Whois
43
43
  end
44
44
 
45
45
  property_supported :available? do
46
- @available ||= !(content.to_s =~ /Status: active/)
46
+ @available ||= !(content_for_scanner =~ /Status: active/)
47
47
  end
48
48
 
49
49
  property_supported :registered? do
@@ -52,13 +52,13 @@ module Whois
52
52
 
53
53
 
54
54
  property_supported :created_on do
55
- @created_on ||= if content.to_s =~ /Date registered:\s+(.*)\n/
55
+ @created_on ||= if content_for_scanner =~ /Date registered:\s+(.*)\n/
56
56
  Time.parse($1)
57
57
  end
58
58
  end
59
59
 
60
60
  property_supported :updated_on do
61
- @updated_on ||= if content.to_s =~ /Record last updated:\s+(.*)\n/
61
+ @updated_on ||= if content_for_scanner =~ /Record last updated:\s+(.*)\n/
62
62
  Time.parse($1)
63
63
  end
64
64
  end
@@ -35,7 +35,7 @@ module Whois
35
35
  class WhoisDomainregistryIe < Base
36
36
 
37
37
  property_supported :status do
38
- @status ||= if content.to_s =~ /status:\s+(.*)\n/
38
+ @status ||= if content_for_scanner =~ /status:\s+(.*)\n/
39
39
  $1.downcase.to_sym
40
40
  else
41
41
  :available
@@ -43,7 +43,7 @@ module Whois
43
43
  end
44
44
 
45
45
  property_supported :available? do
46
- @available ||= !!(content.to_s =~ /Not Registered - The domain you have requested is not a registered .ie domain name/)
46
+ @available ||= !!(content_for_scanner =~ /Not Registered - The domain you have requested is not a registered .ie domain name/)
47
47
  end
48
48
 
49
49
  property_supported :registered? do
@@ -56,7 +56,7 @@ module Whois
56
56
  property_not_supported :updated_on
57
57
 
58
58
  property_supported :expires_on do
59
- @expires_on ||= if content.to_s =~ /renewal:\s+(.*)\n/
59
+ @expires_on ||= if content_for_scanner =~ /renewal:\s+(.*)\n/
60
60
  Time.parse($1)
61
61
  end
62
62
  end
@@ -43,7 +43,7 @@ module Whois
43
43
  end
44
44
 
45
45
  property_supported :available? do
46
- @available ||= !!(content.to_s =~ /No Match/)
46
+ @available ||= !!(content_for_scanner =~ /No Match/)
47
47
  end
48
48
 
49
49
  property_supported :registered? do
@@ -52,19 +52,19 @@ module Whois
52
52
 
53
53
 
54
54
  property_supported :created_on do
55
- @created_on ||= if content.to_s =~ /Domain record activated:\s+(.*)\n/
55
+ @created_on ||= if content_for_scanner =~ /Domain record activated:\s+(.*)\n/
56
56
  Time.parse($1)
57
57
  end
58
58
  end
59
59
 
60
60
  property_supported :updated_on do
61
- @updated_on ||= if content.to_s =~ /Domain record last updated:\s+(.*)\n/
61
+ @updated_on ||= if content_for_scanner =~ /Domain record last updated:\s+(.*)\n/
62
62
  Time.parse($1)
63
63
  end
64
64
  end
65
65
 
66
66
  property_supported :expires_on do
67
- @expires_on ||= if content.to_s =~ /Domain expires:\s+(.*)\n/
67
+ @expires_on ||= if content_for_scanner =~ /Domain expires:\s+(.*)\n/
68
68
  Time.parse($1)
69
69
  end
70
70
  end
@@ -43,7 +43,7 @@ module Whois
43
43
  end
44
44
 
45
45
  property_supported :available? do
46
- @available ||= !!(content.to_s =~ /Key not found/)
46
+ @available ||= !!(content_for_scanner =~ /Key not found/)
47
47
  end
48
48
 
49
49
  property_supported :registered? do
@@ -43,7 +43,7 @@ module Whois
43
43
  end
44
44
 
45
45
  property_supported :available? do
46
- @available ||= !!(content.to_s =~ /Status:\s+AVAILABLE/)
46
+ @available ||= !!(content_for_scanner =~ /Status:\s+AVAILABLE/)
47
47
  end
48
48
 
49
49
  property_supported :registered? do
@@ -43,7 +43,7 @@ module Whois
43
43
  end
44
44
 
45
45
  property_supported :available? do
46
- @available ||= !!(content.to_s =~ /Domain (.*?) not found/)
46
+ @available ||= !!(content_for_scanner =~ /Domain (.*?) not found/)
47
47
  end
48
48
 
49
49
  property_supported :registered? do
@@ -52,13 +52,13 @@ module Whois
52
52
 
53
53
 
54
54
  property_supported :created_on do
55
- @created_on ||= if content.to_s =~ /\nRegistration Date:\s+(.*)\n/
55
+ @created_on ||= if content_for_scanner =~ /\nRegistration Date:\s+(.*)\n/
56
56
  Time.parse($1)
57
57
  end
58
58
  end
59
59
 
60
60
  property_supported :updated_on do
61
- @updated_on ||= if content.to_s =~ /\nLast Updated Date:\s+(.*)\n/
61
+ @updated_on ||= if content_for_scanner =~ /\nLast Updated Date:\s+(.*)\n/
62
62
  Time.parse($1)
63
63
  end
64
64
  end
@@ -43,7 +43,7 @@ module Whois
43
43
  end
44
44
 
45
45
  property_supported :available? do
46
- @available ||= !!(content.to_s =~ /No entries found for query/)
46
+ @available ||= !!(content_for_scanner =~ /No entries found for query/)
47
47
  end
48
48
 
49
49
  property_supported :registered? do
@@ -52,7 +52,7 @@ module Whois
52
52
 
53
53
 
54
54
  property_supported :created_on do
55
- @created_on ||= if content.to_s =~ /created:\s+(.*)\n/
55
+ @created_on ||= if content_for_scanner =~ /created:\s+(.*)\n/
56
56
  Time.parse($1)
57
57
  end
58
58
  end
@@ -60,7 +60,7 @@ module Whois
60
60
  property_not_supported :updated_on
61
61
 
62
62
  property_supported :expires_on do
63
- @expires_on ||= if content.to_s =~ /expires:\s+(.*)\n/
63
+ @expires_on ||= if content_for_scanner =~ /expires:\s+(.*)\n/
64
64
  Time.parse($1)
65
65
  end
66
66
  end
@@ -32,7 +32,7 @@ module Whois
32
32
 
33
33
  property_supported :domain do
34
34
  @domain ||= Proc.new do
35
- content.to_s =~ /Domain "(.*?)"/
35
+ content_for_scanner =~ /Domain "(.*?)"/
36
36
  $1.downcase
37
37
  end.call
38
38
  end
@@ -49,7 +49,7 @@ module Whois
49
49
  end
50
50
 
51
51
  property_supported :available? do
52
- @available ||= !(content.to_s =~ /Not available/)
52
+ @available ||= !(content_for_scanner =~ /Not available/)
53
53
  end
54
54
 
55
55
  property_supported :registered? do
@@ -82,7 +82,7 @@ module Whois
82
82
 
83
83
  property_supported :unchanged? do |other|
84
84
  self == other ||
85
- self.content.to_s == other.content.to_s
85
+ self.content_for_scanner == other.content_for_scanner
86
86
  end
87
87
 
88
88
  end
@@ -43,7 +43,7 @@ module Whois
43
43
  end
44
44
 
45
45
  property_supported :available? do
46
- @available ||= (content.to_s =~ /We do not have an entry/)
46
+ @available ||= (content_for_scanner =~ /We do not have an entry/)
47
47
  end
48
48
 
49
49
  property_supported :registered? do
@@ -35,13 +35,13 @@ module Whois
35
35
  class WhoisNicCoop < Base
36
36
 
37
37
  property_supported :status do
38
- @status ||= if content.to_s =~ /Status:\s+(.*)\r\n/
38
+ @status ||= if content_for_scanner =~ /Status:\s+(.*)\n/
39
39
  $1.downcase.to_sym
40
40
  end
41
41
  end
42
42
 
43
43
  property_supported :available? do
44
- @available ||= !!(content.to_s =~ /No domain records were found to match/)
44
+ @available ||= !!(content_for_scanner =~ /No domain records were found to match/)
45
45
  end
46
46
 
47
47
  property_supported :registered? do
@@ -50,19 +50,19 @@ module Whois
50
50
 
51
51
 
52
52
  property_supported :created_on do
53
- @created_on ||= if content.to_s =~ /Created:\s+(.*)\r\n/
53
+ @created_on ||= if content_for_scanner =~ /Created:\s+(.*)\n/
54
54
  Time.parse($1)
55
55
  end
56
56
  end
57
57
 
58
58
  property_supported :updated_on do
59
- @updated_on ||= if content.to_s =~ /Last updated:\s+(.*)\r\n/
59
+ @updated_on ||= if content_for_scanner =~ /Last updated:\s+(.*)\n/
60
60
  Time.parse($1)
61
61
  end
62
62
  end
63
63
 
64
64
  property_supported :expires_on do
65
- @expires_on ||= if content.to_s =~ /Expiry Date:\s+(.*)\r\n/
65
+ @expires_on ||= if content_for_scanner =~ /Expiry Date:\s+(.*)\n/
66
66
  Time.parse($1)
67
67
  end
68
68
  end
@@ -35,7 +35,7 @@ module Whois
35
35
  class WhoisNicFr < Base
36
36
 
37
37
  property_supported :status do
38
- @status ||= if content.to_s =~ /status:\s+(.*)\n/
38
+ @status ||= if content_for_scanner =~ /status:\s+(.*)\n/
39
39
  $1.downcase.to_sym
40
40
  else
41
41
  :available
@@ -43,7 +43,7 @@ module Whois
43
43
  end
44
44
 
45
45
  property_supported :available? do
46
- @available ||= !!(content.to_s =~ /No entries found in the AFNIC Database/)
46
+ @available ||= !!(content_for_scanner =~ /No entries found in the AFNIC Database/)
47
47
  end
48
48
 
49
49
  property_supported :registered? do
@@ -52,14 +52,14 @@ module Whois
52
52
 
53
53
 
54
54
  property_supported :created_on do
55
- @created_on ||= if content.to_s =~ /created:\s+(.*)\n/
55
+ @created_on ||= if content_for_scanner =~ /created:\s+(.*)\n/
56
56
  d, m, y = $1.split("/")
57
57
  Time.parse("#{y}-#{m}-#{d}")
58
58
  end
59
59
  end
60
60
 
61
61
  property_supported :updated_on do
62
- @updated_on ||= if content.to_s =~ /last-update:\s+(.*)\n/
62
+ @updated_on ||= if content_for_scanner =~ /last-update:\s+(.*)\n/
63
63
  d, m, y = $1.split("/")
64
64
  Time.parse("#{y}-#{m}-#{d}")
65
65
  end
@@ -35,7 +35,7 @@ module Whois
35
35
  class WhoisNicGl < Base
36
36
 
37
37
  property_supported :status do
38
- @status ||= if content.to_s =~ /Status:\s+(.*?)\n/
38
+ @status ||= if content_for_scanner =~ /Status:\s+(.*?)\n/
39
39
  case $1.downcase.to_sym
40
40
  when :"active" then :registered
41
41
  when :"not registered" then :available
@@ -53,19 +53,19 @@ module Whois
53
53
 
54
54
 
55
55
  property_supported :created_on do
56
- @created_on ||= if content.to_s =~ /Created:\s+(.*?)\n/
56
+ @created_on ||= if content_for_scanner =~ /Created:\s+(.*?)\n/
57
57
  Time.parse($1)
58
58
  end
59
59
  end
60
60
 
61
61
  property_supported :updated_on do
62
- @updated_on ||= if content.to_s =~ /Modified:\s+(.*?)\n/
62
+ @updated_on ||= if content_for_scanner =~ /Modified:\s+(.*?)\n/
63
63
  Time.parse($1)
64
64
  end
65
65
  end
66
66
 
67
67
  property_supported :expires_on do
68
- @expires_on ||= if content.to_s =~ /Expires:\s+(.*?)\n/
68
+ @expires_on ||= if content_for_scanner =~ /Expires:\s+(.*?)\n/
69
69
  Time.parse($1)
70
70
  end
71
71
  end
@@ -141,7 +141,7 @@ module Whois
141
141
  protected
142
142
 
143
143
  def parse
144
- Scanner.new(content.to_s).parse
144
+ Scanner.new(content_for_scanner).parse
145
145
  end
146
146
 
147
147
  def contact(element)
@@ -156,7 +156,7 @@ module Whois
156
156
  class Scanner
157
157
 
158
158
  def initialize(content)
159
- @input = StringScanner.new(content.to_s)
159
+ @input = StringScanner.new(content)
160
160
  end
161
161
 
162
162
  def parse
@@ -43,7 +43,7 @@ module Whois
43
43
  end
44
44
 
45
45
  property_supported :available? do
46
- @available ||= !!(content.to_s =~ /was not found/)
46
+ @available ||= !!(content_for_scanner =~ /was not found/)
47
47
  end
48
48
 
49
49
  property_supported :registered? do
@@ -56,7 +56,7 @@ module Whois
56
56
  property_not_supported :updated_on
57
57
 
58
58
  property_supported :expires_on do
59
- @expires_on ||= if content.to_s =~ /Expiry Date:\s+(.*?)\n/
59
+ @expires_on ||= if content_for_scanner =~ /Expiry Date:\s+(.*?)\n/
60
60
  Time.parse($1.gsub("/", "-"))
61
61
  end
62
62
  end
@@ -43,7 +43,7 @@ module Whois
43
43
  end
44
44
 
45
45
  property_supported :available? do
46
- @available ||= !!(content.to_s =~ /- Available/)
46
+ @available ||= !!(content_for_scanner =~ /- Available/)
47
47
  end
48
48
 
49
49
  property_supported :registered? do
@@ -158,7 +158,7 @@ module Whois
158
158
  protected
159
159
 
160
160
  def parse
161
- Scanner.new(content.to_s).parse
161
+ Scanner.new(content_for_scanner).parse
162
162
  end
163
163
 
164
164
  def contact(element)
@@ -181,7 +181,7 @@ module Whois
181
181
  class Scanner
182
182
 
183
183
  def initialize(content)
184
- @input = StringScanner.new(content.to_s)
184
+ @input = StringScanner.new(content)
185
185
  end
186
186
 
187
187
  def parse
@@ -35,7 +35,7 @@ module Whois
35
35
  class WhoisNicMu < Base
36
36
 
37
37
  property_supported :status do
38
- @status ||= if content.to_s =~ /Status:\s+(.*?)\n/
38
+ @status ||= if content_for_scanner =~ /Status:\s+(.*?)\n/
39
39
  case $1.downcase.to_sym
40
40
  when :"active" then :registered
41
41
  when :"not registered" then :available
@@ -53,19 +53,19 @@ module Whois
53
53
 
54
54
 
55
55
  property_supported :created_on do
56
- @created_on ||= if content.to_s =~ /Created:\s+(.*?)\n/
56
+ @created_on ||= if content_for_scanner =~ /Created:\s+(.*?)\n/
57
57
  Time.parse($1)
58
58
  end
59
59
  end
60
60
 
61
61
  property_supported :updated_on do
62
- @updated_on ||= if content.to_s =~ /Modified:\s+(.*?)\n/
62
+ @updated_on ||= if content_for_scanner =~ /Modified:\s+(.*?)\n/
63
63
  Time.parse($1)
64
64
  end
65
65
  end
66
66
 
67
67
  property_supported :expires_on do
68
- @expires_on ||= if content.to_s =~ /Expires:\s+(.*?)\n/
68
+ @expires_on ||= if content_for_scanner =~ /Expires:\s+(.*?)\n/
69
69
  Time.parse($1)
70
70
  end
71
71
  end
@@ -43,7 +43,7 @@ module Whois
43
43
  end
44
44
 
45
45
  property_supported :available? do
46
- @available ||= !!(content.to_s =~ /No match/)
46
+ @available ||= !!(content_for_scanner =~ /No match/)
47
47
  end
48
48
 
49
49
  property_supported :registered? do
@@ -35,13 +35,13 @@ module Whois
35
35
  class WhoisNicNu < Base
36
36
 
37
37
  property_supported :status do
38
- @status ||= if content.to_s =~ /Record status:\s+(.*)\n/
38
+ @status ||= if content_for_scanner =~ /Record status:\s+(.*)\n/
39
39
  $1.downcase.to_sym
40
40
  end
41
41
  end
42
42
 
43
43
  property_supported :available? do
44
- @available ||= !!(content.to_s =~ /NO MATCH for domain/)
44
+ @available ||= !!(content_for_scanner =~ /NO MATCH for domain/)
45
45
  end
46
46
 
47
47
  property_supported :registered? do
@@ -50,7 +50,7 @@ module Whois
50
50
 
51
51
 
52
52
  property_supported :created_on do
53
- @created_on ||= if content.to_s =~ /Record created on (.*).\n/
53
+ @created_on ||= if content_for_scanner =~ /Record created on (.*).\n/
54
54
  Time.parse($1)
55
55
  end
56
56
  end
@@ -58,13 +58,13 @@ module Whois
58
58
  property_not_supported :updated_on
59
59
 
60
60
  property_supported :expires_on do
61
- @expires_on ||= if content.to_s =~ /Record expires on (.*).\n/
61
+ @expires_on ||= if content_for_scanner =~ /Record expires on (.*).\n/
62
62
  Time.parse($1)
63
63
  end
64
64
  end
65
65
 
66
66
  property_supported :updated_on do
67
- @updated_on ||= if content.to_s =~ /Record last updated on (.*?).\n/
67
+ @updated_on ||= if content_for_scanner =~ /Record last updated on (.*?).\n/
68
68
  Time.parse($1)
69
69
  end
70
70
  end
@@ -43,7 +43,7 @@ module Whois
43
43
  end
44
44
 
45
45
  property_supported :available? do
46
- @available ||= !!(content.to_s =~ /Not found:/)
46
+ @available ||= !!(content_for_scanner =~ /Not found:/)
47
47
  end
48
48
 
49
49
  property_supported :registered? do
@@ -52,19 +52,19 @@ module Whois
52
52
 
53
53
 
54
54
  property_supported :created_on do
55
- @created_on ||= if content.to_s =~ /Domain Registration Date:\s+(.*)\n/
55
+ @created_on ||= if content_for_scanner =~ /Domain Registration Date:\s+(.*)\n/
56
56
  Time.parse($1)
57
57
  end
58
58
  end
59
59
 
60
60
  property_supported :updated_on do
61
- @updated_on ||= if content.to_s =~ /Domain Last Updated Date:\s+(.*)\n/
61
+ @updated_on ||= if content_for_scanner =~ /Domain Last Updated Date:\s+(.*)\n/
62
62
  Time.parse($1)
63
63
  end
64
64
  end
65
65
 
66
66
  property_supported :expires_on do
67
- @expires_on ||= if content.to_s =~ /Domain Expiration Date:\s+(.*)\n/
67
+ @expires_on ||= if content_for_scanner =~ /Domain Expiration Date:\s+(.*)\n/
68
68
  Time.parse($1)
69
69
  end
70
70
  end
@@ -43,7 +43,7 @@ module Whois
43
43
  end
44
44
 
45
45
  property_supported :available? do
46
- @available ||= !!(content.to_s =~ /Status: Not Registered/)
46
+ @available ||= !!(content_for_scanner =~ /Status: Not Registered/)
47
47
  end
48
48
 
49
49
  property_supported :registered? do
@@ -52,19 +52,19 @@ module Whois
52
52
 
53
53
 
54
54
  property_supported :created_on do
55
- @created_on ||= if content.to_s =~ /Created:\s+(.*)\n/
55
+ @created_on ||= if content_for_scanner =~ /Created:\s+(.*)\n/
56
56
  Time.parse($1)
57
57
  end
58
58
  end
59
59
 
60
60
  property_supported :updated_on do
61
- @updated_on ||= if content.to_s =~ /Modified:\s+(.*)\n/
61
+ @updated_on ||= if content_for_scanner =~ /Modified:\s+(.*)\n/
62
62
  Time.parse($1)
63
63
  end
64
64
  end
65
65
 
66
66
  property_supported :expires_on do
67
- @expires_on ||= if content.to_s =~ /Expires:\s+(.*)\n/
67
+ @expires_on ||= if content_for_scanner =~ /Expires:\s+(.*)\n/
68
68
  Time.parse($1)
69
69
  end
70
70
  end
@@ -35,11 +35,11 @@ module Whois
35
35
  class WhoisNicTravel < Base
36
36
 
37
37
  property_supported :status do
38
- @status ||= content.to_s.scan(/Domain Status:\s+(.*?)\n/).flatten
38
+ @status ||= content_for_scanner.scan(/Domain Status:\s+(.*?)\n/).flatten
39
39
  end
40
40
 
41
41
  property_supported :available? do
42
- @available ||= !!(content.to_s =~ /Not found:/)
42
+ @available ||= !!(content_for_scanner =~ /Not found:/)
43
43
  end
44
44
 
45
45
  property_supported :registered? do
@@ -48,19 +48,19 @@ module Whois
48
48
 
49
49
 
50
50
  property_supported :created_on do
51
- @created_on ||= if content.to_s =~ /Domain Registration Date:\s+(.*)\n/
51
+ @created_on ||= if content_for_scanner =~ /Domain Registration Date:\s+(.*)\n/
52
52
  Time.parse($1)
53
53
  end
54
54
  end
55
55
 
56
56
  property_supported :updated_on do
57
- @updated_on ||= if content.to_s =~ /Domain Last Updated Date:\s+(.*)\n/
57
+ @updated_on ||= if content_for_scanner =~ /Domain Last Updated Date:\s+(.*)\n/
58
58
  Time.parse($1)
59
59
  end
60
60
  end
61
61
 
62
62
  property_supported :expires_on do
63
- @expires_on ||= if content.to_s =~ /Domain Expiration Date:\s+(.*)\n/
63
+ @expires_on ||= if content_for_scanner =~ /Domain Expiration Date:\s+(.*)\n/
64
64
  Time.parse($1)
65
65
  end
66
66
  end
@@ -92,7 +92,7 @@ module Whois
92
92
  protected
93
93
 
94
94
  def parse
95
- Scanners::VerisignScanner.new(content.to_s).parse
95
+ Scanners::VerisignScanner.new(content_for_scanner).parse
96
96
  end
97
97
 
98
98
  end
@@ -35,13 +35,13 @@ module Whois
35
35
  class WhoisNicUk < Base
36
36
 
37
37
  property_supported :status do
38
- @status ||= if content.to_s =~ /\s+Registration status:\s+\n(.*?)\n/
38
+ @status ||= if content_for_scanner =~ /\s+Registration status:\s+(.*?)\n/
39
39
  $1.strip
40
40
  end
41
41
  end
42
42
 
43
43
  property_supported :available? do
44
- @available ||= !!(content.to_s =~ /This domain name has not been registered/)
44
+ @available ||= !!(content_for_scanner =~ /This domain name has not been registered/)
45
45
  end
46
46
 
47
47
  property_supported :registered? do
@@ -53,24 +53,24 @@ module Whois
53
53
  end
54
54
 
55
55
  def invalid?
56
- @invalid ||= !!(content.to_s =~ /This domain cannot be registered/)
56
+ @invalid ||= !!(content_for_scanner =~ /This domain cannot be registered/)
57
57
  end
58
58
 
59
59
 
60
60
  property_supported :created_on do
61
- @created_on ||= if content.to_s =~ /\s+Registered on:\s+(.*)\n/
61
+ @created_on ||= if content_for_scanner =~ /\s+Registered on:\s+(.*)\n/
62
62
  Time.parse($1)
63
63
  end
64
64
  end
65
65
 
66
66
  property_supported :updated_on do
67
- @updated_on ||= if content.to_s =~ /\s+Last updated:\s+(.*)\n/
67
+ @updated_on ||= if content_for_scanner =~ /\s+Last updated:\s+(.*)\n/
68
68
  Time.parse($1)
69
69
  end
70
70
  end
71
71
 
72
72
  property_supported :expires_on do
73
- @expires_on ||= if content.to_s =~ /\s+Renewal date:\s+(.*)\n/
73
+ @expires_on ||= if content_for_scanner =~ /\s+Renewal date:\s+(.*)\n/
74
74
  Time.parse($1)
75
75
  end
76
76
  end
@@ -35,11 +35,11 @@ module Whois
35
35
  class WhoisNicUs < Base
36
36
 
37
37
  property_supported :status do
38
- @status ||= content.to_s.scan(/Domain Status:\s+(.*?)\n/).flatten
38
+ @status ||= content_for_scanner.scan(/Domain Status:\s+(.*?)\n/).flatten
39
39
  end
40
40
 
41
41
  property_supported :available? do
42
- @available ||= !!(content.to_s =~ /Not found:/)
42
+ @available ||= !!(content_for_scanner =~ /Not found:/)
43
43
  end
44
44
 
45
45
  property_supported :registered? do
@@ -48,19 +48,19 @@ module Whois
48
48
 
49
49
 
50
50
  property_supported :created_on do
51
- @created_on ||= if content.to_s =~ /Domain Registration Date:\s+(.*)\n/
51
+ @created_on ||= if content_for_scanner =~ /Domain Registration Date:\s+(.*)\n/
52
52
  Time.parse($1)
53
53
  end
54
54
  end
55
55
 
56
56
  property_supported :updated_on do
57
- @updated_on ||= if content.to_s =~ /Domain Last Updated Date:\s+(.*)\n/
57
+ @updated_on ||= if content_for_scanner =~ /Domain Last Updated Date:\s+(.*)\n/
58
58
  Time.parse($1)
59
59
  end
60
60
  end
61
61
 
62
62
  property_supported :expires_on do
63
- @expires_on ||= if content.to_s =~ /Domain Expiration Date:\s+(.*)\n/
63
+ @expires_on ||= if content_for_scanner =~ /Domain Expiration Date:\s+(.*)\n/
64
64
  Time.parse($1)
65
65
  end
66
66
  end
@@ -43,7 +43,7 @@ module Whois
43
43
  end
44
44
 
45
45
  property_supported :available? do
46
- @available ||= !!(content.to_s =~ /% no matches/)
46
+ @available ||= !!(content_for_scanner =~ /% no matches/)
47
47
  end
48
48
 
49
49
  property_supported :registered? do
@@ -52,13 +52,13 @@ module Whois
52
52
 
53
53
 
54
54
  property_supported :created_on do
55
- @created_on ||= if content.to_s =~ /Created:\s+(.*)\n/
55
+ @created_on ||= if content_for_scanner =~ /Created:\s+(.*)\n/
56
56
  Time.parse($1)
57
57
  end
58
58
  end
59
59
 
60
60
  property_supported :updated_on do
61
- @updated_on ||= if content.to_s =~ /Last updated:\s+(.*)\n/
61
+ @updated_on ||= if content_for_scanner =~ /Last updated:\s+(.*)\n/
62
62
  Time.parse($1)
63
63
  end
64
64
  end
@@ -35,13 +35,13 @@ module Whois
35
35
  class WhoisRegisterBg < Base
36
36
 
37
37
  property_supported :status do
38
- @status ||= if content.to_s =~ /registration status:\s+(.*?)\n/
38
+ @status ||= if content_for_scanner =~ /registration status:\s+(.*?)\n/
39
39
  $1.downcase.to_sym
40
40
  end
41
41
  end
42
42
 
43
43
  property_supported :available? do
44
- @available ||= (content.to_s =~ /Domain name (.+?) does not exist/)
44
+ @available ||= (content_for_scanner =~ /Domain name (.+?) does not exist/)
45
45
  end
46
46
 
47
47
  property_supported :registered? do
@@ -50,7 +50,7 @@ module Whois
50
50
 
51
51
 
52
52
  property_supported :created_on do
53
- @created_on ||= if content.to_s =~ /activated on:\s+(.*?)\n/
53
+ @created_on ||= if content_for_scanner =~ /activated on:\s+(.*?)\n/
54
54
  # Time.parse("30/06/2003 00:00:00")
55
55
  # => ArgumentError: argument out of range
56
56
  Time.parse($1.gsub("/", "-"))
@@ -60,7 +60,7 @@ module Whois
60
60
  property_not_supported :updated_on
61
61
 
62
62
  property_supported :expires_on do
63
- @expires_on ||= if content.to_s =~ /expires at:\s+(.*?)\n/
63
+ @expires_on ||= if content_for_scanner =~ /expires at:\s+(.*?)\n/
64
64
  # Time.parse("30/06/2003 00:00:00")
65
65
  # => ArgumentError: argument out of range
66
66
  Time.parse($1.gsub("/", "-"))
@@ -43,7 +43,7 @@ module Whois
43
43
  end
44
44
 
45
45
  property_supported :available? do
46
- @available ||= !!(content.to_s =~ /No match for domain/)
46
+ @available ||= !!(content_for_scanner =~ /No match for domain/)
47
47
  end
48
48
 
49
49
  property_supported :registered? do
@@ -43,7 +43,7 @@ module Whois
43
43
  end
44
44
 
45
45
  property_supported :available? do
46
- @available ||= !!(content.to_s =~ /no entries found/)
46
+ @available ||= !!(content_for_scanner =~ /no entries found/)
47
47
  end
48
48
 
49
49
  property_supported :registered? do
@@ -35,7 +35,7 @@ module Whois
35
35
  class WhoisRipnNet < Base
36
36
 
37
37
  property_supported :status do
38
- @status ||= if content.to_s =~ /state:\s+(.*?)\n/
38
+ @status ||= if content_for_scanner =~ /state:\s+(.*?)\n/
39
39
  $1.split(",").map { |status| status.strip }
40
40
  else
41
41
  []
@@ -43,7 +43,7 @@ module Whois
43
43
  end
44
44
 
45
45
  property_supported :available? do
46
- @available ||= !!(content.to_s =~ /No entries found/)
46
+ @available ||= !!(content_for_scanner =~ /No entries found/)
47
47
  end
48
48
 
49
49
  property_supported :registered? do
@@ -52,7 +52,7 @@ module Whois
52
52
 
53
53
 
54
54
  property_supported :created_on do
55
- @created_on ||= if content.to_s =~ /created:\s+(.*)\n/
55
+ @created_on ||= if content_for_scanner =~ /created:\s+(.*)\n/
56
56
  Time.parse($1)
57
57
  end
58
58
  end
@@ -60,7 +60,7 @@ module Whois
60
60
  property_not_supported :updated_on
61
61
 
62
62
  property_supported :expires_on do
63
- @expires_on ||= if content.to_s =~ /paid-till:\s+(.*)\n/
63
+ @expires_on ||= if content_for_scanner =~ /paid-till:\s+(.*)\n/
64
64
  Time.parse($1)
65
65
  end
66
66
  end
@@ -43,7 +43,7 @@ module Whois
43
43
  end
44
44
 
45
45
  property_supported :available? do
46
- @available ||= !!(content.to_s =~ /No entries found/)
46
+ @available ||= !!(content_for_scanner =~ /No entries found/)
47
47
  end
48
48
 
49
49
  property_supported :registered? do
@@ -43,7 +43,7 @@ module Whois
43
43
  end
44
44
 
45
45
  property_supported :available? do
46
- @available ||= !!(content.to_s =~ /No match for/)
46
+ @available ||= !!(content_for_scanner =~ /No match for/)
47
47
  end
48
48
 
49
49
  property_supported :registered? do
@@ -52,19 +52,19 @@ module Whois
52
52
 
53
53
 
54
54
  property_supported :created_on do
55
- @created_on ||= if content.to_s =~ /\s+Domain Created:\s+(.*)\n/
55
+ @created_on ||= if content_for_scanner =~ /\s+Domain Created:\s+(.*)\n/
56
56
  Time.parse($1)
57
57
  end
58
58
  end
59
59
 
60
60
  property_supported :updated_on do
61
- @updated_on ||= if content.to_s =~ /\s+Domain Last Updated:\s+(.*)\n/
61
+ @updated_on ||= if content_for_scanner =~ /\s+Domain Last Updated:\s+(.*)\n/
62
62
  Time.parse($1)
63
63
  end
64
64
  end
65
65
 
66
66
  property_supported :expires_on do
67
- @expires_on ||= if content.to_s =~ /\s+Domain Currently Expires:\s+(.*)\n/
67
+ @expires_on ||= if content_for_scanner =~ /\s+Domain Currently Expires:\s+(.*)\n/
68
68
  Time.parse($1)
69
69
  end
70
70
  end
@@ -43,7 +43,7 @@ module Whois
43
43
  end
44
44
 
45
45
  property_supported :available? do
46
- @available ||= !!(content.to_s =~ /No such domain:/)
46
+ @available ||= !!(content_for_scanner =~ /No such domain:/)
47
47
  end
48
48
 
49
49
  property_supported :registered? do
@@ -52,13 +52,13 @@ module Whois
52
52
 
53
53
 
54
54
  property_supported :created_on do
55
- @created_on ||= if content.to_s =~ /Record Created\s+:\s+(.*)\n/
55
+ @created_on ||= if content_for_scanner =~ /Record Created\s+:\s+(.*)\n/
56
56
  Time.parse($1)
57
57
  end
58
58
  end
59
59
 
60
60
  property_supported :updated_on do
61
- @updated_on ||= if content.to_s =~ /Record Last Updated\s+:\s+(.*)\n/
61
+ @updated_on ||= if content_for_scanner =~ /Record Last Updated\s+:\s+(.*)\n/
62
62
  Time.parse($1)
63
63
  end
64
64
  end
data/lib/whois/version.rb CHANGED
@@ -19,7 +19,7 @@ module Whois
19
19
  module Version
20
20
  MAJOR = 1
21
21
  MINOR = 0
22
- TINY = 1
22
+ TINY = 2
23
23
  ALPHA = nil
24
24
 
25
25
  STRING = [MAJOR, MINOR, TINY, ALPHA].compact.join('.')
data/whois.gemspec CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{whois}
5
- s.version = "1.0.1"
5
+ s.version = "1.0.2"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Simone Carletti"]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: whois
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Simone Carletti