Method: Sinatra::Base.quit!

Defined in:
lib/sinatra/base.rb

.quit!Object Also known as: stop!

Stop the self-hosted server if running.



1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
# File 'lib/sinatra/base.rb', line 1593

def quit!
  return unless running?

  # Use Thin's hard #stop! if available, otherwise just #stop.
  running_server.respond_to?(:stop!) ? running_server.stop! : running_server.stop
  warn '== Sinatra has ended his set (crowd applauds)' unless suppress_messages?
  set :running_server, nil
  set :handler_name, nil

  on_stop_callback.call unless on_stop_callback.nil?
end