lib/angelo/server.rb in angelo-0.3.2 vs lib/angelo/server.rb in angelo-0.3.3

- old
+ new

@@ -9,17 +9,17 @@ def_delegators :@base, :websockets, :sses attr_reader :base - def initialize base, addr = nil, port = nil + def initialize base, addr = nil, port = nil, options = {} @base = base addr ||= @base.addr port ||= @base.port info "Angelo #{VERSION}" info "listening on #{addr}:#{port}" - super addr, port, &method(:on_connection) + super addr, port, options, &method(:on_connection) end def on_connection connection # RubyProf.resume responders = [] @@ -54,10 +54,10 @@ Angelo.log connection, request, nil, :bad_request connection.respond :bad_request, DEFAULT_RESPONSE_HEADERS, e.message end def route! meth, connection, request - if @base.routes[meth] and rs = @base.routes[meth][request.path] + if rs = @base.routes[meth][request.path] responder = rs.dup responder.reset! responder.base = @base.new responder responder.connection = connection responder.request = request