Method: Spring::Client::Run#boot_server

Defined in:
lib/spring/client/run.rb

#boot_serverObject



65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
# File 'lib/spring/client/run.rb', line 65

def boot_server
  env.socket_path.unlink if env.socket_path.exist?

  pid = Process.spawn(
    gem_env,
    "ruby",
    "-e", "gem 'spring', '#{Spring::VERSION}'; require 'spring/server'; Spring::Server.boot"
  )

  until env.socket_path.exist?
    _, status = Process.waitpid2(pid, Process::WNOHANG)
    exit status.exitstatus if status
    sleep 0.1
  end
end