From a0ee3ba2d08acb423a1cbc4a5ae862bd40c4b914 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Wed, 21 Apr 2010 15:31:58 -0700 Subject: avoid direct require of "rack" to quiet warnings This quiets down warnings when used with RubyGems loaders such as Isolate and Bundler where the HTTP server already loaded Rack. --- lib/clogger/pure.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'lib/clogger/pure.rb') diff --git a/lib/clogger/pure.rb b/lib/clogger/pure.rb index b871c62..e9a8e6a 100644 --- a/lib/clogger/pure.rb +++ b/lib/clogger/pure.rb @@ -1,13 +1,14 @@ # -*- encoding: binary -*- # :stopdoc: -require 'rack' - # Not at all optimized for performance, this was written based on # the original C extension code so it's not very Ruby-ish... class Clogger def initialize(app, opts = {}) + # trigger autoload to avoid thread-safety issues later on + Rack::Utils::HeaderHash.new({}) + @app = app @logger = opts[:logger] (@logger.sync = true) rescue nil -- cgit v1.2.3-24-ge0c7