Class: SmallCage::Commands::Server
- Inherits:
-
Object
- Object
- SmallCage::Commands::Server
- Defined in:
- lib/smallcage/commands/server.rb
Class Method Summary collapse
Class Method Details
.execute(opts) ⇒ Object
3 4 5 6 7 8 9 10 11 12 13 14 15 |
# File 'lib/smallcage/commands/server.rb', line 3 def self.execute(opts) require 'smallcage/http_server' document_root = opts[:path] port = opts[:port] server = SmallCage::HTTPServer.new(document_root, port) sighandler = Proc.new { |signal| server.shutdown } SmallCage::Application.add_signal_handler(%w{INT TERM}, sighandler) server.start end |