[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Problem with RDoc

Chris Gehlker

8/5/2006 3:35:00 AM

I have discovered an issue with RDoc that may or may not be old news,

Say I have a folder with a file named my_class.rb and a subfolder
named my_class. Within the my_class folder are two files named a.rb
and b.rb. a.rb contains:

class My_Class
def methA
...
end

def methB
...
end
end

while b.rb contains:

class My_Class
def methC
...
end

def methD
...
end
end

my_class.rb contains:

require 'my_class/a.rb
# there is no mention of b.rb here

RDoc will still document My_Class as having the methods in file b.rb

I don't know if this issue has been raised before and if it is worth
the trouble to address.

---
Neither a man nor a crowd nor a nation can be trusted to act humanely
or to think sanely under the influence of a great fear.

-Bertrand Russell, philosopher, mathematician, author, Nobel laureate
(1872-1970)



4 Answers

Dave Thomas

8/5/2006 2:35:00 PM

0


On Aug 4, 2006, at 10:35 PM, Chris Gehlker wrote:

> my_class.rb contains:
>
> require 'my_class/a.rb
> # there is no mention of b.rb here
>
> RDoc will still document My_Class as having the methods in file b.rb


RDoc documents the files you give it--it doesn't execute the code to
find out what files you use. You have two files, each of which adds
methods to My_Class, so it documents both sets of definitions.

Regards


Dave Thomas

Chris Gehlker

8/5/2006 3:30:00 PM

0


On Aug 5, 2006, at 7:34 AM, Dave Thomas wrote:

> RDoc documents the files you give it--it doesn't execute the code
> to find out what files you use. You have two files, each of which
> adds methods to My_Class, so it documents both sets of definitions.

Exactly.

I think one could make a good argument that this is the *right*
behavior. It can be a bit surprising though, given the practice of
some Ruby developers of distributing files that are 'in progress'
along with the files are actually required in their projects.
Sometimes these 'in progress' files actually contain more extensive
RDoc documentation than the files that are actually required into the
main class.

--
And those who were seen dancing were thought to be insane by those
who could not hear the music.
-Friedrich Wilhelm Nietzsche, philosopher (1844-1900)


Dave Thomas

8/6/2006 1:18:00 AM

0


On Aug 5, 2006, at 10:30 AM, Chris Gehlker wrote:

>> RDoc documents the files you give it--it doesn't execute the code
>> to find out what files you use. You have two files, each of which
>> adds methods to My_Class, so it documents both sets of definitions.
>
> Exactly.
>
> I think one could make a good argument that this is the *right*
> behavior. It can be a bit surprising though, given the practice of
> some Ruby developers of distributing files that are 'in progress'
> along with the files are actually required in their projects.
> Sometimes these 'in progress' files actually contain more extensive
> RDoc documentation than the files that are actually required into
> the main class.


You can use --exclude to ignore those files that are in development.


Dave

Chris Gehlker

8/6/2006 2:47:00 PM

0


On Aug 5, 2006, at 6:18 PM, Dave Thomas wrote:

> You can use --exclude to ignore those files that are in development.

Great suggestion. I don't know how i missed that.

--
A young idea is a beautiful and a fragile thing. Attack people, not
ideas.