lib/whois/record/parser/whois.nic.cz.rb in whois-2.6.3 vs lib/whois/record/parser/whois.nic.cz.rb in whois-2.6.4

- old
+ new

@@ -5,85 +5,23 @@ # # Copyright (c) 2009-2012 Simone Carletti <weppos@weppos.net> #++ -require 'whois/record/parser/base' +require 'whois/record/parser/base_whoisd' module Whois class Record class Parser - # - # = whois.nic.cz parser - # # Parser for the whois.nic.cz server. + # + # @see Whois::Record::Parser::Example + # The Example parser for the list of all available methods. # - # NOTE: This parser is just a stub and provides only a few basic methods - # to check for domain availability and get domain status. - # Please consider to contribute implementing missing methods. - # See WhoisNicIt parser for an explanation of all available methods - # and examples. - # - class WhoisNicCz < Base - - property_supported :status do - if content_for_scanner =~ /status:\s+(.+)\n/ - case $1.downcase - when "paid and in zone", "update prohibited" - :registered - # NEWSTATUS - when "expired" - :expired - else - Whois.bug!(ParserError, "Unknown status `#{$1}'.") - end - else - :available - end - end - - property_supported :available? do - !!(content_for_scanner =~ /^%ERROR:101: no entries found/) - end - - property_supported :registered? do - !available? - end - - - property_supported :created_on do - if content_for_scanner =~ /registered:\s+(.+?)\n/ - Time.parse($1) - end - end - - property_supported :updated_on do - if content_for_scanner =~ /changed:\s+(.+?)\n/ - Time.parse($1) - end - end - - property_supported :expires_on do - if content_for_scanner =~ /expire:\s+(.+?)\n/ - Time.parse($1) - end - end - - - property_supported :nameservers do - content_for_scanner.scan(/nserver:\s+(.+)\n/).flatten.map do |line| - if line =~ /(.+) \((.+)\)/ - name = $1 - ipv4, ipv6 = $2.split(", ") - Record::Nameserver.new(:name => name, :ipv4 => ipv4, :ipv6 => ipv6) - else - Record::Nameserver.new(:name => line.strip) - end - end - end - + class WhoisNicCz < BaseWhoisd + self.status_mapping.merge!('update prohibited' => :registered) end end end end