Sha256: 0e9151d8388559d8e71f7605b6f357a35438a742aec20588683246c05453db96

Contents?: true

Size: 1.03 KB

Versions: 9

Compression:

Stored size: 1.03 KB

Contents

require_relative 'base'

module Whois
  module Scanners

    class BaseCocca2 < Base

      self.tokenizers += [
          :skip_empty_line,
          :scan_disclaimer,
          :skip_lastupdate,
          :skip_token_additionalsection,
          :scan_keyvalue,
      ]


      DISCLAIMER_MATCHES = [
        "TERMS OF USE:", # global
        "Terminos de Uso:", # whois.nic.hn
        "The data in the WHOIS database of Meridian", # whois.meridiantld.net
        "This information is provided", # whois.gg
      ]

      tokenizer :scan_disclaimer do
        if @input.match?(/^#{DISCLAIMER_MATCHES.join("|")}/)
          @ast["field:disclaimer"] = @input.scan_until(/>>>/) ||
                                     # special handler for whois.nic.cx exception
                                     @input.scan_until(/\Z/)
        end
      end

      tokenizer :skip_lastupdate do
        @input.skip(/>>>(.+?)<<<\n/)
      end

      tokenizer :skip_token_additionalsection do
        @input.skip(/Additional Section\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_cocca2.rb
whois-parser-1.2.0 lib/whois/scanners/base_cocca2.rb
whois-parser-1.1.0 lib/whois/scanners/base_cocca2.rb
whois-parser-1.0.1 lib/whois/scanners/base_cocca2.rb
hetzner-whois-parser-1.0.1.rc2 lib/whois/scanners/base_cocca2.rb
hetzner-whois-parser-1.0.1.rc1 lib/whois/scanners/base_cocca2.rb
whois-parser-1.0.0 lib/whois/scanners/base_cocca2.rb
whois-parser-1.0.0.pre.beta2 lib/whois/scanners/base_cocca2.rb
whois-parser-1.0.0.pre.beta1 lib/whois/scanners/base_cocca2.rb