ruby-changes:11431
From: knu <ko1@a...>
Date: Mon, 23 Mar 2009 21:22:03 +0900 (JST)
Subject: [ruby-changes:11431] Ruby:r23056 (ruby_1_8): * ext/stringio/stringio.c (StringIO#ungetbyte): New method
knu 2009-03-23 21:20:57 +0900 (Mon, 23 Mar 2009) New Revision: 23056 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=23056 Log: * ext/stringio/stringio.c (StringIO#ungetbyte): New method backported from 1.9 Modified files: branches/ruby_1_8/ChangeLog branches/ruby_1_8/NEWS branches/ruby_1_8/ext/stringio/stringio.c Index: ruby_1_8/ext/stringio/stringio.c =================================================================== --- ruby_1_8/ext/stringio/stringio.c (revision 23055) +++ ruby_1_8/ext/stringio/stringio.c (revision 23056) @@ -726,7 +726,8 @@ /* * call-seq: - * strio.getc -> fixnum or nil + * strio.getbyte -> fixnum or nil + * strio.getc -> fixnum or nil * * See IO#getc. */ @@ -765,9 +766,10 @@ /* * call-seq: - * strio.ungetc(integer) -> nil + * strio.ungetbyte(integer) -> nil + * strio.ungetc(integer) -> nil * - * Pushes back one character (passed as a parameter) onto *strio* + * Pushes back one byte (passed as a parameter) onto *strio* * such that a subsequent buffered read will return it. Pushing back * behind the beginning of the buffer string is not possible. Nothing * will be done if such an attempt is made. @@ -1356,6 +1358,7 @@ rb_define_method(StringIO, "getc", strio_getc, 0); rb_define_method(StringIO, "getbyte", strio_getc, 0); rb_define_method(StringIO, "ungetc", strio_ungetc, 1); + rb_define_method(StringIO, "ungetbyte", strio_ungetc, 1); rb_define_method(StringIO, "readchar", strio_readchar, 0); rb_define_method(StringIO, "readbyte", strio_readchar, 0); rb_define_method(StringIO, "gets", strio_gets, -1); Index: ruby_1_8/NEWS =================================================================== --- ruby_1_8/NEWS (revision 23055) +++ ruby_1_8/NEWS (revision 23056) @@ -136,6 +136,12 @@ Return an enumerator if no block is given. +* stringio + + * StringIO#ungetbyte + + Added as an alias to #ungetc. + * rss * 0.2.4 -> 0.2.5 Index: ruby_1_8/ChangeLog =================================================================== --- ruby_1_8/ChangeLog (revision 23055) +++ ruby_1_8/ChangeLog (revision 23056) @@ -1,3 +1,8 @@ +Mon Mar 23 21:18:30 2009 Akinori MUSHA <knu@i...> + + * ext/stringio/stringio.c (StringIO#ungetbyte): New method + backported from 1.9. + Mon Mar 23 21:16:21 2009 Akinori MUSHA <knu@i...> * process.c: Stick with the K&R style in 1.8. -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/