Sha256: f517d7685433cdd5735c2de190229a231f75716def728e64a6a0a04731af8137
Contents?: true
Size: 799 Bytes
Versions: 17
Compression:
Stored size: 799 Bytes
Contents
require "spring/version" module Spring module Client class Stop < Command TIMEOUT = 2 # seconds def self.description "Stop all spring processes for this project." end def call if env.server_running? timeout = Time.now + TIMEOUT kill 'TERM' sleep 0.1 until !env.server_running? || Time.now >= timeout if env.server_running? $stderr.puts "Spring did not stop; killing forcibly." kill 'KILL' else puts "Spring stopped." end else puts "Spring is not running" end end def kill(sig) pid = env.pid Process.kill(sig, pid) if pid rescue Errno::ESRCH # already dead end end end end
Version data entries
17 entries across 17 versions & 1 rubygems