Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New dsl method: lazy(&block) #339

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

lionelperrin
Copy link

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

@TSMMark
Copy link

TSMMark commented Jun 9, 2020

This is awesome! I am in need of something like this, and would love to see this merged and released if possible.

@TSMMark
Copy link

TSMMark commented May 5, 2023

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!

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
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants