diff options
author | Eric Wong <normalperson@yhbt.net> | 2009-11-02 01:09:35 -0800 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2009-11-02 09:59:42 -0800 |
commit | 355dab7d84e0baeec896c2efc1744785a782da35 (patch) | |
tree | 79fdb10b87075657de8ff68f7301d586594a1080 /lib/rainbows/http_server.rb | |
parent | f2dc198ae1d145743860ab7d4f523d54eafd4ca1 (diff) | |
download | rainbows-355dab7d84e0baeec896c2efc1744785a782da35.tar.gz |
Since const_get works with a string as well as a symbol, allow that to be used. It's easier and simpler to just allow strings as use arguments than to error check and raise exceptions. So both of the following should now work: Rainbows! do use :Revactor end Rainbows! do use "Revactor" end Rainbows! will always use the symbol variant internally, however, so applications can alway expect env['rainbows.model'] to be a symbol.
Diffstat (limited to 'lib/rainbows/http_server.rb')
-rw-r--r-- | lib/rainbows/http_server.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/rainbows/http_server.rb b/lib/rainbows/http_server.rb index 4c4b63b..b150ddc 100644 --- a/lib/rainbows/http_server.rb +++ b/lib/rainbows/http_server.rb @@ -31,9 +31,9 @@ module Rainbows Module === mod or raise ArgumentError, "concurrency model #{model.inspect} not supported" extend(mod) - Const::RACK_DEFAULTS['rainbows.model'] = @use = model + Const::RACK_DEFAULTS['rainbows.model'] = @use = model.to_sym Const::RACK_DEFAULTS['rack.multithread'] = !!(/Thread/ =~ model.to_s) - case model + case @use when :Rev, :EventMachine Const::RACK_DEFAULTS['rainbows.autochunk'] = true end |