开发者

Command to display all descriptions of rakefile tasks?

开发者 https://www.devze.com 2023-02-16 05:42 出处:网络
I know in Ant / Nant you can pass an argument like -projecthelp to get a list of avaialbe targets with descriptions.

I know in Ant / Nant you can pass an argument like -projecthelp to get a list of avaialbe targets with descriptions.

Is there a similar command-line argument for doing this with a rakefile's t开发者_运维技巧asks?

Also is there a way to generate documentation from the rakefile itself?


rake -T lists tasks rake --help shows other options

They are not necessarily 'targets' in Rakefiles though, they are just actions. Look at RDoc for documenting Ruby code


rake -P

Displays tasks and dependencies.

rake -T

Displays tasks and descriptions

rake -T [PATTERN]

Displays tasks and descriptions filtered by that PATTERN. A pattern might be anything from namespace:task_name without the leading rake and without the prepended # comment (your desc from above a task/method).

# Example
namespace :example do
        # ^ searchable
    desc "Some task doing things"
    task :example do
       # ^ searchable
        puts "Hello world"
    end
end
0

精彩评论

暂无评论...
验证码 换一张
取 消