8000 New dsl method: lazy(&block) by lionelperrin · Pull Request #339 · ruby/rake · GitHub
[go: up one dir, main page]

Skip to content

New dsl method: lazy(&block) #339

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

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
  la
8000
zy { 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
```
@gillisd
Copy link
gillisd commented May 29, 2025

Just discovered this PR, thank you for your hard work @lionelperrin! I too would love to see this merged, is there anything preventing it from doing so?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0