Gurus (Guri?  heh),
We got burned today by #2018 ("rake appdoc fails on Windows systems"),
and did a bunch of ferreting around (starting at the problems in
rdoc,rake,rdoc.bat) and ultimately came back to the conclusion that the
cleanest way to fix the problem is just a variation on a suggestion
already posted in that ticket.

I wrote up a patch against trunk from the suggestion there and verified
that the problem is solved on Windows and the appdoc generation still
works on Linux.  The patch is a simple change to the :appdoc rake task
in railties and looks like:


--- rails/railties/lib/tasks/documentation.rake 2005-11-16 23:58:48.000000000 
-0500
+++ rails-ours/railties/lib/tasks/documentation.rake    2005-12-20 
16:21:53.000000000 -0500
@@ -1,11 +1,10 @@
 desc "Generate documentation for the application"
-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')
-}
+task :appdoc do
+  require 'rdoc/rdoc'
+  opt = ['-odoc/app', '--line-numbers', '--inline-source', '-Thtml']
+  ['doc/README_FOR_APP', 'app/**/*.rb'].each { |p| opt << 
Dir.glob(File.join(RAILS_ROOT, p)) }
+  RDoc::RDoc.new.document(opt.flatten)
+end
 
 plugins = FileList['vendor/plugins/**'].map {|plugin| File.basename(plugin)}
 # Define doc tasks for each plugin


The ticket's been around since 0.13.1 for no good reason, and I figure
anyone weird enough to both use Windows for development *and* write
well-documented code is a force to be reckoned with (yours truly doesn't
count-- I have developers who use Windows but I'm the one
forcing^Wenticing them to write the RDoc) and we should probably just
fix the rake task and get out of their way.

Anyway, if someone could see through to checking the ticket over that
would be cool.

Best,
Rick
-- 
 http://www.rickbradley.com    MUPRN: 958
                       |  that I've been cracking
   random email haiku  |  keys since November 5th Has
                       |  it been that long? Sheesh...
_______________________________________________
Rails-core mailing list
Rails-core@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-core

Reply via email to