Sha256: ee15c181b6915ef31bdd2233c09f48c5430518b2a6b9c831b1e19cf24b2e3379

Contents?: true

Size: 1.06 KB

Versions: 6

Compression:

Stored size: 1.06 KB

Contents

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


require 'whois/record/scanners/base'


module Whois
  class Record
    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
        ]

        tokenizer :scan_disclaimer do
          if @input.match?(/^#{DISCLAIMER_MATCHES.join("|")}/)
            @ast["field:disclaimer"] = @input.scan_until(/>>>/)
          end
        end

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

        tokenizer :skip_token_additionalsection do
          @input.skip(/Additional Section\n/)
        end

      end

    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
whois-3.5.3 lib/whois/record/scanners/base_cocca2.rb
whois-3.5.2 lib/whois/record/scanners/base_cocca2.rb
whois-3.5.1 lib/whois/record/scanners/base_cocca2.rb
whois-3.5.0 lib/whois/record/scanners/base_cocca2.rb
whois-3.4.5 lib/whois/record/scanners/base_cocca2.rb
whois-3.4.4 lib/whois/record/scanners/base_cocca2.rb