You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Okay just to flesh this out - on-demand loading should minimise the time it takes to load and run tasks when there are hundreds of .rake files
It would only apply to namespaces, and there could either be a dynamic loading scheme or a static loading scheme. Both probably useful as we have a ton of legacy stuff
The idea would be something like this:
For static things:
namespace:db=>File.expand_path("db.rake",__dir__)# When looking up a task in namespace :db, this file would be loaded first.# Could be multiple things like this, all the files would be loaded.
For dynamic things
namespaceFile.join(__dir__,"tasks")# When looking up a namespace which could not be found, try to load tasks/#{namespace.gsub(':', '/')}.rake# If specified, could be used in combination with above static loading.
Open to ideas, suggestions, etc.
utilum, phansch, shreyasbharath, lionelperrin, bryanp and 2 more
This would be extremely useful! I have previously resorted to manually writing logic in Rakefiles to only load the tasks that are necessary based on the top-level tasks passed in by the user.
Activity
ioquatix commentedon Dec 8, 2016
Okay just to flesh this out - on-demand loading should minimise the time it takes to load and run tasks when there are hundreds of .rake files
It would only apply to namespaces, and there could either be a dynamic loading scheme or a static loading scheme. Both probably useful as we have a ton of legacy stuff
The idea would be something like this:
For static things:
For dynamic things
Open to ideas, suggestions, etc.
ioquatix commentedon Dec 8, 2016
If I can just get a sign that this is something that would be accepted/merged (within reason), I'll work on a PR.
shreyasbharath commentedon Dec 30, 2017
This would be extremely useful! I have previously resorted to manually writing logic in Rakefiles to only load the tasks that are necessary based on the top-level tasks passed in by the user.
lionelperrin commentedon Feb 18, 2020
I've created a PR for this purpose: #339.
ioquatix commentedon Feb 18, 2020
@lionelperrin I like your PR. I also use rake a lot, but I decided to try fixing this in a new gem: https://github.com/ioquatix/bake