From: trans Date: 2009-10-02T10:58:44+09:00 Subject: Re: Making an RDoc Template Gem On Oct 1, 7:06 pm, trans wrote: > Hi again--- > > On Oct 1, 1:32 pm, Gordon Thiesfeld wrote: > > > I think the best way to do it is as an rdoc plugin.  RDoc_chm[1] is an > > RDoc plugin to.  RDoc searches for lib/rdoc/discover.rb in gems, and > > loads them.  You have to have a require in discover.rb.  This will add > > your gem's lib and bin to $LOAD_PATH.  I'm not totally sure how that > > works, if it's a feature of RubyGems, or RDoc.  If you have no ruby > > code in your template, you can just use "require 'rdoc/discover'". > > The Darkfish generator searches for a template dir of the name > > provided on the command line.  If no template is given, it defaults to > > the name of the generator. > > Unfortunately the discover.rb thing does not work. I'm not sure what > RDoc is doing --it doesn't seem like it is doing anything in this > regard actually. To get my RDoc to discover my template I somehow have > to run: > >   gem 'rdazzle' > > So it will be on the #LOAD_PATH. The only place to do that is say a > Rakefile and use rake to generate the rdocs, or to add RUBYTOPT="- > rrdazzle". Final follow-up on this. I verified that indeed discover.rb is being loaded, but to get my template to be located I had to add: gem 'rdazzle' to the top of the discover.rb file. Why the require wan;t enough I don't know. But the gem call seemed to do the trick. Note that using: gem 'rdoc', ">= 2.4" in the subsequently required file (i.e. where the subclass of Darkfish is defined) caused some error for RubyGems. Is RubyGems dependent on 2.3 series? In any case I just omitted that whole file for now. Thanks for the help, and I hope this thread might be helpful to others if they want to create their own RDOC template plugins. T.