Forum: Ruby Problem with rdoc and Document-class

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Aee77dba395ece0a04c688b05b07cd63?d=identicon&s=25 Daniel Berger (Guest)
on 2007-01-03 20:42
(Received via mailing list)
Hi all,

Ruby 1.8.5
Solaris 10

For some reason the class level documentation isn't being generated
when I run rdoc over this file, except for the 'MyTest' module.  Foo
and Bar show nothing. What am I doing wrong here?

/* mytest.c */
#include <ruby.h>

/* Some random test method */
static VALUE foo_test(VALUE self){
   return rb_str_new2("hello");

/* To quench your thirst */
static VALUE bar_drink(VALUE self){
   return rb_str_new2("gulp");

void Init_mytest(){
    * Document-module: Test
    *    The MyTest module, where we, like, test stuff.
   VALUE mTest = rb_define_module("MyTest");

    * Document-class: Foo
    *    Foo, Kung's second cousin, twice removed.
   VALUE cFoo = rb_define_class_under(mTest, "Foo", rb_cObject);

    * Document-class: Bar
    *    Bar, a class, not a drinking establishment.
   VALUE cBar = rb_define_class_under(mTest, "Bar", rb_cObject);

   rb_define_method(cFoo, "test", foo_test, 0);
   rb_define_method(cBar, "drink", bar_drink, 0);


This topic is locked and can not be replied to.