[Rubygems-developers] require_gem/autorequire vs require.

Jim Freeze rubygems at freeze.org
Thu Jun 2 10:31:23 EDT 2005


* Jim Weirich <jim at weirichhouse.org> [2005-06-02 13:25:38 -0000]:

> 
> Jim Freeze said:
> >>  05) activate_gem
> >>  06) gem_activate  # reminds me of "wonder twin powers...activate!"
> >>  13) Gem.activate
> >>  16) activate
> >
> > Which reminds me, will there be a deactivate?
> 
> None currently planned.  Do you have a reasonable use case for one?

Well, I don't think it would make sense to do an activate, require the gem,
and then change the active gem since there is not a clean way to
un-require a gem.

However, consider the following scenario:

  activate some_gemlib, "= 1.2.3" # this activates some_subgemlib, "= 1.0.0"
                                  # but the libraries are not loaded
  deactivate some_subgemlib
  activate some_subgemlib, "= 2.0.0"
  # go about business as usual with some_gemlib now using v 2.0.0 of
  # some_subgemlib
  
However, this may be equivalent to:

  activate some_gemlib, "= 1.2.3" # this activates some_subgemlib, "= 1.0.0"
  # no deactivate statement. Is overridden with second activate
  activate some_subgemlib, "= 2.0.0"
  # go about business as usual using some_subgemlib v 2.0.0.

Thoughts?

-- 
Jim Freeze
Theory and practice are the same, in theory. -- Ryan Davis


More information about the Rubygems-developers mailing list