144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
|
# File 'lib/spring/client/run.rb', line 144
def run_command(client, application)
application.send_io STDOUT
application.send_io STDERR
application.send_io STDIN
log "waiting for the application to be preloaded"
preload_status = application.gets
preload_status = preload_status.chomp if preload_status
log "app preload status: #{preload_status}"
exit 1 if preload_status == "1"
log "sending command"
send_json application, "args" => args, "env" => ENV.to_hash
pid = server.gets
pid = pid.chomp if pid
client.close
if pid && !pid.empty?
log "got pid: #{pid}"
suspend_resume_on_tstp_cont(pid)
forward_signals(application)
status = application.read.to_i
log "got exit status #{status}"
exit status
else
log "got no pid"
exit 1
end
ensure
application.close
end
|