Problem with RDoc

C

Chris Gehlker

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)
 
D

Dave Thomas

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
 
C

Chris Gehlker

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.
 
D

Dave Thomas

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
 

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

Similar Threads


Members online

Forum statistics

Threads
473,781
Messages
2,569,615
Members
45,303
Latest member
Ketonara

Latest Threads

Top