Sha256: bb2f6c79a5c1558b334e8a70d352f7661ea33cd6306f4dda4c59db53d3476283

Contents?: true

Size: 1.37 KB

Versions: 8

Compression:

Stored size: 1.37 KB

Contents

#--
# Ruby Whois
#
# An intelligent pure Ruby WHOIS client and parser.
#
# Copyright (c) 2009-2013 Simone Carletti <weppos@weppos.net>
#++


require 'whois/record/scanners/base'


module Whois
  class Record
    module Scanners

      # Scanner for the whois.domainregistry.ie server.
      #
      # @since  2.5.0
      class WhoisDomainregistryIe < Base

        self.tokenizers += [
            :skip_empty_line,
            :scan_disclaimer,
            :scan_contact,
            :scan_keyvalue,
            :scan_available,
            :skip_application_pending,
        ]

        tokenizer :scan_available do
          if @input.skip(/^% Not Registered - .+\n/)
            @ast["status:available"] = true
          end
        end

        tokenizer :scan_disclaimer do
          if @input.match?(/^% Rights restricted by copyright/)
            @ast["field:disclaimer"] = _scan_lines_to_array(/^%(.+)\n/).join("\n")
          end
        end

        tokenizer :scan_contact do
          if @input.match?(/^person:/)
            lines = _scan_lines_to_hash(/(.+?):(.*?)\n/)
            @ast["field:#{lines['nic-hdl']}"] = lines
          end
        end

        tokenizer :skip_application_pending do
          if @input.match?(/^% Application Pending/)
            _scan_lines_to_array(/^%(.+)\n/)
            @ast["status:pending"] = true
          end
        end

      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
whois-3.3.0 lib/whois/record/scanners/whois.domainregistry.ie.rb
whois-3.2.1 lib/whois/record/scanners/whois.domainregistry.ie.rb
whois-3.2.0 lib/whois/record/scanners/whois.domainregistry.ie.rb
whois-3.1.3 lib/whois/record/scanners/whois.domainregistry.ie.rb
whois-3.1.2 lib/whois/record/scanners/whois.domainregistry.ie.rb
whois-3.1.1 lib/whois/record/scanners/whois.domainregistry.ie.rb
whois-3.1.0 lib/whois/record/scanners/whois.domainregistry.ie.rb
whois-3.0.0 lib/whois/record/scanners/whois.domainregistry.ie.rb