1

I am using Ruby on Rails 3.0.7 and I am writing some documentation for my application using RDoc. Since I have not found on the Web some good documentation with examples, what I would like to know is how to use the :include: directive at all.

Can you make me an example of using that in application files?

user502052
  • 14,803
  • 30
  • 109
  • 188

2 Answers2

0

AIUI, :include: allows you to (surprise) include the contents of another file, keeping the same indentation level of the block in which the include appears.

It will look for the named file in the current directory, but it's something you can override by means of the --include switch.

If you want an example, this could prove useful.

s.m.
  • 7,895
  • 2
  • 38
  • 46
0

Here is the doc: http://rdoc.rubyforge.org/RDoc/Markup.html

And here is a very basic example:

First a ruby file, say /tests/my_func.rb

#:include: doc.txt 

def my_function
  puts "yo"
end 

Then a doc /tests/documentations/doc.txt

This describes the method very well

In command line (executed from /tests):

rdoc -i /Users/benjaminroth/Sites/Tests/rdoc/descriptions
apneadiving
  • 114,565
  • 26
  • 219
  • 213