From b7041284279371ffe16de31880c19d48f6a624bb Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Wed, 4 Nov 2009 15:40:21 -0800 Subject: rainbows: set and use process-wide ENV["RACK_ENV"] Merb, Sinatra, Thin, Passenger and now even Unicorn will it, so we set and use it too because that's what all the cool kids are doing. --- bin/rainbows | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'bin/rainbows') diff --git a/bin/rainbows b/bin/rainbows index b3f3a26..eec54b0 100644 --- a/bin/rainbows +++ b/bin/rainbows @@ -4,7 +4,7 @@ require 'unicorn/launcher' require 'rainbows' require 'optparse' -env = "development" +ENV["RACK_ENV"] = "development" daemonize = false listeners = [] options = { :listeners => listeners } @@ -59,7 +59,7 @@ opts = OptionParser.new("", 24, ' ') do |opts| opts.on("-E", "--env ENVIRONMENT", "use ENVIRONMENT for defaults (default: development)") do |e| - env = e + ENV["RACK_ENV"] = e end opts.on("-D", "--daemonize", "run daemonized in the background") do |d| @@ -134,7 +134,7 @@ app = lambda do || Object.const_get(File.basename(config, '.rb').capitalize) end pp({ :inner_app => inner_app }) if $DEBUG - case env + case ENV["RACK_ENV"] when "development" Rack::Builder.new do use Rack::CommonLogger, $stderr -- cgit v1.2.3-24-ge0c7