From: Richard Kilmer Date: 2003-12-01T23:25:13+09:00 Subject: Re: rdoc included in standard distribution? On Dec 1, 2003, at 9:01 AM, Gavin Sinclair wrote: > While I want to see rdoc in the standard library, I find it strange > that it should occupy space in the lib directory. Unless I'm > mistaken, it's not really a library; rather an application. It is a library...rdoc is just a command line interface to the library > > Still, I guess my perception could change. One day we'll see people > doing this: > > require 'rdoc' > > rdoc = RDoc.new(template, title, ....) > rdoc.generate(*files) I just added this to RubyGems: require 'rdoc/rdoc' rdoc_dir = File.join(@doc_dir, "rdoc") source_dirs = @spec.require_paths.collect do |req| File.join(@spec.installation_path, @spec.full_name, req) end r = RDoc::RDoc.new r.document(['--op', rdoc_dir, '--template', 'kilmer'] + source_dirs) One of the cool things (of many cool things) Dave did in RDoc is make the #document method accept the ARGV array (or a manually constructed array like above) which makes using it from Ruby very simple. -rich > > instead of > > command = "rdoc -T #{template} --title #{title} ..."] > system command > > Hmmm. I like it already. > > Gavin