lib/angelo/base.rb in angelo-0.2.2 vs lib/angelo/base.rb in angelo-0.2.3

- old
+ new

@@ -142,18 +142,25 @@ def content_type type Responder.content_type type end - def run addr = @@addr, port = @@port + def run! addr = @@addr, port = @@port + run addr, port, true + end + + def run addr = @@addr, port = @@port, blocking = false Celluloid.logger.level = @@log_level @server = Angelo::Server.new self, addr, port @server.async.ping_websockets - trap "INT" do - @server.terminate if @server and @server.alive? - exit + if blocking + trap "INT" do + @server.terminate if @server and @server.alive? + exit + end + sleep end - sleep + @server end def local_path path if public_dir lp = File.join(public_dir, path)