New dsl method: lazy(&block)
Make possible to lazy define tasks in a namespace. The tasks are loaded only on lookup.
Lazy definitions can be executed on purpose when using the option
--load-lazy-definitions so that rake --tasks --load-lazy-definitions
list all tasks including the one defined in a lazy way.
Example of lazy definitions:
namespace 'a' do
lazy { task 't' }
end
or
namespace 'a' do
lazy { load 'namespace_a.rake' }
end
This is awesome! I am in need of something like this, and would love to see this merged and released if possible.
I'm surprised this doesn't have more traction... Everyone enjoys longer load times because they're loading extra code they don't need all the time I suppose?
Any words from maintainers what it would take to get this merged? Thanks!