ruby-changes:4928
From: ko1@a...
Date: Thu, 15 May 2008 17:03:07 +0900 (JST)
Subject: [ruby-changes:4928] knu - Ruby:r16421 (ruby_1_8): * string.c (Init_String): Define #bytesize as an alias for #size
knu 2008-05-15 17:02:47 +0900 (Thu, 15 May 2008)
New Revision: 16421
Modified files:
branches/ruby_1_8/ChangeLog
branches/ruby_1_8/NEWS
branches/ruby_1_8/string.c
Log:
* string.c (Init_String): Define #bytesize as an alias for #size
for compatibility with 1.9.
http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/branches/ruby_1_8/ChangeLog?r1=16421&r2=16420&diff_format=u
http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/branches/ruby_1_8/NEWS?r1=16421&r2=16420&diff_format=u
http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/branches/ruby_1_8/string.c?r1=16421&r2=16420&diff_format=u
Index: ruby_1_8/NEWS
===================================================================
--- ruby_1_8/NEWS (revision 16420)
+++ ruby_1_8/NEWS (revision 16421)
@@ -205,6 +205,10 @@
* Regexp.union accepts an array of patterns.
+ * String#bytesize
+
+ New method, returning the size in bytes. (alias length and size)
+
* String#chars
* String#each_char
* String#partition
Index: ruby_1_8/ChangeLog
===================================================================
--- ruby_1_8/ChangeLog (revision 16420)
+++ ruby_1_8/ChangeLog (revision 16421)
@@ -1,3 +1,8 @@
+Thu May 15 17:00:22 2008 Akinori MUSHA <knu@i...>
+
+ * string.c (Init_String): Define #bytesize as an alias for #size
+ for compatibility with 1.9.
+
Thu May 15 15:33:59 2008 Nobuyoshi Nakada <nobu@r...>
* file.c (file_expand_path): support for alternative data stream
Index: ruby_1_8/string.c
===================================================================
--- ruby_1_8/string.c (revision 16420)
+++ ruby_1_8/string.c (revision 16421)
@@ -4921,6 +4921,7 @@
rb_define_method(rb_cString, "insert", rb_str_insert, 2);
rb_define_method(rb_cString, "length", rb_str_length, 0);
rb_define_method(rb_cString, "size", rb_str_length, 0);
+ rb_define_method(rb_cString, "bytesize", rb_str_length, 0);
rb_define_method(rb_cString, "empty?", rb_str_empty, 0);
rb_define_method(rb_cString, "=~", rb_str_match, 1);
rb_define_method(rb_cString, "match", rb_str_match_m, 1);
--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/