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");