[Rubygems-developers] Idea: more detailed file and rdoc specification

Gavin Sinclair gsinclair at soyabean.com.au
Sat Dec 6 20:26:30 EST 2003


I was halfway towards implementing this idea when I thought it would
be good to raise it for discussion.  Take a look at the (invalid)
specification below.  The things to notice are in their own paragraph.

  require 'rubygems'
  require 'rake'

  spec = Gem::Specification.new do |s|
    s.name = 'extensions'
    s.version = File.read("VERSION").strip
    s.platform = Gem::Platform::RUBY
    s.summary = "Ruby/Extensions adds commonly-used extensions to core classes."

    s.files = Gem::Specification::Files.new do |gf|
      gf.lib = FileList["lib/**/*.rb"]
      gf.bin = FileList["bin/*"]
      gf.doc = FileList[%w{README README.1st ChangeLog HISTORY}]

    s.rdocspec = Gem::Specification::RDocSpec.new do |rs|
      rs.files = s.files.lib + "README"
      rs.title = "Ruby/Extensions API Documentation"
      rs.main = "README"

    s.require_path = 'lib'
    s.autorequire = 'extensions/all'
    s.author = "Gavin Sinclair"
    s.email = "gsinclair at soyabean.com.au"
    s.rubyforge_project = "extensions"
    s.homepage = "http://extensions.rubyforge.org"

  if $0 == __FILE__

My idea is this: a Gem should be aware of what kinds of files it's
dealing with.  'lib' files are pretty much what we specify to s.files
now.  'bin' files; well, we don't really know what to do with them at
the moment, but they are different from 'lib' files.  And 'doc' files,
it's pretty obvious what to do with them: put them in the
"doc/<gem-version>" directory.

Now a separate matter: RDoc.  I like what Rich has done so far.  Now
it's time to extend it, by specifying exactly what files are to be
included, and specifying the main page and the title.  I don't think
there's any more input that RDoc needs.

Anyway, I would happily keep working to implement these features, but
I need to know whether you guys think it's useful and generally agree
with the approach.


More information about the Rubygems-developers mailing list