juretta.com

Rails-Rdoc task fails on Windows

August 07, 2006
Tags: Rails Rake Ruby

Using the most recent version of Rails the rdoc rake task fails on my windows test box.

A quick and simple hack enables the rdoc task.

Replace:
Rake::RDocTask.new("appdoc") { |rdoc|
  rdoc.rdoc_dir = 'doc/app'
  rdoc.title    = "Rails Application Documentation"
  rdoc.options << '--line-numbers --inline-source'
  rdoc.rdoc_files.include('doc/README_FOR_APP')
  rdoc.rdoc_files.include('app/**/*.rb')
}

with:

task "appdoc" do
   require 'rdoc/rdoc'
   rdoc = RDoc::RDoc.new
   options = Array.new
   #options << '-a'   # parses all methods (include protected, private)
   #options << '-cUTF-8' # you may want to set the charset
   options << '-odoc/app'
   options << '--line-numbers'
   options << '--inline-source'
   options << '-Thtml'
   options << 'doc/README_FOR_APP'
   Dir.glob('app/**/*.rb').each do |file|
    options << file
   end
   rdoc.document(options)    
end
Update: see http://dev.rubyonrails.org/ticket/2018 for further information.

About

This is the defunct blog of Stefan Saasen.