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

Update app template to include all app rake tasks #130

Merged
merged 1 commit into from
Feb 13, 2025

Conversation

pjb3
Copy link
Contributor

@pjb3 pjb3 commented Feb 11, 2025

When I generate a new rage app, it makes a lib/tasks directory. If I put a .rake file in there, the tasks defined in that file aren't available when I run rake. Should they be?

If I add this line to the Rakefile in the root of the project:

Dir[Rage.root.join("lib/tasks/**/*.rake")].each { |file| load file }

Then the tasks are available. If that is what users are expected to do, would it make sense to have that in that file then?

This pull request adds that to the template, but if there is a different way app rake tasks are intended to be loaded, let me know

@rsamoilov
Copy link
Member

Hey Paul, thanks for the PR!

If I put a .rake file in there, the tasks defined in that file aren't available when I run rake. Should they be?

They should - that's definitely an overlook on my side.

I would suggest putting this code in here. This way, our Rakefile will remain nice and tidy, and it will also work for old applications.

@pjb3 pjb3 force-pushed the master branch 2 times, most recently from c223ca3 to 3c2c4fc Compare February 13, 2025 15:53
@pjb3
Copy link
Contributor Author

pjb3 commented Feb 13, 2025

@rsamoilov Good suggestion. I've updated the commit to have the loading happen in Rage.load_tasks. Let me know if there are any other changes you would like.

@rsamoilov
Copy link
Member

Hey @pjb3 , this looks great!

@rsamoilov rsamoilov merged commit 2299ed0 into rage-rb:master Feb 13, 2025
8 checks passed
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.

2 participants