From 0d04057aad88b17c6189caa2443cd4b79ba96b13 Mon Sep 17 00:00:00 2001 From: ser Date: Sun, 16 May 2004 18:42:58 +0000 Subject: [PATCH] ------------------------------------------------------------------------ git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6336 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- lib/rexml/cdata.rb | 2 +- lib/rexml/element.rb | 2 +- lib/rexml/rexml.rb | 4 ++-- lib/rexml/text.rb | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/rexml/cdata.rb b/lib/rexml/cdata.rb index 402a0187ff..9e82376cd8 100644 --- a/lib/rexml/cdata.rb +++ b/lib/rexml/cdata.rb @@ -59,7 +59,7 @@ module REXML # c = CData.new( " Some text " ) # c.write( $stdout ) #-> def write( output=$stdout, indent=-1, transitive=false, ie_hack=false ) - indent( output, indent ) + indent( output, indent ) unless transitive output << START output << @string output << STOP diff --git a/lib/rexml/element.rb b/lib/rexml/element.rb index 6456518cd7..ffc81bed91 100644 --- a/lib/rexml/element.rb +++ b/lib/rexml/element.rb @@ -659,7 +659,7 @@ module REXML end writer << "/" else - if transitive and indent>-1 and !@children[0].kind_of? Text + if transitive and indent>-1 and !@children[0].instance_of? Text writer << "\n" indent writer, indent+1 end diff --git a/lib/rexml/rexml.rb b/lib/rexml/rexml.rb index da1b88ddd3..540d5c3a9d 100644 --- a/lib/rexml/rexml.rb +++ b/lib/rexml/rexml.rb @@ -10,7 +10,7 @@ # # Main page:: http://www.germane-software.com/software/rexml # Author:: Sean Russell -# Version:: 3.0.7 +# Version:: 3.0.8 # Date:: +2004/137 # # This API documentation can be downloaded from the REXML home page, or can @@ -22,5 +22,5 @@ module REXML Copyright = "Copyright © 2001, 2002, 2003, 2004 Sean Russell " Date = "+2004/137" - Version = "3.0.7" + Version = "3.0.8" end diff --git a/lib/rexml/text.rb b/lib/rexml/text.rb index 1d2d2dd711..388256ac81 100644 --- a/lib/rexml/text.rb +++ b/lib/rexml/text.rb @@ -194,7 +194,7 @@ module REXML @raw = false end - def indent(string, level=1, style="\t", indentfirstline=true) + def indent_text(string, level=1, style="\t", indentfirstline=true) return string if level < 0 new_string = '' string.each { |line| @@ -211,7 +211,7 @@ module REXML if not (@parent and @parent.whitespace) then s = wrap(s, 60, false) if @parent and @parent.context[:wordwrap] == :all if @parent and not @parent.context[:indentstyle].nil? and indent > 0 and s.count("\n") > 0 - s = indent(s, indent, @parent.context[:indentstyle], false) + s = indent_text(s, indent, @parent.context[:indentstyle], false) end s.squeeze!(" \n\t") if @parent and !@parent.whitespace end