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