about summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2017-11-16 20:59:40 +0000
committerEric Wong <e@80x24.org>2017-11-16 20:59:40 +0000
commit1a407d78c90695c03ec6ac1e0a8b7f0e466c975e (patch)
treee65e07514e1b9e896dc8dcd01389ebc315dd2e25
parentcb61cb1e9bb3115a0c1898d84fb055a3221f6956 (diff)
While "unicorn -d" requires 'pp' when setting $DEBUG, we did not
account for (rare) Rack applications setting $DEBUG at load time.

Thanks-to: James P (Jim) Robinson Jr <James.Robinson3@Cigna.com>
-rw-r--r--lib/unicorn.rb5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/unicorn.rb b/lib/unicorn.rb
index 4bd7bda..e7bc9ce 100644
--- a/lib/unicorn.rb
+++ b/lib/unicorn.rb
@@ -59,7 +59,10 @@ module Unicorn
         Object.const_get(File.basename(ru, '.rb').capitalize)
       end
 
-      pp({ :inner_app => inner_app }) if $DEBUG
+      if $DEBUG
+        require 'pp'
+        pp({ :inner_app => inner_app })
+      end
 
       return inner_app if no_default_middleware