Class: YARD::Server::WebrickAdapter

Inherits:
Adapter
  • Object
show all
Defined in:
lib/yard/server/webrick_adapter.rb

Overview

Since:

  • 0.6.0

Instance Attribute Summary

Attributes inherited from Adapter

#document_root, #libraries, #options, #router, #server_options

Instance Method Summary collapse

Methods inherited from Adapter

#add_library, #initialize, setup, shutdown

Constructor Details

This class inherits a constructor from YARD::Server::Adapter

Instance Method Details

#startObject

Since:

  • 0.6.0



6
7
8
9
10
11
12
# File 'lib/yard/server/webrick_adapter.rb', line 6

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