spring icon indicating copy to clipboard operation
spring copied to clipboard

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

Open andrewn617 opened this issue 8 months ago • 0 comments

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?

andrewn617 avatar Mar 01 '25 20:03 andrewn617