From: Patrick Hurley Date: 2005-03-25T23:27:34+09:00 Subject: Re: Rake, rdoc, and Windows FYI under xp batch files support a %* notation to mean all the command paramerters, so if rdoc.bat was changed from: @echo off "c:\ruby\bin\ruby.exe" "c:\ruby\bin\rdoc" %1 %2 %3 %4 %5 %6 %7 %8 %9 to: @echo off "c:\ruby\bin\ruby.exe" "c:\ruby\bin\rdoc" %* would work better - I do not have older versions of Windows to check this on - sry Patrick ------------------- @echo off "c:\ruby\bin\ruby.exe" "c:\ruby\bin\rdoc" %* On Fri, 25 Mar 2005 23:06:32 +0900, Jim Menard wrote: > Herein is described a problem with using Rake's RDocTask on Windows, and a > proposed workaround. The workaround works well enough, but does anybody else > have a better one? > > While prepping my latest project for gemhood, I came across a problem with the > rdoc task when used on Windows XP: it didn't work. This is documented in a few > old ruby-talk posts. (See > http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/118963?help-en and > http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/118968 for some > proposed solutions). > > Even after fixing the problem by applying the patch described in 118968, there > was still another problem: the rdoc.bat file (and all Windows batch files) > only take up to nine arguments. Eight command line options are used by the > rdoc command before the first file is even mentioned: > > rdoc.bat -o html --main 'README' --title 'MyProjectName' -T 'html' README TODO > lib/xx.rb lib/xx/file1.rb lib/xx/file2.rb ... > > Here's what I have come up with: instead of the method proposed in 118968 > > def rdoc > RUBY_PLATFORM =~ /win32/ ? 'rdoc.bat' : 'rdoc' > end > > (and the associated change in RDocTask#define that calls this method), I use > > def rdoc > return 'rdoc' unless RUBY_PLATFORM =~ /win32/ > require 'rbconfig' > bindir = Config::CONFIG['bindir'] > return "#{File.join(bindir, 'ruby.exe')} #{File.join(bindir, 'rdoc')}" > end > > Will this work on all Windows systems, and is it the right thing to do? If so, > is it an appropriate addition to Rake itself? > > Jim > -- > Jim Menard, jimm@io.com, http://www.io.com/~jimm > "This looks like a job for emergency pants!" -- Torg, www.sluggy.com > >