Skip to content
Browse files

Cleanup code, remove outdated docs

  • Loading branch information...
1 parent 1382187 commit fa7eafa8fd3329fa4cdfa4c73cc76a9c18c9e2d0 @weppos committed Nov 12, 2012
Showing with 17 additions and 30 deletions.
  1. +7 −12 lib/whois/server/adapters/afilias.rb
  2. +10 −18 lib/whois/server/adapters/verisign.rb
View
19 lib/whois/server/adapters/afilias.rb
@@ -16,11 +16,6 @@ module Adapters
#
# Provides ability to query Afilias WHOIS interfaces.
#
- # The following WHOIS servers are currently known
- # to require the Afilias adapter:
- #
- # - whois.afilias-grs.info
- #
class Afilias < Base
# Executes a WHOIS query to the Afilias WHOIS interface,
@@ -34,20 +29,20 @@ def request(string)
response = query_the_socket(string, host)
buffer_append response, host
- if endpoint = extract_referral(response)
- response = query_the_socket(string, endpoint)
- buffer_append response, endpoint
+ if referral = extract_referral(response)
+ response = query_the_socket(string, referral)
+ buffer_append(response, referral)
end
end
private
- def extract_referral(response)
- if response =~ /Domain Name:/ && response =~ /Whois Server:(\S+)/
- $1
- end
+ def extract_referral(response)
+ if response =~ /Domain Name:/
+ response.slice(/Whois Server:(\S+)/, 1)
end
+ end
end
View
28 lib/whois/server/adapters/verisign.rb
@@ -16,14 +16,6 @@ module Adapters
#
# Provides ability to query Verisign WHOIS interfaces.
#
- # The following WHOIS servers are currently known
- # to require the Verisign adapter:
- #
- # - whois.nic.tv
- # - whois.crsnic.net
- # - jobswhois.verisign-grs.com
- # - whois.nic.cc
- #
class Verisign < Base
# Executes a WHOIS query to the Verisign WHOIS interface,
@@ -37,23 +29,23 @@ def request(string)
response = query_the_socket("=#{string}", host)
buffer_append response, host
- if endpoint = extract_referral(response)
- response = query_the_socket(string, endpoint)
- buffer_append response, endpoint
+ if referral = extract_referral(response)
+ response = query_the_socket(string, referral)
+ buffer_append(response, referral)
end
end
private
- def extract_referral(response)
- if response =~ /Domain Name:/
- endpoint = response.scan(/Whois Server: (.+?)$/).flatten.last
- endpoint.strip! if endpoint != nil
- endpoint = nil if endpoint == "not defined"
- endpoint
- end
+ def extract_referral(response)
+ if response =~ /Domain Name:/
+ server = response.scan(/Whois Server: (.+?)$/).flatten.last
+ server.strip! if server != nil
+ server = nil if server == "not defined"
+ server
end
+ end
end

0 comments on commit fa7eafa

Please sign in to comment.
Something went wrong with that request. Please try again.