Sha256: e7e38a3c6f1a2a97e0152e3231397c0962e8e871afc1b10df28d48d2c07d8ca2

Contents?: true

Size: 778 Bytes

Versions: 14

Compression:

Stored size: 778 Bytes

Contents

module Nokogiri
  module XML
    module SAX
      class Parser
        attr_accessor :document
        def initialize(doc = XML::SAX::Document.new)
          @document = doc
        end

        ###
        # Parse given +thing+ which may be a string containing xml, or an
        # IO object.
        def parse thing
          parse_memory(thing.is_a?(IO) ? thing.read : thing)
        end

        ###
        # Parse given +io+
        def parse_io io
          parse_memory io.read
        end

        ###
        # Parse a file with +filename+
        def parse_file filename
          raise Errno::ENOENT unless File.exists?(filename)
          raise Errno::EISDIR if File.directory?(filename)
          native_parse_file filename
        end
      end
    end
  end
end

Version data entries

14 entries across 14 versions & 2 rubygems

Version Path
tenderlove-nokogiri-0.0.0-x86-mswin32-60 lib/nokogiri/xml/sax/parser.rb
tenderlove-nokogiri-0.0.0.20081001111445 lib/nokogiri/xml/sax/parser.rb
nokogiri-1.0.0-x86-mswin32-60 lib/nokogiri/xml/sax/parser.rb
nokogiri-1.0.0 lib/nokogiri/xml/sax/parser.rb
nokogiri-1.0.1 lib/nokogiri/xml/sax/parser.rb
nokogiri-1.0.5-x86-mswin32-60 lib/nokogiri/xml/sax/parser.rb
nokogiri-1.0.4 lib/nokogiri/xml/sax/parser.rb
nokogiri-1.0.2 lib/nokogiri/xml/sax/parser.rb
nokogiri-1.0.3 lib/nokogiri/xml/sax/parser.rb
nokogiri-1.0.3-x86-mswin32-60 lib/nokogiri/xml/sax/parser.rb
nokogiri-1.0.4-x86-mswin32-60 lib/nokogiri/xml/sax/parser.rb
nokogiri-1.0.6 lib/nokogiri/xml/sax/parser.rb
nokogiri-1.0.5 lib/nokogiri/xml/sax/parser.rb
nokogiri-1.0.6-x86-mswin32-60 lib/nokogiri/xml/sax/parser.rb