Class: Shuck::Server

Inherits:
Object
  • Object
show all
Defined in:
lib/shuck/server.rb

Instance Method Summary collapse

Constructor Details

#initialize(port, store, hostname) ⇒ Server

Returns a new instance of Server.



247
248
249
250
251
# File 'lib/shuck/server.rb', line 247

def initialize(port,store,hostname)
  @port = port
  @store = store
  @hostname = hostname
end

Instance Method Details

#serveObject



253
254
255
256
257
258
# File 'lib/shuck/server.rb', line 253

def serve
  @server = WEBrick::HTTPServer.new(:Port => @port)
  @server.mount "/", Servlet, @store,@hostname
  trap "INT" do @server.shutdown end
  @server.start
end

#shutdownObject



260
261
262
# File 'lib/shuck/server.rb', line 260

def shutdown
  @server.shutdown
end