Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > RDOC Question -- including parent class accessors, and linking other classes

Reply
Thread Tools

RDOC Question -- including parent class accessors, and linking other classes

 
 
John Wilger
Guest
Posts: n/a
 
      11-12-2004
Hello,

I apologize for the cross-post, but I was advised that this list is a
lot more active than the ruby-doc list and I might get an answer
faster by posting my question here. Please see below:


On Fri, 12 Nov 2004 14:17:59 -0500, John Wilger <(E-Mail Removed)> wrote:
> Hello,
>
> I have acouple of quick questions regarding RDOC, but I can't seem to
> find the information anywhere in the RDOC documentation (or even with
> a Google search).
>
> Lets say I have a parent class like:
>
> class ParentClass
> attr_reader arent_reader
> end
>
> And I have a child class like:
>
> class ChildClass
> attr_reader :child_reader
> end
>
> What would I have to do to have both "ChildClass#child_reader" _and_
> "ChildClass#parent_reader" documented in the RDOC class file for
> ChildClass? Currently, I only see "ChildClass#child_reader" in the
> docs for ChildClass, and you have to view the parent class to see the
> documentation for "ParentClass#parent_reader".
>
> Also, my generated RDOC documentation does not seem to automatically
> be creating links out of class names in the documentation. I am
> developing an application with Rails, and I have some code placed in
> the 'lib' subdirectory. In some of the documentation comments, I refer
> to the name of a model class which is stored in the 'app/models'
> subdirectory. However, the HTML documentation does not create a link
> from the class in 'lib' to the model class when I run rdoc from the
> command line above both directories. Any thoughts?


--
Regards,
John Wilger

-----------
Alice came to a fork in the road. "Which road do I take?" she asked.
"Where do you want to go?" responded the Cheshire cat.
"I don't know," Alice answered.
"Then," said the cat, "it doesn't matter."
- Lewis Carrol, Alice in Wonderland


 
Reply With Quote
 
 
 
 
Dave Thomas
Guest
Posts: n/a
 
      11-12-2004

On Nov 12, 2004, at 12:42, John Wilger wrote:

>> What would I have to do to have both "ChildClass#child_reader" _and_
>> "ChildClass#parent_reader" documented in the RDOC class file for
>> ChildClass? Currently, I only see "ChildClass#child_reader" in the
>> docs for ChildClass, and you have to view the parent class to see the
>> documentation for "ParentClass#parent_reader".


RDoc doesn't currently let you do this: the problem really is knowing
where to stop--do you document all of the parent's methods, and its
parent's methods, and so on.

I'm open to ideas here.

>> Also, my generated RDOC documentation does not seem to automatically
>> be creating links out of class names in the documentation. I am
>> developing an application with Rails, and I have some code placed in
>> the 'lib' subdirectory. In some of the documentation comments, I refer
>> to the name of a model class which is stored in the 'app/models'
>> subdirectory. However, the HTML documentation does not create a link
>> from the class in 'lib' to the model class when I run rdoc from the
>> command line above both directories. Any thoughts?


Could you email me a minimal set of source files that exhibit the
problem?

Cheers

Dave



 
Reply With Quote
 
 
 
 
John Wilger
Guest
Posts: n/a
 
      11-13-2004
My reply didn't go to the list due to the attachment I was sending to
Dave, so here it is.


On Fri, 12 Nov 2004 15:38:57 -0500, John Wilger <(E-Mail Removed)> wrote:
> Dave,
>
> I doubt the list allows attachments, so I put your address in the 'to'
> field as well so you can get the sample code.
>
> On Sat, 13 Nov 2004 04:54:05 +0900, Dave Thomas <(E-Mail Removed)> wrote:
> > RDoc doesn't currently let you do this: the problem really is knowing
> > where to stop--do you document all of the parent's methods, and its
> > parent's methods, and so on.
> >
> > I'm open to ideas here.

>
> How about including a tag like "#:document_inherited:"? This would
> include the inherited methods/accessors of the immediate parent only
> in the current class. However, if the immediate parent also specified
> the "#:document_inherited:" tag, then the child class would document
> it's grand-parent's methods/accessors as well (unless they were
> overriden down the chain), and so on, and so forth on up the line.
>
> >
> > Could you email me a minimal set of source files that exhibit the
> > problem?

>
> I think I figured out what is causing the problem. The class inside
> the 'lib' directory is defined within a module, but the class inside
> 'app/models' is not. Apparently RDOC will only create the link to
> other classes within its namespace if you don't specify the namespace
> explicitly. So what would the explicit namespace be for a class that
> isn't inside a module?
>
> I've attached a paired down sample for you to look at.


--
Regards,
John Wilger

-----------
Alice came to a fork in the road. "Which road do I take?" she asked.
"Where do you want to go?" responded the Cheshire cat.
"I don't know," Alice answered.
"Then," said the cat, "it doesn't matter."
- Lewis Carrol, Alice in Wonderland


 
Reply With Quote
 
Dave Thomas
Guest
Posts: n/a
 
      11-13-2004

On Nov 12, 2004, at 13:38, John Wilger wrote:
>
> I think I figured out what is causing the problem. The class inside
> the 'lib' directory is defined within a module, but the class inside
> 'app/models' is not. Apparently RDOC will only create the link to
> other classes within its namespace if you don't specify the namespace
> explicitly. So what would the explicit namespace be for a class that
> isn't inside a module?


Strangely, the stuff you sent me worked here (at least the link to the
Project class worked from the ProjectStatus class). Are you running the
latest RDoc?


Cheers

Dave



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
If a class Child inherits from Parent, how to implementChild.some_method if Parent.some_method() returns Parent instance ? metal Python 8 10-30-2009 10:31 AM
RDoc: How to link to a method description from other rdoc page? Iñaki Baz Castillo Ruby 3 07-28-2009 09:03 PM
RDoc question: How do I make a link from the README file to aspecific RDOC Page Jesper Rønn-Jensen Ruby 4 02-22-2008 10:58 PM
[Rdoc-bug] wrong parent class using Mod::Class syntax Michael Neumann Ruby 1 11-08-2004 01:25 PM
[RDOC] Using a template causes rdoc not to document some classes Daniel Berger Ruby 1 11-02-2004 08:23 PM



Advertisments