Class: YARD::Server::WebrickAdapter
- Defined in:
- lib/yard/server/webrick_adapter.rb
Overview
The main adapter to initialize a WEBrick server.
Instance Attribute Summary collapse
-
#document_root ⇒ String
inherited
from Adapter
The location where static files are located, if any.
-
#libraries ⇒ Hash{String=>Array<LibraryVersion>}
inherited
from Adapter
A map of libraries.
-
#options ⇒ Hash
inherited
from Adapter
Options passed and processed by adapters.
-
#router ⇒ Router
inherited
from Adapter
The router object used to route URLs to commands.
-
#server_options ⇒ Hash
inherited
from Adapter
A set of options to pass to the server backend.
Instance Method Summary collapse
-
#start ⇒ Object
Initializes a WEBrick server.
Constructor Details
This class inherits a constructor from YARD::Server::Adapter
Instance Attribute Details
#document_root ⇒ String Originally defined in class Adapter
Returns the location where static files are located, if any. To set this
field on initialization, pass :DocumentRoot
to the
server_opts
argument in #initialize
#libraries ⇒ Hash{String=>Array<LibraryVersion>} Originally defined in class Adapter
Returns a map of libraries.
#options ⇒ Hash Originally defined in class Adapter
Returns options passed and processed by adapters. The actual options mostly depend on the adapters themselves.
#router ⇒ Router Originally defined in class Adapter
Returns the router object used to route URLs to commands
#server_options ⇒ Hash Originally defined in class Adapter
Returns a set of options to pass to the server backend. Note that
:DocumentRoot
also sets the #document_root.
Instance Method Details
#start ⇒ Object
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 |