lib/whois/domain/verisign_grs.rb in jm81-whois-0.6.0 vs lib/whois/domain/verisign_grs.rb in jm81-whois-0.7.0

- old
+ new

@@ -1,10 +1,10 @@ class Whois::Domain::VerisignGrs < Whois::Domain::Base HOST = "whois.verisign-grs.com" ATTR_MATCH = /^ ([^:]+):\W*(.*)$/ - responds_to :com, :net, :jobs, :tv - + responds_to :com, :net + def initialize(name) @name = name @host = nil query @@ -17,35 +17,43 @@ old_raw = @raw query @raw = old_raw if (@raw =~ /not available/) end end - + def host return @host unless @host.nil? case @name.match(/.*\.([^\.]+)$/)[1] when 'jobs' then "jobswhois.verisign-grs.com" when 'tv' then "tvwhois.verisign-grs.com" else "whois.verisign-grs.com" end end + def query_string + if host == "whois.verisign-grs.com" + "domain #{@name.upcase}\n" + else + "#{@name.upcase}\n" + end + end + DATABASE_UPDATED_AT_REGEXES = [ - /Last update of whois database: ([^<]*)/, - /Record last updated on ([^\.]*)/ + /Last update of whois database: ([^<]*)/i, + /Record last updated on ([^\.]*)/i ] - + def database_updated_at DATABASE_UPDATED_AT_REGEXES.each do |regex| if (match_data = @raw.match(regex)) return Time.parse(match_data[1]) end end - + return nil end - + def available? @raw =~ /^No match for/ end def registrant_id