Sha256: 7d7964c4b4e16e07a608f3abe2449fb829508e73d4506fbf7feb9c40e9665738

Contents?: true

Size: 989 Bytes

Versions: 13

Compression:

Stored size: 989 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 Verisign < Base

        def request(qstring)
          response = ask_the_socket("=#{qstring}", host, DEFAULT_WHOIS_PORT)
          append_to_buffer response, host

          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:/
              endpoint = response.scan(/Whois Server: (.+?)$/).flatten.last
              endpoint.strip!
              endpoint = nil  if endpoint == "not defined"
              endpoint
            end
          end

      end

    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
whois-1.6.6 lib/whois/server/adapters/verisign.rb
whois-1.6.5 lib/whois/server/adapters/verisign.rb
whois-1.6.4 lib/whois/server/adapters/verisign.rb
whois-1.6.3 lib/whois/server/adapters/verisign.rb
whois-1.6.2 lib/whois/server/adapters/verisign.rb
whois-1.6.1 lib/whois/server/adapters/verisign.rb
whois-1.6.0 lib/whois/server/adapters/verisign.rb
whois-1.5.1 lib/whois/server/adapters/verisign.rb
whois-1.5.0 lib/whois/server/adapters/verisign.rb
whois-1.3.11 lib/whois/server/adapters/verisign.rb
whois-1.3.10 lib/whois/server/adapters/verisign.rb
whois-1.3.9 lib/whois/server/adapters/verisign.rb
whois-1.3.8 lib/whois/server/adapters/verisign.rb