summaryrefslogtreecommitdiff
path: root/ruby.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-10-14 03:22:24 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-10-14 03:22:24 +0000
commit02d28d01cf4a70ad8f5902d5a5eaa103a74103cf (patch)
treee6b14c497d7b4e4b37a894e5b6109afce6060d5d /ruby.c
parent3976eb12ff5596f70350a3697389eedd9aa1710e (diff)
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. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43278 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ruby.c')
-rw-r--r--ruby.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/ruby.c b/ruby.c
index 6723d20..233e140 100644
--- a/ruby.c
+++ b/ruby.c
@@ -52,7 +52,10 @@
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_options *opt)
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, struct cmdline_options *opt)
}
}
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);