Class: FakeS3::Server

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

Instance Method Summary collapse

Constructor Details

#initialize(address, port, store, hostname) ⇒ Server

Returns a new instance of Server.



320
321
322
323
324
325
# File 'lib/fakes3/server.rb', line 320

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

Instance Method Details

#serveObject



327
328
329
330
331
332
# File 'lib/fakes3/server.rb', line 327

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

#shutdownObject



334
335
336
# File 'lib/fakes3/server.rb', line 334

def shutdown
  @server.shutdown
end