class Nokogiri::Streaming::IOWrapper

IO wrapper which traps stream exceptions. This works around bug in Nokogiri's SAX code, which seems to ignore exceptions entirely.

Attributes

exception[R]

Public Class Methods

new(source) click to toggle source
# File lib/nokogiri/streaming/reader.rb, line 116
def initialize(source)
  @source = source
end

Public Instance Methods

close() click to toggle source
# File lib/nokogiri/streaming/reader.rb, line 129
def close
  @stream.close
end
read(length = nil) click to toggle source
# File lib/nokogiri/streaming/reader.rb, line 120
def read(length = nil)
  begin
    return @source.read(length)
  rescue => e
    @exception = e
    raise
  end
end