about summary refs log tree commit homepage
path: root/lib/rainbows/http_server.rb
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2009-11-28 18:36:47 -0800
committerEric Wong <normalperson@yhbt.net>2009-11-29 14:49:32 -0800
commitf050fcb9e5da4adf3b5b4f65c0590360113e78fd (patch)
tree6c321faaf3ebc5f812f45541e2d5a5c1e62d0afb /lib/rainbows/http_server.rb
parent37a560c5d14c15a3da7f2c10c9ea3d6002b34fe1 (diff)
downloadrainbows-f050fcb9e5da4adf3b5b4f65c0590360113e78fd.tar.gz
Eventually we hope to be able to accept arguments like
the way Rack handlers do it:

  use :Foo, :bool1, :bool2, :option => value
Diffstat (limited to 'lib/rainbows/http_server.rb')
-rw-r--r--lib/rainbows/http_server.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/rainbows/http_server.rb b/lib/rainbows/http_server.rb
index da97929..b528942 100644
--- a/lib/rainbows/http_server.rb
+++ b/lib/rainbows/http_server.rb
@@ -52,6 +52,14 @@ module Rainbows
       Module === mod or
         raise ArgumentError, "concurrency model #{model.inspect} not supported"
       extend(mod)
+      args.each do |opt|
+        case opt
+        when Hash; O.update(opt)
+        when Symbol; O[opt] = true
+        else; raise ArgumentError, "can't handle option: #{opt.inspect}"
+        end
+      end
+      mod.setup if mod.respond_to?(:setup)
       Const::RACK_DEFAULTS['rainbows.model'] = @use = model.to_sym
       Const::RACK_DEFAULTS['rack.multithread'] = !!(/Thread/ =~ model.to_s)
       case @use