Sha256: 82d6884460bbbe4944e13d3d7d460a4b98000b5d6d85605b677584b3d26192b3

Contents?: true

Size: 962 Bytes

Versions: 15

Compression:

Stored size: 962 Bytes

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

Version data entries

15 entries across 15 versions & 1 rubygems

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