rake and rdoc help needed - target seems to be generated twice

Discussion in 'Ruby' started by Kelly Felkins, Apr 5, 2006.

  1. ------=_Part_10925_28009415.1144199577719
    Content-Type: text/plain; charset=ISO-8859-1
    Content-Transfer-Encoding: quoted-printable
    Content-Disposition: inline

    Hello,

    I set up some rake tasks to generate documentation for my rails app. I
    started with the doc:app task from rails and the rdoctask in rake
    definitions. I'm learning rake so please go easy on me. ;-) Here is what I
    came up with:

    desc "Generate API Documentation"
    SRC =3D
    FileList['doc/README_FOR_APP','doc/REQUIREMENTS','doc/DESIGN','app/**/*.rb'=
    ]
    file "doc/app/index.html" =3D> SRC do
    rm Dir.glob('doc/app/**/*.html')
    require 'rdoc/rdoc'
    options =3D []
    options << "-o" << 'doc/app'
    options << "--title" << "Goals System"
    RDoc::RDoc.new.document( options+SRC )
    end

    task :gendocs =3D> "doc/app/index.html"

    desc "Clobber API Documentation"
    task :clobberdocs do
    rm Dir.glob('doc/app/**/*.html')
    end


    When I do

    rake --trace gendocs

    It appears the documentation is generated, then deleted, then generated
    again.

    ???

    That's my question -- why does it generate, delete, and then generate it
    again.


    Additional background:

    I'm trying to address 2 problems:

    1. I want to include doc/REQUIREMENTS, and doc/DESIGN in my rdoc run.
    2. We have a policy here of saving generated documentation in cvs. The
    rdoctask that comes with rake does a rm_r, deleting everything in the ta=
    rget
    directory including .CVS files. This makes it difficult to do a commit t=
    o
    cvs.

    Thank you.

    -Kelly

    ------=_Part_10925_28009415.1144199577719--
     
    Kelly Felkins, Apr 5, 2006
    #1
    1. Advertisements

  2. Kelly Felkins

    Jim Weirich Guest

    I'm getting this:

    -------------------------------------------
    $ rake gendocs --trace
    (in /media/hda5/jim/pgm/ruby/rake/docapi)
    ** Invoke gendocs (first_time)
    ** Invoke doc/app/index.html (first_time)
    ** Invoke doc/README_FOR_APP (first_time, not_needed)
    ** Invoke doc/REQUIREMENTS (first_time, not_needed)
    ** Invoke doc/DESIGN (first_time, not_needed)
    ** Invoke app/code.rb (first_time, not_needed)
    ** Execute doc/app/index.html
    rm doc/app/fr_file_index.html doc/app/fr_class_index.html
    doc/app/fr_method_index.html doc/app/index.html
    doc/app/files/doc/README_FOR_APP.html
    doc/app/files/doc/REQUIREMENTS.html doc/app/files/doc/DESIGN.html
    doc/app/files/app/code_rb.html doc/app/classes/Code.html

    README_FOR_APP:
    REQUIREMENTS:
    DESIGN:
    code.rb: c
    Generating HTML...

    Files: 4
    Classes: 1
    Modules: 0
    Methods: 0
    Elapsed: 0.079s
    ** Execute gendocs
     
    Jim Weirich, Apr 5, 2006
    #2
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.