Method: REXML::IOSource#match

Defined in:
lib/extensions/rexml/rexml/source.rb,
lib/extensions/rhoxml/rexml/source.rb

#match(pattern, cons = false) ⇒ Object



211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
# File 'lib/extensions/rexml/rexml/source.rb', line 211

def match( pattern, cons=false )
  rv = pattern.match(@buffer)
  @buffer = $' if cons and rv
  while !rv and @source
    begin
      @buffer << readline
      rv = pattern.match(@buffer)
      @buffer = $' if cons and rv
    rescue
      @source = nil
    end
  end
  rv.taint
  rv
end