Sha256: de2863592a271b60ee610f8551b568970ba3b14d3e818896126a639457ebfa27

Contents?: true

Size: 1008 Bytes

Versions: 13

Compression:

Stored size: 1008 Bytes

Contents

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


require 'whois/record/scanners/base'


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

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
whois-3.4.3 lib/whois/record/scanners/whois.sx.rb
whois-3.4.2 lib/whois/record/scanners/whois.sx.rb
whois-3.4.1 lib/whois/record/scanners/whois.sx.rb
whois-3.4.0 lib/whois/record/scanners/whois.sx.rb
whois-3.3.1 lib/whois/record/scanners/whois.sx.rb
whois-3.3.0 lib/whois/record/scanners/whois.sx.rb
whois-3.2.1 lib/whois/record/scanners/whois.sx.rb
whois-3.2.0 lib/whois/record/scanners/whois.sx.rb
whois-3.1.3 lib/whois/record/scanners/whois.sx.rb
whois-3.1.2 lib/whois/record/scanners/whois.sx.rb
whois-3.1.1 lib/whois/record/scanners/whois.sx.rb
whois-3.1.0 lib/whois/record/scanners/whois.sx.rb
whois-3.0.0 lib/whois/record/scanners/whois.sx.rb