diff options
author | ser <ser@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-07-28 13:28:30 +0000 |
---|---|---|
committer | ser <ser@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-07-28 13:28:30 +0000 |
commit | 7e168983ce133427289d53d159a1e354abb4e92e (patch) | |
tree | 39339b34942b981f71157109f4e3c8e032aa54e7 | |
parent | 0e83f22cf5c79d73f8723e91c7e9460849b0f494 (diff) | |
download | ruby-7e168983ce133427289d53d159a1e354abb4e92e.tar.gz |
Fixes a bug in the pretty printer related to an incomplete refactoring.
Merge code cleanups
Fixes another bug related to the formatting code refactoring in 3.1.7
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12854 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | lib/rexml/formatters/pretty.rb | 7 | ||||
-rw-r--r-- | lib/rexml/node.rb | 2 | ||||
-rw-r--r-- | lib/rexml/rexml.rb | 10 |
3 files changed, 12 insertions, 7 deletions
diff --git a/lib/rexml/formatters/pretty.rb b/lib/rexml/formatters/pretty.rb index 78eab27402..22b6d857cd 100644 --- a/lib/rexml/formatters/pretty.rb +++ b/lib/rexml/formatters/pretty.rb @@ -57,8 +57,11 @@ module REXML if compact if node.children.inject(true) {|s,c| s & c.kind_of?(Text)} string = "" - node.children.each { |child| write( child, string, 0 ) } - if string.length + @level < @width + old_level = @level + @level = 0 + node.children.each { |child| write( child, string ) } + @level = old_level + if string.length < @width output << string skip = true end diff --git a/lib/rexml/node.rb b/lib/rexml/node.rb index ebdbd44ff2..9780376829 100644 --- a/lib/rexml/node.rb +++ b/lib/rexml/node.rb @@ -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 diff --git a/lib/rexml/rexml.rb b/lib/rexml/rexml.rb index c306e65062..e9575ff418 100644 --- a/lib/rexml/rexml.rb +++ b/lib/rexml/rexml.rb @@ -10,8 +10,8 @@ # # Main page:: http://www.germane-software.com/software/rexml # Author:: Sean Russell <serATgermaneHYPHENsoftwareDOTcom> -# Version:: 3.1.7 -# Date:: 2007/206 +# Version:: 3.1.7.1 +# Date:: 2007/209 # # This API documentation can be downloaded from the REXML home page, or can # be accessed online[http://www.germane-software.com/software/rexml_doc] @@ -21,9 +21,9 @@ # online[http://www.germane-software.com/software/rexml/docs/tutorial.html] module REXML COPYRIGHT = "Copyright © 2001-2007 Sean Russell <ser@germane-software.com>" - DATE = "2007/206" - VERSION = "3.1.7" - REVISION = "$Revision$".gsub(/\$Revision:|\$/,'').strip + DATE = "2007/209" + VERSION = "3.1.7.1" + REVISION = "$Revision: 1270$".gsub(/\$Revision:|\$/,'').strip REVISION = "$Revision$".gsub(/\$Revision:|\$/,'').strip Copyright = COPYRIGHT |