diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/clogger.rb | 2 | ||||
-rw-r--r-- | lib/clogger/pure.rb | 5 |
2 files changed, 5 insertions, 2 deletions
diff --git a/lib/clogger.rb b/lib/clogger.rb index 641d5c5..8567c91 100644 --- a/lib/clogger.rb +++ b/lib/clogger.rb @@ -1,4 +1,6 @@ # -*- encoding: binary -*- +autoload :Rack, 'rack' + class Clogger VERSION = '0.3.2' 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 |