class Sinatra::Base
def setup_traps
def setup_traps if traps? at_exit { quit! } [:INT, :TERM].each do |signal| old_handler = trap(signal) do quit! old_handler.call if old_handler.respond_to?(:call) end end set :traps, false end end
def setup_traps if traps? at_exit { quit! } [:INT, :TERM].each do |signal| old_handler = trap(signal) do quit! old_handler.call if old_handler.respond_to?(:call) end end set :traps, false end end