Sha256: efe8f66931e7d9a694dd7729bc7366751e69cac8eeb50189bd17a2a837852ad0

Contents?: true

Size: 611 Bytes

Versions: 1

Compression:

Stored size: 611 Bytes

Contents

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

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
stack-0.0.7 lib/stack/server.rb