Sha256: d92c460f549250e968158e987f73b64ea344c977d85ed2767375ce7a3642b843

Contents?: true

Size: 1.1 KB

Versions: 9

Compression:

Stored size: 1.1 KB

Contents

require_relative 'base'

module Whois
  module Scanners

    # Scanner for the whois.domainregistry.ie server.
    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

Version data entries

9 entries across 9 versions & 2 rubygems

Version Path
whois-parser-2.0.0 lib/whois/scanners/whois.domainregistry.ie.rb
whois-parser-1.2.0 lib/whois/scanners/whois.domainregistry.ie.rb
whois-parser-1.1.0 lib/whois/scanners/whois.domainregistry.ie.rb
whois-parser-1.0.1 lib/whois/scanners/whois.domainregistry.ie.rb
hetzner-whois-parser-1.0.1.rc2 lib/whois/scanners/whois.domainregistry.ie.rb
hetzner-whois-parser-1.0.1.rc1 lib/whois/scanners/whois.domainregistry.ie.rb
whois-parser-1.0.0 lib/whois/scanners/whois.domainregistry.ie.rb
whois-parser-1.0.0.pre.beta2 lib/whois/scanners/whois.domainregistry.ie.rb
whois-parser-1.0.0.pre.beta1 lib/whois/scanners/whois.domainregistry.ie.rb