From 61ec62386062c3e5010209b098938485b4d4d482 Mon Sep 17 00:00:00 2001 From: mame Date: Wed, 11 Nov 2009 16:32:34 +0000 Subject: [PATCH] * enumerator.c (yielder_yield_push): Yielder#<< should return self. [ruby-dev:39660] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25721 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 5 +++++ enumerator.c | 9 ++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 061352aca8..52c80b0c39 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Thu Nov 12 01:29:15 2009 Yusuke Endoh + + * enumerator.c (yielder_yield_push): Yielder#<< should return self. + [ruby-dev:39660] + Wed Nov 11 19:17:35 2009 Nobuyoshi Nakada * lib/tempfile.rb (Tempfile#initialize): merge mode option. diff --git a/enumerator.c b/enumerator.c index e341c07d75..7c50f3dda2 100644 --- a/enumerator.c +++ b/enumerator.c @@ -1012,6 +1012,13 @@ yielder_yield(VALUE obj, VALUE args) return rb_proc_call(ptr->proc, args); } +/* :nodoc: */ +static VALUE yielder_yield_push(VALUE obj, VALUE args) +{ + yielder_yield(obj, args); + return obj; +} + static VALUE yielder_yield_i(VALUE obj, VALUE memo, int argc, VALUE *argv) { @@ -1228,7 +1235,7 @@ Init_Enumerator(void) rb_define_alloc_func(rb_cYielder, yielder_allocate); rb_define_method(rb_cYielder, "initialize", yielder_initialize, 0); rb_define_method(rb_cYielder, "yield", yielder_yield, -2); - rb_define_method(rb_cYielder, "<<", yielder_yield, -2); + rb_define_method(rb_cYielder, "<<", yielder_yield_push, -2); id_rewind = rb_intern("rewind"); id_each = rb_intern("each");