1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* lib/rexml: Merge fixes since 1.8.6 made solely on the ruby_1_8_6

branch.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@16067 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
knu 2008-04-18 07:07:11 +00:00
parent 40e7794993
commit 2f1fa7e402
28 changed files with 1785 additions and 1373 deletions

View file

@ -1,4 +1,6 @@
require "rexml/parseexception"
require "rexml/formatters/pretty"
require "rexml/formatters/default"
module REXML
# Represents a node in the tree. Nodes are never encountered except as
@ -18,10 +20,19 @@ module REXML
@parent[ ind - 1 ]
end
def to_s indent=-1
rv = ""
write rv,indent
rv
# indent::
# *DEPRECATED* This parameter is now ignored. See the formatters in the
# REXML::Formatters package for changing the output style.
def to_s indent=nil
unless indent.nil?
Kernel.warn( "#{self.class.name}.to_s(indent) parameter is deprecated" )
f = REXML::Formatters::Pretty.new( indent )
f.write( self, rv, indent )
else
f = REXML::Formatters::Default.new
f.write( self, rv = "" )
end
return rv
end
def indent to, ind