Class: Webmachine::Adapters::WEBrick
- Inherits:
-
Webmachine::Adapter
- Object
- Webmachine::Adapter
- Webmachine::Adapters::WEBrick
- Defined in:
- lib/webmachine/adapters/webrick.rb
Overview
Connects Webmachine to WEBrick.
Defined Under Namespace
Classes: Server
Constant Summary collapse
- DEFAULT_OPTIONS =
Used to override default WEBRick options (useful in testing)
{}
Instance Attribute Summary
Attributes inherited from Webmachine::Adapter
Instance Method Summary collapse
-
#run ⇒ Object
Starts the WEBrick adapter.
- #shutdown ⇒ Object
Methods inherited from Webmachine::Adapter
Constructor Details
This class inherits a constructor from Webmachine::Adapter
Instance Method Details
#run ⇒ Object
Starts the WEBrick adapter
16 17 18 19 20 21 22 23 24 |
# File 'lib/webmachine/adapters/webrick.rb', line 16 def run = DEFAULT_OPTIONS.merge({ :Port => configuration.port, :BindAddress => configuration.ip }).merge(configuration.) @server = Server.new(dispatcher, ) trap("INT") { shutdown } @server.start end |
#shutdown ⇒ Object
26 27 28 |
# File 'lib/webmachine/adapters/webrick.rb', line 26 def shutdown @server.shutdown if @server end |