class YARD::Server::WebrickAdapter

The main adapter to initialize a WEBrick server.

Public Instance Methods

start() click to toggle source

Initializes a WEBrick server. If {Adapter#server_options} contains a :daemonize key set to true, the server will be daemonized.

# File lib/yard/server/webrick_adapter.rb, line 10
def start
  server_options[:ServerType] = WEBrick::Daemon if server_options[:daemonize]
  server = WEBrick::HTTPServer.new(server_options)
  server.mount('/', WebrickServlet, self)
  trap("INT") { server.shutdown }
  server.start
end