Sha256: 5106a8252040930f88aa9e39af9a4ae488620c955d8fe2e10568e16c1adc81b7

Contents?: true

Size: 892 Bytes

Versions: 8

Compression:

Stored size: 892 Bytes

Contents

#
# = Ruby Whois
#
# An intelligent pure Ruby WHOIS client and parser.
#
#
# Category::    Net
# Package::     Whois
# Author::      Simone Carletti <weppos@weppos.net>
# License::     MIT License
#
#--
#
#++


module Whois
  class Server
    module Adapters

      class Afilias < Base

        def request(qstring)
          response = ask_the_socket(qstring, "whois.afilias-grs.info", DEFAULT_WHOIS_PORT)
          append_to_buffer response, "whois.afilias-grs.info"

          if endpoint = extract_referral(response)
            response = ask_the_socket(qstring, endpoint, DEFAULT_WHOIS_PORT)
            append_to_buffer response, endpoint
          end
        end

        private

          def extract_referral(response)
            if response =~ /Domain Name:/ && response =~ /Whois Server:(\S+)/
              $1
            end
          end

      end
      
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
whois-1.0.5 lib/whois/server/adapters/afilias.rb
whois-1.0.4 lib/whois/server/adapters/afilias.rb
whois-1.0.3 lib/whois/server/adapters/afilias.rb
whois-1.0.2 lib/whois/server/adapters/afilias.rb
whois-1.0.1 lib/whois/server/adapters/afilias.rb
whois-1.0.0 lib/whois/server/adapters/afilias.rb
whois-0.9.0 lib/whois/server/adapters/afilias.rb
whois-0.8.1 lib/whois/server/adapters/afilias.rb