Sha256: 2dcbde6c22c2f0b07ae0cde6082ffb2745520a6a64d5b6e309296678dd5bddb3
Contents?: true
Size: 696 Bytes
Versions: 11
Compression:
Stored size: 696 Bytes
Contents
module ScrewUnit module Resources class SuiteCompletion def initialize(kill_server_on_completion) @kill_server_on_completion = kill_server_on_completion end def kill_server_on_completion? @kill_server_on_completion end def post(request) puts request.body.string unless request.body.string == "success" if kill_server_on_completion? $exit_status = (request.body.string == "success") ? 0 : 1 Thread.new do sleep 1 # give the server thread a moment to send the response before we kill it $thin_server.stop! end end [200, {}, "OK"] end end end end
Version data entries
11 entries across 11 versions & 1 rubygems