Class: Burn::Util::Server
- Inherits:
-
Object
- Object
- Burn::Util::Server
- Defined in:
- lib/burn/util/server.rb
Instance Method Summary collapse
-
#initialize(document_root) ⇒ Server
constructor
A new instance of Server.
- #start ⇒ Object
Constructor Details
#initialize(document_root) ⇒ Server
Returns a new instance of Server.
6 7 8 9 10 11 12 13 14 |
# File 'lib/burn/util/server.rb', line 6 def initialize(document_root) @server = WEBrick::HTTPServer.new({:DocumentRoot => document_root, :BindAddress => '127.0.0.1', :Port => 17890}) trap 'INT' do @server.shutdown end @server.mount_proc('/shutdown'){ |req, resp| @server.stop } end |
Instance Method Details
#start ⇒ Object
16 17 18 |
# File 'lib/burn/util/server.rb', line 16 def start @server.start end |