Sha256: 22bf39461442a6fe6e18e74e9d9eb3dff96925fcf845be3d101106ff2e0cc6c5

Contents?: true

Size: 782 Bytes

Versions: 9

Compression:

Stored size: 782 Bytes

Contents

require_relative 'base'

module Whois
  module Scanners

    class WhoisSx < Base

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


      tokenizer :scan_available do
        if @input.scan(/^Status: (.+) \(No match for domain "(.+)"\)\n/)
          @ast["Domain Status"] = @input[1]
          @ast["Domain Name"] = @input[2]
        end
      end

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

      tokenizer :scan_disclaimer do
        if @input.match?(/^% WHOIS LEGAL STATEMENT/)
          @ast["field:disclaimer"] = _scan_lines_to_array(/%(.*)\n/).map(&:strip).join("\n")
        end
      end

    end

  end
end

Version data entries

9 entries across 9 versions & 2 rubygems

Version Path
whois-parser-2.0.0 lib/whois/scanners/whois.sx.rb
whois-parser-1.2.0 lib/whois/scanners/whois.sx.rb
whois-parser-1.1.0 lib/whois/scanners/whois.sx.rb
whois-parser-1.0.1 lib/whois/scanners/whois.sx.rb
hetzner-whois-parser-1.0.1.rc2 lib/whois/scanners/whois.sx.rb
hetzner-whois-parser-1.0.1.rc1 lib/whois/scanners/whois.sx.rb
whois-parser-1.0.0 lib/whois/scanners/whois.sx.rb
whois-parser-1.0.0.pre.beta2 lib/whois/scanners/whois.sx.rb
whois-parser-1.0.0.pre.beta1 lib/whois/scanners/whois.sx.rb