class FakeS3::Server
Public Class Methods
new(address,port,store,hostname,ssl_cert_path,ssl_key_path)
click to toggle source
# File lib/fakes3/server.rb, line 513 def initialize(address,port,store,hostname,ssl_cert_path,ssl_key_path) @address = address @port = port @store = store @hostname = hostname @ssl_cert_path = ssl_cert_path @ssl_key_path = ssl_key_path webrick_config = { :BindAddress => @address, :Port => @port } if !@ssl_cert_path.to_s.empty? webrick_config.merge!( { :SSLEnable => true, :SSLCertificate => OpenSSL::X509::Certificate.new(File.read(@ssl_cert_path)), :SSLPrivateKey => OpenSSL::PKey::RSA.new(File.read(@ssl_key_path)) } ) end @server = WEBrick::HTTPServer.new(webrick_config) end
Public Instance Methods
serve()
click to toggle source
# File lib/fakes3/server.rb, line 536 def serve @server.mount "/", Servlet, @store,@hostname trap "INT" do @server.shutdown end @server.start end
shutdown()
click to toggle source
# File lib/fakes3/server.rb, line 542 def shutdown @server.shutdown end