Permalink
Browse files

* be able to pass options to WEBrick.new from WEBrickAdaptor.start

  • Loading branch information...
mneumann
mneumann committed Dec 20, 2004
1 parent 8af5e66 commit 3bef2a8f9faa15530edaa3df94b52fced4cff667
Showing with 4 additions and 3 deletions.
  1. +4 −3 lib/wee/adaptors/webrick.rb
@@ -15,21 +15,22 @@
# Wee::WEBrickAdaptor.
# register('/app', application).
# register('/cnt', application2).
-# start(2000)
+# start(:Port => 2000)
#
class Wee::WEBrickAdaptor < WEBrick::HTTPServlet::AbstractServlet
# Convenience method
- def self.start(port=2000)
- server = WEBrick::HTTPServer.new(:Port => port)
+ def self.start(options)
+ server = WEBrick::HTTPServer.new({:Port => 2000}.update(options))
trap("INT") { server.shutdown }
@apps.each do |path, app|
server.mount(path, self, app)
end
server.start
+ server
end
# Convenience method

0 comments on commit 3bef2a8

Please sign in to comment.