From 19768b6cacb1319f34944a0dc5e0bbe099d2d18e Mon Sep 17 00:00:00 2001 From: shugo Date: Mon, 7 Jan 2013 12:42:48 +0000 Subject: * vm_method.c (Init_eval_method): main.public and main.private should be private. * proc.c (Init_Proc): main.define_method should be private. * test/ruby/test_module.rb: related test. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38732 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- vm_method.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'vm_method.c') diff --git a/vm_method.c b/vm_method.c index f219d7cb43..cfeb012bde 100644 --- a/vm_method.c +++ b/vm_method.c @@ -1610,8 +1610,10 @@ Init_eval_method(void) rb_define_method(rb_cModule, "public_class_method", rb_mod_public_method, -1); rb_define_method(rb_cModule, "private_class_method", rb_mod_private_method, -1); - rb_define_singleton_method(rb_vm_top_self(), "public", top_public, -1); - rb_define_singleton_method(rb_vm_top_self(), "private", top_private, -1); + rb_define_private_method(rb_singleton_class(rb_vm_top_self()), + "public", top_public, -1); + rb_define_private_method(rb_singleton_class(rb_vm_top_self()), + "private", top_private, -1); object_id = rb_intern("object_id"); added = rb_intern("method_added"); -- cgit v1.2.3