Sha256: b80646ca2530e72886fb9f3bff5c56bfefb9fe350adeb60bea0a8b40f2fee6ee

Contents?: true

Size: 880 Bytes

Versions: 9

Compression:

Stored size: 880 Bytes

Contents

require_relative 'base'

module Whois
  module Scanners

    # Scanner for Whoisd-based records.
    class BaseWhoisd < Base

      self.tokenizers += [
          :scan_available,
          :skip_comment,
          :scan_section,
          :scan_keyvalue,
          :skip_empty_line,
      ]


      tokenizer :scan_available do
        if @input.skip(/^%ERROR:101: no entries found/)
          @ast['status:available'] = true
        end
      end

      tokenizer :scan_section do
        if @input.scan(/\n(contact|nsset|keyset):\s+(.+)\n/)
          @tmp["_section"] = "node:#{@input[1]}/#{@input[2].strip}"
          while scan_keyvalue
          end
          @tmp.delete("_section")
        end
      end

      tokenizer :todo_content do
        @input.scan(/(.*)\n/)
      end

      tokenizer :skip_comment do
        @input.skip(/^%.*\n/)
      end

    end

  end
end

Version data entries

9 entries across 9 versions & 2 rubygems

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