Method: Sinatra::Base.quit!

Defined in:
lib/sinatra/base.rb

.quit!Object Also known as: stop!

Stop the self-hosted server if running.

[View source]

1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
# File 'lib/sinatra/base.rb', line 1589

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