Telling rdoc1.9 not delete the doc directory when publishing newdocumenation

Z

Zeno Davatz

Hi

I know that with

rdoc1.9 --op doc3

I can set a specific doc directory where rdoc1.9 should publish the
documentation to.

BUT:

rdoc1.9 always _deletes_ the old doc dir before publishing the new one!
So If I got another doc Directory there and that has other stuff in it
then I do not appreciate it when that directory is just overwritten or
deleted with out myself being asked if I want it deleted or not.

So my question is: Is there any possibility to tell rdoc1.9 not to
delete any existing doc directory?

Thank you for your Feedback.

Best
Zeno
 
R

Ryan Davis

Hi
=20
I know that with
=20
rdoc1.9 --op doc3
=20
I can set a specific doc directory where rdoc1.9 should publish the
documentation to.
=20
BUT:
=20
rdoc1.9 always _deletes_ the old doc dir before publishing the new =
one!

9202 % rdoc --op xxx
Parsing sources...
100% [40/40] test_notes.rb =
=20

Generating Darkfish...

Files: 40
Classes: 33 ( 25 undocumented)
Constants: 18 ( 18 undocumented)
Modules: 18 ( 10 undocumented)
Methods: 318 ( 252 undocumented)
21.19% documented

Elapsed: 7.3s
9202 % touch xxx/y
9203 % rdoc --op xxx
Parsing sources...
100% [41/41] xxx/y =
=20

Generating Darkfish...

Files: 41
Classes: 33 ( 25 undocumented)
Constants: 18 ( 18 undocumented)
Modules: 18 ( 10 undocumented)
Methods: 318 ( 252 undocumented)
21.19% documented

Elapsed: 7.5s
9204 % ls -l xxx/y
-rw-rw-r-- 1 ryan staff 0 Feb 11 10:17 xxx/y
 
E

Eric Hodel

Hi
=20
I know that with
=20
rdoc1.9 --op doc3
=20
I can set a specific doc directory where rdoc1.9 should publish the
documentation to.
=20
BUT:
=20
rdoc1.9 always _deletes_ the old doc dir before publishing the new = one!
So If I got another doc Directory there and that has other stuff in it
then I do not appreciate it when that directory is just overwritten or
deleted with out myself being asked if I want it deleted or not.
=20
So my question is: Is there any possibility to tell rdoc1.9 not to
delete any existing doc directory?

The rdoc command has never deleted directories. RDoc has always =
preserved existing directories that were not used for rdoc output.

The latest gem does not:

$ gem unpack rdoc
Unpacked gem: '/Users/ehodel/Work/git/rdoc/tmp/rdoc-3.5.2'
$ cd rdoc-3.5.2/
/rdoc-3.5.2/
$ grep -r \\.rm lib
lib/rdoc/gauntlet.rb: FileUtils.rm_rf dir if File.exist? dir
lib/rdoc/gauntlet.rb: FileUtils.rm_rf dir
$

Nor does the version shipped with 1.9.2-p136 (rdoc 2.5.8)

$ ~/.multiruby/install/1.9.2-p136/bin/ruby -v
ruby 1.9.2p136 (2010-12-25 revision 30365) [x86_64-darwin10.6.0]
$ ~/.multiruby/install/1.9.2-p136/bin/gem which rdoc
/Users/ehodel/.multiruby/install/1.9.2-p136/lib/ruby/1.9.1/rdoc.rb
$ cd /Users/ehodel/.multiruby/install/1.9.2-p136/lib/ruby/1.9.1/
$ grep -r \\.rm rdoc.rb rdoc
$

Nor does the version shipped with 1.9.1-p378 (rdoc 2.2.2)

$ ~/.multiruby/install/1.9.1-p378/bin/ruby -v
ruby 1.9.1p378 (2010-01-10 revision 26273) [i386-darwin10.6.0]
$ cd /Users/ehodel/.multiruby/install/1.9.1-p378/lib/ruby/1.9.1/
$ grep -r \\.rm rdoc.rb rdoc
rdoc/ri/writer.rb: FileUtils.rm_rf(path_to_dir(class_desc.full_name))

This rm_rf is called by the (old) ri generator when it is merging =
classes. The class is immediately replaced by the merged copy.

Same for ruby 1.8.7-p330 (rdoc 1.0.1)

$ ~/.multiruby/install/1.8.7-p330/bin/ruby -v
ruby 1.8.7 (2010-12-23 patchlevel 330) [i686-darwin10.6.0]
$ cd ~/.multiruby/install/1.8.7-p330/lib/ruby/1.8/
$ grep -r \\.rm rdoc
rdoc/ri/ri_writer.rb: =
FileUtils.rm_rf(path_to_dir(class_desc.full_name))

(no rdoc.rb in 1.0.1)

The RDoc rake task adds a clobber task for deleting the rdoc output =
directory. Since the files are generated this should not be a problem.=
 

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. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,777
Messages
2,569,604
Members
45,216
Latest member
topweb3twitterchannels

Latest Threads

Top