[Rubygems-developers] Using own stub code

Michael Neumann mneumann at ntecs.de
Thu Jun 3 19:42:44 EDT 2004

On Thu, Jun 03, 2004 at 06:41:01PM -0400, Chad Fowler wrote:
> On 3/6/2004, at 9:29 AM, Michael Neumann wrote:
> >Hi,
> >
> >I encountered a problem during gemifying a DBD (Database Driver).
> >They are required to be installed into e.g. site_ruby/1.8/DBD/Pg for 
> >the
> >Pg (Postgres) DBD. Maybe, I should build versioning into DBI, so that I
> >can write:
> >
> >  DBI.connect("dbi:Pg(0.1.0):db", ...)
> >
> >and this would
> >
> >  require_gem 'dbd-pg', '0.1.0'
> >
> >Or could I tell rubygems to install a stub as DBD/Pg/Pg.rb? Inside the
> >gemspec? That would be much easier.
> You should be able to have it do this if you specify DBD/Pg/Pg.rb as 
> the autorequire file.  Then you need to --install-stub during 

No that does not work. A DBD/Pg/Pg stub is installed with --install-stub
given. But the Pg.rb file is not loaded:

  require 'dbi'
  require_gem 'dbd-pg'

Both lines return true. But I've inserted a print statement into Pg.rb,
and it is not executed! Strange.



More information about the Rubygems-developers mailing list