Sha256: 9fd437dee676d9f53e8caec378aca593b19a86fbb4a6fef24eeefb6ac71a1064

Contents?: true

Size: 736 Bytes

Versions: 9

Compression:

Stored size: 736 Bytes

Contents

require_relative 'base'

module Whois
  module Scanners

    class BaseShared3 < Base

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


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

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

      tokenizer :scan_disclaimer do
        if @input.pos == 0 && @input.match?(/^;.*/)
          @ast["field:disclaimer"] = _scan_lines_to_array(/^;(.*)\n/).join(" ")
          @ast["field:disclaimer"].gsub!("  ", "\n")
        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/base_shared3.rb
whois-parser-1.2.0 lib/whois/scanners/base_shared3.rb
whois-parser-1.1.0 lib/whois/scanners/base_shared3.rb
whois-parser-1.0.1 lib/whois/scanners/base_shared3.rb
hetzner-whois-parser-1.0.1.rc2 lib/whois/scanners/base_shared3.rb
hetzner-whois-parser-1.0.1.rc1 lib/whois/scanners/base_shared3.rb
whois-parser-1.0.0 lib/whois/scanners/base_shared3.rb
whois-parser-1.0.0.pre.beta2 lib/whois/scanners/base_shared3.rb
whois-parser-1.0.0.pre.beta1 lib/whois/scanners/base_shared3.rb