Within a rake task how does one query the description? Something that would give:
desc \"Populate DB\"
task populate: :environment do
puts task.desc # \"Popula
Having a similar problem, that I wanted to show the user a customized help screen. The answer here helped me a lot.
It is very important that
Rake::TaskManager.record_task_metadata = true
is done before the first definition of tasks.
Then you can do
Rake.application.tasks.each do |t|
printf("%-}s # %s\n",
t.name_with_args,
t.comment)
end
Details can be found by investigating https://github.com/jimweirich/rake/blob/master/lib/rake/application.rb#L284