[前][次][番号順一覧][スレッド一覧]

ruby-changes:6337

From: shyouhei <ko1@a...>
Date: Thu, 3 Jul 2008 20:15:13 +0900 (JST)
Subject: [ruby-changes:6337] Ruby:r17852 (ruby_1_8_7): merge revision(s) 17396:

shyouhei	2008-07-03 20:14:50 +0900 (Thu, 03 Jul 2008)

  New Revision: 17852

  Modified files:
    branches/ruby_1_8_7/ChangeLog
    branches/ruby_1_8_7/lib/singleton.rb
    branches/ruby_1_8_7/marshal.c
    branches/ruby_1_8_7/object.c
    branches/ruby_1_8_7/version.h

  Log:
    merge revision(s) 17396:
    * marshal.c (w_object, marshal_dump, r_object0, marshal_load): search
      public methods only.  [ruby-core:17283]
    * object.c (convert_type): ditto.
    * lib/singleton.rb (Singleton#_dump): conversion method should be
      public.


  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=17852

Index: ruby_1_8_7/ChangeLog
===================================================================
--- ruby_1_8_7/ChangeLog	(revision 17851)
+++ ruby_1_8_7/ChangeLog	(revision 17852)
@@ -1,3 +1,13 @@
+Thu Jul  3 20:13:20 2008  Nobuyoshi Nakada  <nobu@r...>
+
+	* marshal.c (w_object, marshal_dump, r_object0, marshal_load): search
+	  public methods only.  [ruby-core:17283]
+
+	* object.c (convert_type): ditto.
+
+	* lib/singleton.rb (Singleton#_dump): conversion method should be
+	  public.
+
 Wed Jul  2 19:06:43 2008  Nobuyoshi Nakada  <nobu@r...>
 
 	* lib/cgi.rb (CGI::QueryExtension.read_multipart): blanks inside
Index: ruby_1_8_7/version.h
===================================================================
--- ruby_1_8_7/version.h	(revision 17851)
+++ ruby_1_8_7/version.h	(revision 17852)
@@ -1,15 +1,15 @@
 #define RUBY_VERSION "1.8.7"
-#define RUBY_RELEASE_DATE "2008-07-02"
+#define RUBY_RELEASE_DATE "2008-07-03"
 #define RUBY_VERSION_CODE 187
-#define RUBY_RELEASE_CODE 20080702
-#define RUBY_PATCHLEVEL 46
+#define RUBY_RELEASE_CODE 20080703
+#define RUBY_PATCHLEVEL 47
 
 #define RUBY_VERSION_MAJOR 1
 #define RUBY_VERSION_MINOR 8
 #define RUBY_VERSION_TEENY 7
 #define RUBY_RELEASE_YEAR 2008
 #define RUBY_RELEASE_MONTH 7
-#define RUBY_RELEASE_DAY 2
+#define RUBY_RELEASE_DAY 3
 
 #ifdef RUBY_EXTERN
 RUBY_EXTERN const char ruby_version[];
Index: ruby_1_8_7/object.c
===================================================================
--- ruby_1_8_7/object.c	(revision 17851)
+++ ruby_1_8_7/object.c	(revision 17852)
@@ -2205,7 +2205,7 @@
     ID m;
 
     m = rb_intern(method);
-    if (!rb_obj_respond_to(val, m, Qtrue)) {
+    if (!rb_respond_to(val, m)) {
 	if (raise) {
 	    rb_raise(rb_eTypeError, "can't convert %s into %s",
 		     NIL_P(val) ? "nil" :
Index: ruby_1_8_7/lib/singleton.rb
===================================================================
--- ruby_1_8_7/lib/singleton.rb	(revision 17851)
+++ ruby_1_8_7/lib/singleton.rb	(revision 17852)
@@ -71,7 +71,6 @@
     raise TypeError, "can't dup instance of singleton #{self.class}"
   end
 
-  private
   #  default marshalling strategy
   def _dump(depth=-1)
     ''
Index: ruby_1_8_7/marshal.c
===================================================================
--- ruby_1_8_7/marshal.c	(revision 17851)
+++ ruby_1_8_7/marshal.c	(revision 17852)
@@ -511,7 +511,7 @@
 	if (OBJ_TAINTED(obj)) arg->taint = Qtrue;
 
 	st_add_direct(arg->data, obj, arg->data->num_entries);
-	if (rb_obj_respond_to(obj, s_mdump, Qtrue)) {
+	if (rb_respond_to(obj, s_mdump)) {
 	    volatile VALUE v;
 
 	    v = rb_funcall(obj, s_mdump, 0, 0);
@@ -521,7 +521,7 @@
 	    if (ivtbl) w_ivar(0, &c_arg);
 	    return;
 	}
-	if (rb_obj_respond_to(obj, s_dump, Qtrue)) {
+	if (rb_respond_to(obj, s_dump)) {
 	    VALUE v;
 
 	    v = rb_funcall(obj, s_dump, 1, INT2NUM(limit));
@@ -664,7 +664,7 @@
 	    {
 		VALUE v;
 
-		if (!rb_obj_respond_to(obj, s_dump_data, Qtrue)) {
+		if (!rb_respond_to(obj, s_dump_data)) {
 		    rb_raise(rb_eTypeError,
 			     "no marshal_dump is defined for class %s",
 			     rb_obj_classname(obj));
@@ -765,12 +765,12 @@
     arg.str = rb_str_buf_new(0);
     RBASIC(arg.str)->klass = 0;
     if (!NIL_P(port)) {
-	if (!rb_obj_respond_to(port, s_write, Qtrue)) {
+	if (!rb_respond_to(port, s_write)) {
 	  type_error:
 	    rb_raise(rb_eTypeError, "instance of IO needed");
 	}
 	arg.dest = port;
-	if (rb_obj_respond_to(port, s_binmode, Qtrue)) {
+	if (rb_respond_to(port, s_binmode)) {
 	    rb_funcall2(port, s_binmode, 0, 0);
 	    reentrant_check(arg.str, s_dump_data);
 	}
@@ -1245,7 +1245,7 @@
 	    VALUE klass = path2class(r_unique(arg));
 	    VALUE data;
 
-	    if (!rb_obj_respond_to(klass, s_load, Qtrue)) {
+	    if (!rb_respond_to(klass, s_load)) {
 		rb_raise(rb_eTypeError, "class %s needs to have method `_load'",
 			 rb_class2name(klass));
 	    }
@@ -1272,7 +1272,7 @@
                     rb_extend_object(v, m);
                 }
             }
-	    if (!rb_obj_respond_to(v, s_mload, Qtrue)) {
+	    if (!rb_respond_to(v, s_mload)) {
 		rb_raise(rb_eTypeError, "instance of %s needs to have method `marshal_load'",
 			 rb_class2name(klass));
 	    }
@@ -1299,7 +1299,7 @@
       case TYPE_DATA:
        {
            VALUE klass = path2class(r_unique(arg));
-           if (rb_obj_respond_to(klass, s_alloc, Qtrue)) {
+           if (rb_respond_to(klass, s_alloc)) {
 	       static int warn = Qtrue;
 	       if (warn) {
 		   rb_warn("define `allocate' instead of `_alloc'");
@@ -1315,7 +1315,7 @@
                rb_raise(rb_eArgError, "dump format error");
            }
            r_entry(v, arg);
-           if (!rb_obj_respond_to(v, s_load_data, Qtrue)) {
+           if (!rb_respond_to(v, s_load_data)) {
                rb_raise(rb_eTypeError,
                         "class %s needs to have instance method `_load_data'",
                         rb_class2name(klass));
@@ -1420,8 +1420,8 @@
 	arg.taint = OBJ_TAINTED(port); /* original taintedness */
 	port = v;
     }
-    else if (rb_obj_respond_to(port, s_getc, Qtrue) && rb_obj_respond_to(port, s_read, Qtrue)) {
-	if (rb_obj_respond_to(port, s_binmode, Qtrue)) {
+    else if (rb_respond_to(port, s_getc) && rb_respond_to(port, s_read)) {
+	if (rb_respond_to(port, s_binmode)) {
 	    rb_funcall2(port, s_binmode, 0, 0);
 	}
 	arg.taint = Qtrue;

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]