Class: Webcommand::Server::Adapters::Webrick
- Inherits:
-
Object
- Object
- Webcommand::Server::Adapters::Webrick
- Defined in:
- lib/webcommand/server/adapters/webrick.rb
Instance Method Summary collapse
-
#initialize(server, options) ⇒ Webrick
constructor
A new instance of Webrick.
- #start ⇒ Object
Constructor Details
#initialize(server, options) ⇒ Webrick
Returns a new instance of Webrick.
5 6 7 8 9 |
# File 'lib/webcommand/server/adapters/webrick.rb', line 5 def initialize(server, ) require 'webrick' @server = server @options = end |
Instance Method Details
#start ⇒ Object
11 12 13 14 15 16 17 18 |
# File 'lib/webcommand/server/adapters/webrick.rb', line 11 def start server = WEBrick::HTTPServer.new( Port: @options[:port], BindAddress: @options[:bind]) server.mount "/", Rack::Handler::WEBrick, server Signal.trap(:INT) { server.shutdown } server.start end |