Using a rake file to generate documents from a source

I downloaded the ruby ​​twitter gem source code and am trying to create documentation using the yard that I installed through the gem install yard . In rakefile, I found the following, which I believe is used to create documents for the Twitter gem:

 require 'yard' YARD::Rake::YardocTask.new 

I tried require yard in irb and then ran YARD::Rake::YardocTask.new but nothing happened.

Can you help me on the right track?

+4
source share
1 answer

From the YARD docs :

The second most obvious one is creating documents using the Rake task. You can do this by adding the following to your Rakefile :

 YARD::Rake::YardocTask.new do |t| t.files = ['lib/**/*.rb', OTHER_PATHS] # optional t.options = ['--any', '--extra', '--opts'] # optional end 

files and options are optional. files will be by default lib/**/*.rb and options will be presented any parameters that you might want to add. Again, a complete list of options is available by typing yardoc --help in the shell. You can also override options on the Rake command line with the OPTS environment variable:

 $ rake yard OPTS='--any --extra --opts' 

To summarize: adding YARD::Rake::YardocTask.new to your Rakefile , run rake yard .

+13
source

Source: https://habr.com/ru/post/1441432/


All Articles