Sha256: ffbfdd8ccdcad3494c70ae11af3bcf901c98e460299a13605b6ecfceee727d58

Contents?: true

Size: 967 Bytes

Versions: 8

Compression:

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

      # Scanner for the IIS.se company.
      class BaseIisse < Base

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


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

        tokenizer :scan_disclaimer do
          if @input.match?(/# Copyright/)
            lines = []
            while @input.scan(/#(.*)\n\n?/)
              lines << @input[1].strip unless @input[1].strip == ""
            end
            @ast["field:disclaimer"] = lines.join(" ")
          end
        end

      end

    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
whois-3.6.2 lib/whois/record/scanners/base_iisse.rb
whois-3.6.1 lib/whois/record/scanners/base_iisse.rb
whois-3.6.0 lib/whois/record/scanners/base_iisse.rb
whois-3.5.9 lib/whois/record/scanners/base_iisse.rb
whois-3.5.8 lib/whois/record/scanners/base_iisse.rb
whois-3.5.7 lib/whois/record/scanners/base_iisse.rb
whois-3.5.6 lib/whois/record/scanners/base_iisse.rb
whois-3.5.5 lib/whois/record/scanners/base_iisse.rb