Is it possible to get a list of all available rake tasks in a namespace?

后端 未结 3 567
名媛妹妹
名媛妹妹 2020-12-31 02:13

Is it possible from within a rake task to get a list of tasks in a namespace? A sort of programatic \'rake -T db\' ?

3条回答
  •  無奈伤痛
    2020-12-31 02:16

    I've found out the answer:

    tasks = Rake.application.tasks
    

    This will return an array of Rake::Task objects that can be examined. Further details at http://rake.rubyforge.org/

提交回复
热议问题