Hi,
rdoc cann't treat C extention library consisting of many *.c files. An outer module and
its inner classes should be defined in the same file.
For example, rdoc causes errors with Ruby/OpenSSL as follows:
$ rdoc --op /tmp/openssl ext/openssl/ossl.c ext/openssl/ossl_cipher.c
ossl.c: No definition for ossl_debug_get
No definition for ossl_debug_set
ossl_cipher.c: Enclosing class/module 'mOSSL' for module Cipher not known
Enclosing class/module 'mOSSL' for class CipherError not known
Enclosing class/module 'mCipher' for class Cipher not known
because mOSSL is defined in ossl.c and mChiper is defined in ossl_cipher.c.
The following patch solves this problem.
Index: parse_c.rb
===================================================================
RCS file: /src/ruby/lib/rdoc/parsers/parse_c.rb,v
retrieving revision 1.25
diff -u -1 -r1.25 parse_c.rb
--- parse_c.rb 9 Sep 2004 02:47:35 -0000 1.25
+++ parse_c.rb 28 Jan 2005 02:45:45 -0000
@@ -171,2 +171,3 @@
+ @@enclosure_classes = {}
@@known_bodies = {}
@@ -210,3 +211,3 @@
if in_module
- enclosure = @classes[in_module]
+ enclosure = @classes[in_module] || @@enclosure_classes[in_module]
unless enclosure
@@ -231,2 +232,3 @@
@classes[var_name] = cm
+ @@enclosure_classes[var_name] = cm
@known_classes[var_name] = cm.full_name
Regards,
--
sheepman / TAMURA Takashi
sheepman / tcn.zaq.ne.jp http://sheepman.parfait.ne.jp/