summaryrefslogtreecommitdiff
path: root/enum.c
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-10-02 23:10:38 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-10-02 23:10:38 +0000
commita21b7ddf26ed73dbb72c6403bd0c96d76f7410f0 (patch)
treedde3abe352bc98a3b1540675db7a564638cf67f1 /enum.c
parent5bdef2f9849d8a6c3dd24cf3542d5296eff5c752 (diff)
rdoc update.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25203 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'enum.c')
-rw-r--r--enum.c27
1 files changed, 14 insertions, 13 deletions
diff --git a/enum.c b/enum.c
index 4dc8505787..0f5365e1a3 100644
--- a/enum.c
+++ b/enum.c
@@ -2176,8 +2176,8 @@ slicebefore_i(VALUE yielder, VALUE enumerator, int argc, VALUE *argv)
/*
* call-seq:
* enum.slice_before(pattern) => enumerator
- * enum.slice_before {|elt| ... } => enumerator
- * enum.slice_before(initial_state) {|elt, state| ... } => enumerator
+ * enum.slice_before {|elt| bool } => enumerator
+ * enum.slice_before(initial_state) {|elt, state| bool } => enumerator
*
* Creates an enumerator for each chunked elements.
* The beginnings of chunks are defined by _pattern_ and the block.
@@ -2205,6 +2205,18 @@ slicebefore_i(VALUE yielder, VALUE enumerator, int argc, VALUE *argv)
* f.slice_before {|line| /\A\S/ === line }.each {|e| pp e}
* }
*
+ * "svn proplist -R" produces multiline output for each file.
+ * They can be chunked as follows:
+ *
+ * IO.popen([{"LC_ALL"=>"C"}, "svn", "proplist", "-R"]) {|f|
+ * f.lines.slice_before(/\AProp/).each {|lines| p lines }
+ * }
+ * #=> ["Properties on '.':\n", " svn:ignore\n", " svk:merge\n"]
+ * # ["Properties on 'goruby.c':\n", " svn:eol-style\n"]
+ * # ["Properties on 'complex.c':\n", " svn:mime-type\n", " svn:eol-style\n"]
+ * # ["Properties on 'regparse.c':\n", " svn:eol-style\n"]
+ * # ...
+ *
* If the block needs to maintain state over multiple elements,
* local variables can be used.
* For example, monotonically increasing elements can be chunked as follows.
@@ -2254,17 +2266,6 @@ slicebefore_i(VALUE yielder, VALUE enumerator, int argc, VALUE *argv)
* # 20
* # ----------
*
- * "svn proplist -R" produces multiline output for each file.
- * They can be chunked as follows:
- *
- * IO.popen([{"LC_ALL"=>"C"}, "svn", "proplist", "-R"]) {|f|
- * f.lines.slice_before(/^Prop/).each {|lines| p lines }
- * }
- * #=> ["Properties on '.':\n", " svn:ignore\n", " svk:merge\n"]
- * # ["Properties on 'goruby.c':\n", " svn:eol-style\n"]
- * # ["Properties on 'complex.c':\n", " svn:mime-type\n", " svn:eol-style\n"]
- * # ["Properties on 'regparse.c':\n", " svn:eol-style\n"]
- *
* mbox contains series of mails which start with Unix From line.
* So each mail can be extracted by slice before Unix From line.
*