about summary refs log tree commit homepage
diff options
context:
space:
mode:
-rw-r--r--lib/rainbows.rb1
-rw-r--r--lib/rainbows/http_server.rb8
2 files changed, 9 insertions, 0 deletions
diff --git a/lib/rainbows.rb b/lib/rainbows.rb
index 5521e81..f2f7af5 100644
--- a/lib/rainbows.rb
+++ b/lib/rainbows.rb
@@ -21,6 +21,7 @@ module Rainbows
     end
   end
   G = State.new(true, 0, 0, 2)
+  O = {}
 
   require 'rainbows/const'
   require 'rainbows/http_server'
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