Class: YARD::Server::RackAdapter
- Includes:
- WEBrick::HTTPUtils
- Defined in:
- lib/yard/server/rack_adapter.rb
Overview
A server adapter to respond to requests using the Rack server infrastructure.
Instance Attribute Summary
Attributes inherited from Adapter
#document_root, #libraries, #options, #router, #server_options
Instance Method Summary collapse
-
#call(env) ⇒ Array(Number,Hash,Array)
Responds to Rack requests and builds a response with the Router.
-
#start ⇒ void
Starts the
Rack::Server
.
Methods inherited from Adapter
#add_library, #initialize, setup, shutdown
Constructor Details
This class inherits a constructor from YARD::Server::Adapter
Instance Method Details
#call(env) ⇒ Array(Number,Hash,Array)
Responds to Rack requests and builds a response with the YARD::Server::Router.
48 49 50 51 52 |
# File 'lib/yard/server/rack_adapter.rb', line 48 def call(env) request = Rack::Request.new(env) request.path_info = unescape(request.path_info) # unescape things like %3F router.call(request) end |
#start ⇒ void
This method returns an undefined value.
Starts the Rack::Server
. This method will pass control to the server and block.
57 58 59 60 61 62 |
# File 'lib/yard/server/rack_adapter.rb', line 57 def start server = Rack::Server.new() server.instance_variable_set("@app", self) (server) server.start end |