ruby-changes:13525
From: akr <ko1@a...>
Date: Sun, 11 Oct 2009 16:42:20 +0900 (JST)
Subject: [ruby-changes:13525] Ruby:r25301 (trunk): rdoc update.
akr 2009-10-11 16:39:17 +0900 (Sun, 11 Oct 2009) New Revision: 25301 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=25301 Log: rdoc update. Modified files: trunk/enum.c Index: enum.c =================================================================== --- enum.c (revision 25300) +++ enum.c (revision 25301) @@ -2240,13 +2240,14 @@ * The duplicated object is passed to 2nd argument of the block for * +slice_before+ method. * - * # word wrapping - * def wordwrap(words, width) + * # word wrapping. + * # this assumes all characters have same width. + * def wordwrap(words, maxwidth) * # if cols is a local variable, 2nd "each" may start with non-zero cols. * words.slice_before(cols: 0) {|w, h| * h[:cols] += 1 if h[:cols] != 0 * h[:cols] += w.length - * if width < h[:cols] + * if maxwidth < h[:cols] * h[:cols] = w.length * true * else -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/