Fwd: Patch to fix use in Rainbows! with arguments

Graham Hughes graham at rightscale.com
Mon Feb 7 21:02:36 EST 2011


Hello.  I found an annoying error in Rainbows after 0.97 that I traced
down to inaccurate scoping in one of the modules; I think this never
came up in your tests because you don't test use in config.rb with
arguments: we were running the following:

Rainbows! do
  use :NeverBlock, :pool_size => 50
  worker_connections 100
end

which broke.

Enclosed is a patch which fixes this issue.

Graham

>From 366ab17b95c0c618f9f49c6ff20ff3218cc26344 Mon Sep 17 00:00:00 2001
From: Graham Hughes <graham at rightscale.com>
Date: Mon, 7 Feb 2011 16:49:31 -0800
Subject: [PATCH] Actually use the Rainbows::O constant for use
---
 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 71ed192..ab214c3 100644
--- a/lib/rainbows/http_server.rb
+++ b/lib/rainbows/http_server.rb
@@ -63,8 +63,8 @@ class Rainbows::HttpServer < Unicorn::HttpServer
       raise ArgumentError, "concurrency model #{model.inspect} not supported"
     args.each do |opt|
       case opt
-      when Hash; O.update(opt)
-      when Symbol; O[opt] = true
+      when Hash; Rainbows::O.update(opt)
+      when Symbol; Rainbows::O[opt] = true
       else; raise ArgumentError, "can't handle option: #{opt.inspect}"
       end
     end
--
1.7.4


More information about the rainbows-talk mailing list