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