[前][次][番号順一覧][スレッド一覧]

ruby-changes:7987

From: matz <ko1@a...>
Date: Wed, 24 Sep 2008 14:13:16 +0900 (JST)
Subject: [ruby-changes:7987] Ruby:r19511 (ruby_1_8): * lib/rexml/formatters/pretty.rb (REXML::Formatters::Pretty#wrap):

matz	2008-09-24 14:13:03 +0900 (Wed, 24 Sep 2008)

  New Revision: 19511

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=19511

  Log:
    * lib/rexml/formatters/pretty.rb (REXML::Formatters::Pretty#wrap):
      abandon wrapping if the line contains no space.  [ruby-dev:36045]
      fix: #342

  Modified files:
    branches/ruby_1_8/ChangeLog
    branches/ruby_1_8/lib/rexml/formatters/pretty.rb

Index: ruby_1_8/ChangeLog
===================================================================
--- ruby_1_8/ChangeLog	(revision 19510)
+++ ruby_1_8/ChangeLog	(revision 19511)
@@ -1,3 +1,9 @@
+Wed Sep 24 14:11:59 2008  Yukihiro Matsumoto  <matz@r...>
+
+	* lib/rexml/formatters/pretty.rb (REXML::Formatters::Pretty#wrap):
+	  abandon wrapping if the line contains no space.  [ruby-dev:36045]
+	  fix: #342
+
 Tue Sep 23 19:50:24 2008  NAKAMURA Usaku  <usa@r...>
 
 	* win32/win32.c (subtruct): check tv_sec.
Index: ruby_1_8/lib/rexml/formatters/pretty.rb
===================================================================
--- ruby_1_8/lib/rexml/formatters/pretty.rb	(revision 19510)
+++ ruby_1_8/lib/rexml/formatters/pretty.rb	(revision 19511)
@@ -128,6 +128,7 @@
         # Recursively wrap string at width.
         return string if string.length <= width
         place = string.rindex(' ', width) # Position in string with last ' ' before cutoff
+        return string if place.nil?
         return string[0,place] + "\n" + wrap(string[place+1..-1], width)
       end
 

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]