Class: Pact::MockService::Server::Respawn

Inherits:
Object
  • Object
show all
Defined in:
lib/pact/mock_service/server/respawn.rb

Class Method Summary collapse

Class Method Details

.call(pidfile, port, ssl = false) ⇒ Object



8
9
10
11
12
13
14
15
16
# File 'lib/pact/mock_service/server/respawn.rb', line 8

def self.call pidfile, port, ssl = false
  if pidfile.file_exists_and_process_running?
    pidfile.kill_process
  end

  Spawn.(pidfile, port, ssl) do
    yield
  end
end