lib/angelo/server.rb in angelo-0.2.4 vs lib/angelo/server.rb in angelo-0.3.0
- old
+ new
@@ -7,14 +7,18 @@
extend Forwardable
include Celluloid::Logger
def_delegators :@base, :websockets, :sses
- def initialize base, host = '127.0.0.1', port = 4567
+ attr_reader :base
+
+ def initialize base, addr = nil, port = nil
@base = base
+ addr ||= @base.addr
+ port ||= @base.port
info "Angelo #{VERSION}"
- info "listening on #{host}:#{port}"
- super host, port, &method(:on_connection)
+ info "listening on #{addr}:#{port}"
+ super addr, port, &method(:on_connection)
end
def on_connection connection
# RubyProf.resume
responders = []