Class: YARD::Server::WebrickAdapter
- Inherits:
-
Adapter
- Object
- Adapter
- YARD::Server::WebrickAdapter
- Defined in:
- lib/yard/server/webrick_adapter.rb
Overview
The main adapter to initialize a WEBrick server.
Instance Attribute Summary
Attributes inherited from Adapter
document_root, libraries, options, router, server_options
Instance Method Summary (collapse)
-
- (Object) start
Initializes a WEBrick server.
Methods inherited from Adapter
#add_library, #initialize, setup, shutdown
Constructor Details
This class inherits a constructor from YARD::Server::Adapter
Instance Method Details
- (Object) start
Initializes a WEBrick server. If Adapter#server_options contains a :daemonize key set to true, the server will be daemonized.
9 10 11 12 13 14 15 |
# File 'lib/yard/server/webrick_adapter.rb', line 9 def start [:ServerType] = WEBrick::Daemon if [:daemonize] server = WEBrick::HTTPServer.new() server.mount('/', WebrickServlet, self) trap("INT") { server.shutdown } server.start end |