Can a rake task know about the other tasks in the invocation chain?

Posted by andrewdotnich on Stack Overflow See other posts from Stack Overflow or by andrewdotnich
Published on 2010-05-10T23:45:37Z Indexed on 2010/05/11 0:44 UTC
Read the original article Hit count: 211

Filed under:
|
|
|

Rake (like make) is able to have many targets/tasks specified on invocation. Is it possible for a rake task to access the list of tasks the user invoked, in order to do its job?

Scenario:

Consider a Rake-based build tool. A help task would like to know what tasks were also specified in order to print their usage and halt the build process. The benefit of this as opposed to rake-style parameter passing are cleaner syntax (rake help build instead of rake help task=build) and chaining (rake help build run_tests would print usage for both).

© Stack Overflow or respective owner

Related posts about ruby

Related posts about rake