ruby-changes:18524
From: nobu <ko1@a...>
Date: Sat, 15 Jan 2011 09:48:27 +0900 (JST)
Subject: [ruby-changes:18524] Ruby:r30547 (trunk): * ruby.c (ruby_init_prelude): get rid of global namespace
nobu 2011-01-15 09:48:16 +0900 (Sat, 15 Jan 2011) New Revision: 30547 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=30547 Log: * ruby.c (ruby_init_prelude): get rid of global namespace pullution. Modified files: trunk/ChangeLog trunk/gem_prelude.rb trunk/ruby.c Index: ChangeLog =================================================================== --- ChangeLog (revision 30546) +++ ChangeLog (revision 30547) @@ -1,3 +1,8 @@ +Sat Jan 15 09:48:14 2011 Nobuyoshi Nakada <nobu@r...> + + * ruby.c (ruby_init_prelude): get rid of global namespace + pullution. + Sat Jan 15 09:42:12 2011 Nobuyoshi Nakada <nobu@r...> * include/ruby/io.h: missing prototypes. Index: gem_prelude.rb =================================================================== --- gem_prelude.rb (revision 30546) +++ gem_prelude.rb (revision 30547) @@ -1 +1 @@ -require 'rubygems' unless $disable_rubygems +require 'rubygems.rb' if defined?(Gem) Index: ruby.c =================================================================== --- ruby.c (revision 30546) +++ ruby.c (revision 30547) @@ -1103,9 +1103,8 @@ void Init_prelude(void); static void -ruby_init_prelude(int enable_gems) +ruby_init_prelude(void) { - rb_gv_set("$disable_rubygems", enable_gems ? Qfalse : Qtrue); Init_prelude(); rb_const_remove(rb_cObject, rb_intern_const("TMP_RUBY_PREFIX")); } @@ -1365,7 +1364,10 @@ rb_enc_associate(RARRAY_PTR(load_path)[i], lenc); } } - ruby_init_prelude(!(opt->disable & DISABLE_BIT(gems))); + if (!(opt->disable & DISABLE_BIT(gems))) { + rb_define_module("Gem"); + } + ruby_init_prelude(); ruby_set_argv(argc, argv); process_sflag(&opt->sflag); -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/