module Stack class Server attr_accessor :source, :target attr_accessor :generator attr_accessor :http_server attr_accessor :thread def initialize(generator) self.generator = generator self.source = self.generator.source self.target = self.generator.target end def observe self.http_server = WEBrick::HTTPServer.new( :Port => Stack::runner.configuration.server_port, :DocumentRoot => self.target ) self.thread = Thread.new { self.http_server.start } self.thread.join() end end end