Skip to content

Commit 9b43393

Browse files
committed
Exit explicitly when running un-spring rails commands
Prevents "warning: already initialized constant APP_PATH" and potentially other code from running that you don't expect to run. Fixes #259.
1 parent 7310755 commit 9b43393

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
* Detect old binstubs generated with Spring 1.0 and exit with an error.
44
This prevents a situation where you can get stuck in an infinite loop
55
of spring invocations.
6+
* Avoid `warning: already initialized constant APP_PATH` when running
7+
rails commands that do not use spring (e.g. `bin/rails server` would
8+
emit this when you ^C to exit)
69

710
## 1.1.1
811

lib/spring/client/rails.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ def call
2525
require "spring/configuration"
2626
ARGV.shift
2727
load Dir.glob(Spring.application_root_path.join("{bin,script}/rails")).first
28+
exit
2829
end
2930
end
3031
end

0 commit comments

Comments
 (0)