Class: Devproxy::CLI::Server

Inherits:
WEBrick::HTTPServer
  • Object
show all
Defined in:
lib/devproxy/cli/server.rb

Defined Under Namespace

Classes: Servlet

Instance Method Summary collapse

Constructor Details

#initialize(*args) ⇒ Server

Returns a new instance of Server.



48
49
50
51
52
# File 'lib/devproxy/cli/server.rb', line 48

def initialize(*args)
  super
  mount "/"   , Servlet
  mount "/css", WEBrick::HTTPServlet::FileHandler, File.join(File.dirname(__FILE__),"..","..","..","data","css")
end

Instance Method Details

#shutdownObject



61
62
63
64
65
# File 'lib/devproxy/cli/server.rb', line 61

def shutdown
  @mutex.synchronize do
    super
  end if @mutex
end

#start(*args) ⇒ Object



54
55
56
57
58
59
# File 'lib/devproxy/cli/server.rb', line 54

def start(*args)
  @mutex  ||= Mutex.new
  @thread ||= Thread.new do
    super(*args)
  end
end