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

ruby-changes:31199

From: nobu <ko1@a...>
Date: Mon, 14 Oct 2013 12:22:30 +0900 (JST)
Subject: [ruby-changes:31199] nobu:r43278 (trunk): ruby.c: gem_prelude to load rubygems

nobu	2013-10-14 12:22:24 +0900 (Mon, 14 Oct 2013)

  New Revision: 43278

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

  Log:
    ruby.c: gem_prelude to load rubygems
    
    * ruby.c (process_options): use gem_prelude instead of requiring
      rubygems directly when --enable=gems is given.
    * Makefile.in (DEFAULT_PRELUDES): always use gem_prelude regardless of
      --disable-rubygems.

  Modified files:
    trunk/ChangeLog
    trunk/Makefile.in
    trunk/common.mk
    trunk/ruby.c
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 43277)
+++ ChangeLog	(revision 43278)
@@ -1,5 +1,11 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
 2013-10-14  Nobuyoshi Nakada  <nobu@r...>
 
+	* ruby.c (process_options): use gem_prelude instead of requiring
+	  rubygems directly when --enable=gems is given.
+
+	* Makefile.in (DEFAULT_PRELUDES): always use gem_prelude regardless of
+	  --disable-rubygems.
+
 	* lib/mkmf.rb (have_framework): should append framework options to
 	  $LIBS, not $LDFLAGS.  the former is propagated to exts.mk when
 	  enable-static-linked-ext.
Index: common.mk
===================================================================
--- common.mk	(revision 43277)
+++ common.mk	(revision 43278)
@@ -112,8 +112,6 @@ GOLFOBJS      = goruby.$(OBJEXT) golf_pr https://github.com/ruby/ruby/blob/trunk/common.mk#L112
 
 PRELUDE_SCRIPTS = $(srcdir)/prelude.rb $(srcdir)/enc/prelude.rb $(DEFAULT_PRELUDES)
 GEM_PRELUDE = $(srcdir)/gem_prelude.rb
-YES_GEM_PRELUDE = $(GEM_PRELUDE)
-NO_GEM_PRELUDE =
 PRELUDES      = prelude.c miniprelude.c
 GOLFPRELUDES = golf_prelude.c
 
Index: Makefile.in
===================================================================
--- Makefile.in	(revision 43277)
+++ Makefile.in	(revision 43278)
@@ -112,7 +112,7 @@ XRUBY_LIBDIR = @XRUBY_LIBDIR@ https://github.com/ruby/ruby/blob/trunk/Makefile.in#L112
 XRUBY_RUBYLIBDIR = @XRUBY_RUBYLIBDIR@
 XRUBY_RUBYHDRDIR = @XRUBY_RUBYHDRDIR@
 
-DEFAULT_PRELUDES = $(@USE_RUBYGEMS@_GEM_PRELUDE)
+DEFAULT_PRELUDES = $(GEM_PRELUDE)
 
 #### End of system configuration section. ####
 
Index: ruby.c
===================================================================
--- ruby.c	(revision 43277)
+++ ruby.c	(revision 43278)
@@ -52,7 +52,10 @@ https://github.com/ruby/ruby/blob/trunk/ruby.c#L52
 char *getenv();
 #endif
 
-#if defined DISABLE_RUBYGEMS && DISABLE_RUBYGEMS
+#ifndef DISABLE_RUBYGEMS
+# define DISABLE_RUBYGEMS 0
+#endif
+#if DISABLE_RUBYGEMS
 #define DEFAULT_RUBYGEMS_ENABLED "disabled"
 #else
 #define DEFAULT_RUBYGEMS_ENABLED "enabled"
@@ -114,7 +117,7 @@ cmdline_options_init(struct cmdline_opti https://github.com/ruby/ruby/blob/trunk/ruby.c#L117
     opt->src.enc.index = src_encoding_index;
     opt->ext.enc.index = -1;
     opt->intern.enc.index = -1;
-#if defined DISABLE_RUBYGEMS && DISABLE_RUBYGEMS
+#if DISABLE_RUBYGEMS
     opt->disable |= DISABLE_BIT(gems);
 #endif
     return opt;
@@ -1446,11 +1449,7 @@ process_options(int argc, char **argv, s https://github.com/ruby/ruby/blob/trunk/ruby.c#L1449
 	}
     }
     if (!(opt->disable & DISABLE_BIT(gems))) {
-#if defined DISABLE_RUBYGEMS && DISABLE_RUBYGEMS
-	rb_require("rubygems");
-#else
 	rb_define_module("Gem");
-#endif
     }
     ruby_init_prelude();
     ruby_set_argv(argc, argv);

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

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