From 6bde32081338ce8075854f4c47ce8ca5347df919 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Wed, 5 Jan 2011 17:06:20 -0800 Subject: eliminate G constant and just use the Rainbows! module Code organization is hard :< --- lib/rainbows/base.rb | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'lib/rainbows/base.rb') diff --git a/lib/rainbows/base.rb b/lib/rainbows/base.rb index 5d56063..b94ddc9 100644 --- a/lib/rainbows/base.rb +++ b/lib/rainbows/base.rb @@ -8,16 +8,13 @@ module Rainbows::Base # :stopdoc: - # shortcuts... - G = Rainbows::G - # this method is called by all current concurrency models def init_worker_process(worker) # :nodoc: super(worker) Rainbows::Response.setup(self.class) Rainbows::MaxBody.setup Rainbows::RackInput.setup - G.tmp = worker.tmp + Rainbows.tick_io = worker.tmp listeners = Rainbows::HttpServer::LISTENERS Rainbows::HttpServer::IO_PURGATORY.concat(listeners) @@ -26,9 +23,9 @@ module Rainbows::Base # since we don't defer reopening logs Rainbows::HttpServer::SELF_PIPE.each { |x| x.close }.clear trap(:USR1) { reopen_worker_logs(worker.nr) } - trap(:QUIT) { G.quit! } + trap(:QUIT) { Rainbows.quit! } [:TERM, :INT].each { |sig| trap(sig) { exit!(0) } } # instant shutdown - Rainbows::ProcessClient.const_set(:APP, G.server.app) + Rainbows::ProcessClient.const_set(:APP, Rainbows.server.app) logger.info "Rainbows! #@use worker_connections=#@worker_connections" end @@ -38,7 +35,6 @@ module Rainbows::Base def self.included(klass) # :nodoc: klass.const_set :LISTENERS, Rainbows::HttpServer::LISTENERS - klass.const_set :G, Rainbows::G end # :startdoc: -- cgit v1.2.3-24-ge0c7