Class: FakeS3::Server
- Inherits:
-
Object
- Object
- FakeS3::Server
- Defined in:
- lib/fakes3/server.rb
Instance Method Summary collapse
-
#initialize(address, port, store, hostname) ⇒ Server
constructor
A new instance of Server.
- #serve ⇒ Object
- #shutdown ⇒ Object
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
#serve ⇒ Object
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 |
#shutdown ⇒ Object
334 335 336 |
# File 'lib/fakes3/server.rb', line 334 def shutdown @server.shutdown end |