Sha256: 7379e8fceeea8b2518d27e1c663a282579919276cf1029c943f5f4f44b95548c

Contents?: true

Size: 1.09 KB

Versions: 15

Compression:

Stored size: 1.09 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

      # 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
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
whois-3.6.2 lib/whois/record/scanners/base_whoisd.rb
whois-3.6.1 lib/whois/record/scanners/base_whoisd.rb
whois-3.6.0 lib/whois/record/scanners/base_whoisd.rb
whois-3.5.9 lib/whois/record/scanners/base_whoisd.rb
whois-3.5.8 lib/whois/record/scanners/base_whoisd.rb
whois-3.5.7 lib/whois/record/scanners/base_whoisd.rb
whois-3.5.6 lib/whois/record/scanners/base_whoisd.rb
whois-3.5.5 lib/whois/record/scanners/base_whoisd.rb
whois-3.5.4 lib/whois/record/scanners/base_whoisd.rb
whois-3.5.3 lib/whois/record/scanners/base_whoisd.rb
whois-3.5.2 lib/whois/record/scanners/base_whoisd.rb
whois-3.5.1 lib/whois/record/scanners/base_whoisd.rb
whois-3.5.0 lib/whois/record/scanners/base_whoisd.rb
whois-3.4.5 lib/whois/record/scanners/base_whoisd.rb
whois-3.4.4 lib/whois/record/scanners/base_whoisd.rb