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

ruby-changes:4860

From: ko1@a...
Date: Sun, 11 May 2008 10:38:22 +0900 (JST)
Subject: [ruby-changes:4860] kazu - Ruby:r16353 (ruby_1_8): * eval.c (method_name, method_owner): New methods; backported from 1.9. (UnboundMethod#name, UnboundMethod#owner)

kazu	2008-05-11 10:38:12 +0900 (Sun, 11 May 2008)

  New Revision: 16353

  Modified files:
    branches/ruby_1_8/ChangeLog
    branches/ruby_1_8/NEWS
    branches/ruby_1_8/eval.c
    branches/ruby_1_8/test/ruby/test_method.rb

  Log:
    * eval.c (method_name, method_owner): New methods; backported from 1.9. (UnboundMethod#name, UnboundMethod#owner)


  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/branches/ruby_1_8/ChangeLog?r1=16353&r2=16352&diff_format=u
  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/branches/ruby_1_8/test/ruby/test_method.rb?r1=16353&r2=16352&diff_format=u
  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/branches/ruby_1_8/NEWS?r1=16353&r2=16352&diff_format=u
  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/branches/ruby_1_8/eval.c?r1=16353&r2=16352&diff_format=u

Index: ruby_1_8/NEWS
===================================================================
--- ruby_1_8/NEWS	(revision 16352)
+++ ruby_1_8/NEWS	(revision 16353)
@@ -187,6 +187,8 @@
   * Method#receiver
   * Method#name
   * Method#owner
+  * UnboundMethod#name
+  * UnboundMethod#owner
 
     New methods.
 
Index: ruby_1_8/ChangeLog
===================================================================
--- ruby_1_8/ChangeLog	(revision 16352)
+++ ruby_1_8/ChangeLog	(revision 16353)
@@ -1,3 +1,8 @@
+Sun May 11 10:36:10 2008  Kazuhiro NISHIYAMA  <zn@m...>
+
+	* eval.c (method_name, method_owner): New methods; backported
+	  from 1.9. (UnboundMethod#name, UnboundMethod#owner)
+
 Sun May 11 02:48:13 2008    <nagai@o...>
 
 	* ext/tk/lib/tk/pack.rb, ext/tk/lib/tk/grid.rb: fail to do pack/grid 
Index: ruby_1_8/test/ruby/test_method.rb
===================================================================
--- ruby_1_8/test/ruby/test_method.rb	(revision 16352)
+++ ruby_1_8/test/ruby/test_method.rb	(revision 16353)
@@ -47,5 +47,7 @@
     assert_equal(o, m.receiver)
     assert_equal("foo", m.name)
     assert_equal(class << o; self; end, m.owner)
+    assert_equal("foo", m.unbind.name)
+    assert_equal(class << o; self; end, m.unbind.owner)
   end
 end
Index: ruby_1_8/eval.c
===================================================================
--- ruby_1_8/eval.c	(revision 16352)
+++ ruby_1_8/eval.c	(revision 16353)
@@ -9940,6 +9940,8 @@
     rb_define_method(rb_cUnboundMethod, "arity", method_arity, 0);
     rb_define_method(rb_cUnboundMethod, "inspect", method_inspect, 0);
     rb_define_method(rb_cUnboundMethod, "to_s", method_inspect, 0);
+    rb_define_method(rb_cUnboundMethod, "name", method_name, 0);
+    rb_define_method(rb_cUnboundMethod, "owner", method_owner, 0);
     rb_define_method(rb_cUnboundMethod, "bind", umethod_bind, 1);
     rb_define_method(rb_cModule, "instance_method", rb_mod_method, 1);
 }

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

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