[Rubygems-developers] library stub again

Chad Fowler chad at chadfowler.com
Wed Jun 9 21:07:05 EDT 2004



On Thu, 10 Jun 2004, Pierre Baillet wrote:

# Hello,
#
# >From what I understood in the ml archives and in some examples, to
# include in some code a gem'd library, one has to do something like:
#
# require 'rubygems'
# require_gem 'foo'
#
# instead of
#
# require 'foo'
#
# This means I have to alter all the program using this library to have a
# custom version that is used whenever my gem is installed, doesn't it ?
#
# I was wondering if there couldn't be some way (I don't have the answer,
# that's why I'm asking, of course) to override the kernel require with
# some special rubygem require so as to make the gems work on unmodified
# application code... ?
#
# Moreover, will I have to use the same construct from 'inside' a gem'd
# library (imagine foo.rb was doing a require 'bar' and bar.rb is in the
# same folder as foo), or is the require_gem altering the include path so
# as to provide full access to other files in my gem ?


Hi, Pierre.  Have you see the --install-stub option for the gem command?
It is now the default, so any gem that gets installed should also install
a stub.  Have a look and tell us if this answers your question.

Thanks,
Chad


More information about the Rubygems-developers mailing list