Gem::Enable is false when --disable-gems and -rubygems

Yuguie$B$G$9!#e(B

$ ruby --disable-gems -rubygems -ve ‘p Gem::Enable’
ruby 1.9.0 (2008-04-16 revision 0) [i686-darwin9.2.2]
false

e$B$3$N>l9g!"7k6Ie(BRubyGemse$B$OM-8z$K$J$C$F$$$k$N$Ge(B
Gem::Enablee$B$Oe(Btruee$B$K$J$C$F$$$k$Y$-$G$7$g$&$+e(B?

Index: lib/rubygems.rb

— lib/rubygems.rb (revision 16064)
+++ lib/rubygems.rb (working copy)
@@ -13,6 +13,8 @@
class LoadError < ::LoadError
attr_accessor :name, :version_requirement
end

  • remove_const(:Enable) if const_defined?(:Enable)
  • const_set(:Enable, true)
    end

module Kernel

[email protected]$G$9!#e(B

At Fri, 18 Apr 2008 00:59:51 +0900,
Yugui wrote in [ruby-dev:34447]:

$ ruby --disable-gems -rubygems -ve ‘p Gem::Enable’
ruby 1.9.0 (2008-04-16 revision 0) [i686-darwin9.2.2]
false

e$B$3$N>l9g!"7k6Ie(BRubyGemse$B$OM-8z$K$J$C$F$$$k$N$Ge(B
Gem::Enablee$B$Oe(Btruee$B$K$J$C$F$$$k$Y$-$G$7$g$&$+e(B?

Gem::Enablee$B$Oe(Brubygemse$B$,%m!<%I$5$l$F$$$k$+!"$H$$$&%U%i%0$G$O$J$/e(B
e$B$F!"%G%U%)%k%H$G%m!<%I$9$k$+$re(Bgem_prelude.rbe$B$KEA$([email protected]$1$N%Ue(B
e$B%i%[email protected]$H;W$$$^$9!#$7$+$7!"e(BEnablee$B$H$$$&Dj?t$^$G$OITMW$G$O$J$$$+$He(B
e$B$$$&5$$b$7$^$9!#e(B

Index: ruby.c

— ruby.c (revision 16057)
+++ ruby.c (working copy)
@@ -915,7 +915,5 @@ static void
ruby_init_gems(int enable)
{

  • VALUE gem;
  • gem = rb_define_module(“Gem”);
  • rb_const_set(gem, rb_intern(“Enable”), enable ? Qtrue : Qfalse);
  • if (enable) rb_define_module(“Gem”);
    Init_prelude();
    }
    Index: gem_prelude.rb
    ===================================================================
    — gem_prelude.rb (revision 16057)
    +++ gem_prelude.rb (working copy)
    @@ -3,7 +3,7 @@

empty gem_prelude.rb

-# p Gem::Enable
+# p defined?(Gem)

-if defined?(Gem::Enable) && Gem::Enable then
+if defined?(Gem) then

module Kernel

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs