Sha256: c782247690dba666e815575dee743a51c50ea9c81e52d97a83bd122fa94a9e37

Contents?: true

Size: 1.04 KB

Versions: 472

Compression:

Stored size: 1.04 KB

Contents

# frozen_string_literal: true

module Nokogiri
  module HTML4
    module SAX
      class PushParser
        # The Nokogiri::HTML4::SAX::Document on which the PushParser will be
        # operating
        attr_accessor :document

        def initialize(doc = HTML4::SAX::Document.new, file_name = nil, encoding = "UTF-8")
          @document = doc
          @encoding = encoding
          @sax_parser = HTML4::SAX::Parser.new(doc, @encoding)

          ## Create our push parser context
          initialize_native(@sax_parser, file_name, encoding)
        end

        ###
        # Write a +chunk+ of HTML to the PushParser.  Any callback methods
        # that can be called will be called immediately.
        def write(chunk, last_chunk = false)
          native_write(chunk, last_chunk)
        end
        alias_method :<<, :write

        ###
        # Finish the parsing.  This method is only necessary for
        # Nokogiri::HTML4::SAX::Document#end_document to be called.
        def finish
          write("", true)
        end
      end
    end
  end
end

Version data entries

472 entries across 469 versions & 12 rubygems

Version Path
trusty-cms-7.0.9.1 vendor/bundle/ruby/3.1.0/gems/nokogiri-1.16.7-x86_64-darwin/lib/nokogiri/html4/sax/push_parser.rb
trusty-cms-7.0.9.1 vendor/bundle/ruby/3.3.0/gems/nokogiri-1.17.2-x86_64-darwin/lib/nokogiri/html4/sax/push_parser.rb
nokogiri-1.18.2-x86_64-linux-musl lib/nokogiri/html4/sax/push_parser.rb
nokogiri-1.18.2-x86_64-linux-gnu lib/nokogiri/html4/sax/push_parser.rb
nokogiri-1.18.2-x86_64-darwin lib/nokogiri/html4/sax/push_parser.rb
nokogiri-1.18.2-x64-mingw-ucrt lib/nokogiri/html4/sax/push_parser.rb
nokogiri-1.18.2-java lib/nokogiri/html4/sax/push_parser.rb
nokogiri-1.18.2 lib/nokogiri/html4/sax/push_parser.rb
nokogiri-1.18.2-arm-linux-musl lib/nokogiri/html4/sax/push_parser.rb
nokogiri-1.18.2-arm-linux-gnu lib/nokogiri/html4/sax/push_parser.rb
nokogiri-1.18.2-arm64-darwin lib/nokogiri/html4/sax/push_parser.rb
nokogiri-1.18.2-aarch64-linux-musl lib/nokogiri/html4/sax/push_parser.rb
nokogiri-1.18.2-aarch64-linux-gnu lib/nokogiri/html4/sax/push_parser.rb
minato_ruby_api_client-0.2.2 vendor/bundle/ruby/3.2.0/gems/nokogiri-1.16.6-x86_64-linux/lib/nokogiri/html4/sax/push_parser.rb
nokogiri-1.18.1-x86_64-linux-musl lib/nokogiri/html4/sax/push_parser.rb
nokogiri-1.18.1-x86_64-linux-gnu lib/nokogiri/html4/sax/push_parser.rb
nokogiri-1.18.1-x86_64-darwin lib/nokogiri/html4/sax/push_parser.rb
nokogiri-1.18.1-x64-mingw-ucrt lib/nokogiri/html4/sax/push_parser.rb
nokogiri-1.18.1-java lib/nokogiri/html4/sax/push_parser.rb
nokogiri-1.18.1 lib/nokogiri/html4/sax/push_parser.rb