Skip to content

Commit ca4d6ff

Browse files
committed
Changed the value used for $0 in subcommands
$0 should be the first element of argv, which is generally the name of the program being run. Right now Spring is including the rest of argv as well. This is a problem for RSpec, which varies its behavior based on $0. Fixes #359
1 parent af55ad6 commit ca4d6ff

File tree

2 files changed

+1
-5
lines changed

2 files changed

+1
-5
lines changed

lib/spring/application.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ def serve(client)
158158
trap("TERM", "DEFAULT")
159159

160160
ARGV.replace(args)
161-
$0 = command.process_title
161+
$0 = command.exec_name
162162

163163
# Delete all env vars which are unchanged from before spring started
164164
original_env.each { |k, v| ENV.delete k if ENV[k] == v }

lib/spring/command_wrapper.rb

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,6 @@ def call
4141
end
4242
end
4343

44-
def process_title
45-
[name, *ARGV].join(" ")
46-
end
47-
4844
def gem_name
4945
if command.respond_to?(:gem_name)
5046
command.gem_name

0 commit comments

Comments
 (0)