From b2f6932ffcdab271845a7feed908fbc6db69e6b7 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Wed, 4 Nov 2009 01:03:54 -0800 Subject: Fix autoload of Etc in Worker for Ruby 1.9 Constant scoping appears to be a bit different under 1.9 --- lib/unicorn.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/unicorn.rb b/lib/unicorn.rb index 396b8e3..0f2b597 100644 --- a/lib/unicorn.rb +++ b/lib/unicorn.rb @@ -3,7 +3,6 @@ require 'fcntl' require 'unicorn/socket_helper' autoload :Rack, 'rack' -autoload :Etc, 'etc' # Unicorn module containing all of the classes (include C extensions) for running # a Unicorn web server. It contains a minimalist HTTP server with just enough @@ -114,6 +113,8 @@ module Unicorn # for examples. class Worker < Struct.new(:nr, :tmp) + autoload :Etc, 'etc' + # worker objects may be compared to just plain numbers def ==(other_nr) self.nr == other_nr -- cgit v1.2.3-24-ge0c7