Class: Serve::WEBrick::Server
- Inherits:
-
WEBrick::HTTPServer
- Object
- WEBrick::HTTPServer
- Serve::WEBrick::Server
- Defined in:
- lib/serve/webrick/server.rb
Overview
:nodoc:
Class Method Summary collapse
Class Method Details
.register_handlers ⇒ Object
4 5 6 7 8 9 10 11 12 13 14 |
# File 'lib/serve/webrick/server.rb', line 4 def self.register_handlers extensions = [] Serve::FileTypeHandler.handlers.each do |ext, handler| extensions << ext handler_servlet = Class.new(Serve::WEBrick::Servlet) do define_method(:handler) { handler } end ::WEBrick::HTTPServlet::FileHandler.add_handler(ext, handler_servlet) end extensions end |