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

Default to using spring when running commands and tasks with bin/rails #733

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

andrewn617
Copy link
Contributor

@andrewn617 andrewn617 commented Mar 1, 2025

When you run a rake task with bin/rails it does not use spring (except db rake tasks). And, many rails commands that could benefit from using spring do not use it, since the current system is for commands to opt-in.

I believe that it would be better to have an opt-out system rather than an opt-in system, since likely most commands and tasks will benefit from spring. So I implemented that in this PR.

While here I simplified the existing Rails sub-commands implementation, which had varying ways of picking off the environment from the args. I believe we only need one special subcommand, test because it needs to default to the test environment, unlike the others.

I opted out the server command because it should not run with spring. Are there any other commands that should opt-out?

Previously, bin/rails only used spring for a subset of commands and
rake tasks. However, most rake tasks can benefit from spring and do
use spring when using bin/rake.

This PR makes rake tasks run with bin/rails use spring, and introduces
and opt-out system for certain Rails commands that should not use spring
(like the server) instead of the previous opt-in system.
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.

1 participant