From 9278fab680e2bbbe9e443ad8ef2cec631800de2e Mon Sep 17 00:00:00 2001 From: akr Date: Sun, 27 Sep 2009 14:44:43 +0000 Subject: [PATCH] rdoc update. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25123 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- enum.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/enum.c b/enum.c index 99a59e574e..d3503b1f5f 100644 --- a/enum.c +++ b/enum.c @@ -2067,6 +2067,14 @@ chunk_i(VALUE yielder, VALUE enumerator, int argc, VALUE *argv) * # "\n"] * # ... * + * paragraphs separated by empty lines can be parsed as follows. + * + * File.foreach("README").chunk {|line| + * /\A\s*\z/ !~ line || nil + * }.each {|_, lines| + * pp lines + * } + * * :_alone can be used to pass through bunch of elements. * For example, sort consective lines formed as Foo#bar and * pass other lines, chunk can be used as follows.