From 68ef047b8f185c844a79fe6ae63841a656b190bb Mon Sep 17 00:00:00 2001 From: nobu Date: Fri, 11 Feb 2011 16:04:08 +0000 Subject: * ruby.c (proc_options): enable rubygems if --gem option is given. * ruby.c (process_options): load rubygems if it is disabled but --gem option is given. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30846 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 7 +++++++ ruby.c | 5 +++++ 2 files changed, 12 insertions(+) diff --git a/ChangeLog b/ChangeLog index 238af8a35b..3744b55c92 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +Sat Feb 12 01:04:02 2011 Nobuyoshi Nakada + + * ruby.c (proc_options): enable rubygems if --gem option is given. + + * ruby.c (process_options): load rubygems if it is disabled but + --gem option is given. + Fri Feb 11 23:27:50 2011 Yuki Sonoda (Yugui) * ruby.c (proc_options): add --gem=enabled as an alias of diff --git a/ruby.c b/ruby.c index 87ca6bed23..749b57a893 100644 --- a/ruby.c +++ b/ruby.c @@ -1079,6 +1079,7 @@ proc_options(long argc, char **argv, struct cmdline_options *opt, int envopt) opt->disable &= ~DISABLE_BIT(gems); } else { + opt->disable &= ~DISABLE_BIT(gems); add_gems(&opt->req_list, s); } } @@ -1414,7 +1415,11 @@ 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); -- cgit v1.2.3