From 75bc5455af8c3c3381066aac3d5fff42264cac6f Mon Sep 17 00:00:00 2001 From: Kornelius Kalnbach Date: Fri, 19 Aug 2011 03:09:35 +0200 Subject: Major rewrite of encoders to support IO output; fixed some minor scanner bugs; cleanups; dropped NitroXHTML scanner; improved tests --- lib/coderay/encoders/xml.rb | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'lib/coderay/encoders/xml.rb') diff --git a/lib/coderay/encoders/xml.rb b/lib/coderay/encoders/xml.rb index f2e7c02..3d306a6 100644 --- a/lib/coderay/encoders/xml.rb +++ b/lib/coderay/encoders/xml.rb @@ -10,7 +10,7 @@ module Encoders FILE_EXTENSION = 'xml' - require 'rexml/document' + autoload :REXML, 'rexml/document' DEFAULT_OPTIONS = { :tab_width => 8, @@ -20,6 +20,8 @@ module Encoders protected def setup options + super + @doc = REXML::Document.new @doc << REXML::XMLDecl.new @tab_width = options[:tab_width] @@ -27,9 +29,9 @@ module Encoders end def finish options - @out = '' @doc.write @out, options[:pretty], options[:transitive], true - @out + + super end public -- cgit v1.2.1