# Problem with RDoc

**URL:** <https://www.ruby-forum.com/t/problem-with-rdoc/101474>\
**Category:** Ruby\
**Created:** [August 5, 2006, 5:35am UTC](https://www.ruby-forum.com/t/problem-with-rdoc/101474 "2006-08-05T05:35:42Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![farfignugen](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/f17d59/32.png) [@farfignugen](https://www.ruby-forum.com/u/farfignugen)\
**Post date:** [August 5, 2006, 5:35am UTC](https://www.ruby-forum.com/t/problem-with-rdoc/101474/1 "2006-08-05T05:35:42Z")

</div>

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)

---

<div class="post-metadata">

**Author:** ![farfignugen](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/f17d59/32.png) [@farfignugen](https://www.ruby-forum.com/u/farfignugen)\
**Post date:** [August 5, 2006, 4:36pm UTC](https://www.ruby-forum.com/t/problem-with-rdoc/101474/2 "2006-08-05T16:36:10Z")

</div>

On Aug 4, 2006, at 10:35 PM, Chris G. 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 T.

---

<div class="post-metadata">

**Author:** ![farfignugen](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/f17d59/32.png) [@farfignugen](https://www.ruby-forum.com/u/farfignugen)\
**Post date:** [August 5, 2006, 5:33pm UTC](https://www.ruby-forum.com/t/problem-with-rdoc/101474/3 "2006-08-05T17:33:15Z")

</div>

On Aug 5, 2006, at 7:34 AM, Dave T. 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.

---

<div class="post-metadata">

**Author:** ![farfignugen](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/f17d59/32.png) [@farfignugen](https://www.ruby-forum.com/u/farfignugen)\
**Post date:** [August 6, 2006, 3:19am UTC](https://www.ruby-forum.com/t/problem-with-rdoc/101474/4 "2006-08-06T03:19:12Z")

</div>

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

> 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

---

<div class="post-metadata">

**Author:** ![farfignugen](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/f17d59/32.png) [@farfignugen](https://www.ruby-forum.com/u/farfignugen)\
**Post date:** [August 6, 2006, 4:49pm UTC](https://www.ruby-forum.com/t/problem-with-rdoc/101474/5 "2006-08-06T16:49:53Z")

</div>

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

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

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