From mboxrd@z Thu Jan 1 00:00:00 1970 Delivered-To: chneukirchen@gmail.com Received: by 10.141.4.15 with SMTP id g15cs349405rvi; Thu, 8 Apr 2010 01:46:52 -0700 (PDT) Received-SPF: pass (google.com: domain of 38Ze9SwgJCpI51FGy60D28w47.yA8Dwy6-z0H072AA2702DAGBE.yA8@groups.bounces.google.com designates 10.90.125.12 as permitted sender) client-ip=10.90.125.12; Authentication-Results: mr.google.com; spf=pass (google.com: domain of 38Ze9SwgJCpI51FGy60D28w47.yA8Dwy6-z0H072AA2702DAGBE.yA8@groups.bounces.google.com designates 10.90.125.12 as permitted sender) smtp.mail=38Ze9SwgJCpI51FGy60D28w47.yA8Dwy6-z0H072AA2702DAGBE.yA8@groups.bounces.google.com; dkim=pass header.i=38Ze9SwgJCpI51FGy60D28w47.yA8Dwy6-z0H072AA2702DAGBE.yA8@groups.bounces.google.com Received: from mr.google.com ([10.90.125.12]) by 10.90.125.12 with SMTP id x12mr487698agc.57.1270716411652 (num_hops = 1); Thu, 08 Apr 2010 01:46:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=beta; h=domainkey-signature:received:x-beenthere:received:received:received :received:received-spf:received:received:received:mime-version :subject:from:in-reply-to:date:message-id:references:to:x-mailer :x-original-authentication-results:x-original-sender:reply-to :precedence:mailing-list:list-id:list-post:list-help:list-archive :x-thread-url:x-message-url:sender:list-subscribe:list-unsubscribe :content-type:content-transfer-encoding; bh=U4SBmLE7+RZaZ8wZQakDxXrmr1JIwW4QhSNXsNAltmI=; b=rCnYI4HkQeTruJoFSRr3zFdDabdKYtqrWSVHzbV2MmdmSLM6Kp0g5JS4BVgEdaUqC2 DBEUDTG7vfsciS8lsIGGhTfJJk7f8BOyqwozgoAS58WQpkzk5WneVA9t1uujMiFZKMvM OQTbUMD6jvV+T0kmBs+e8xtyDkUea5uF4FM7Y= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlegroups.com; s=beta; h=x-beenthere:received-spf:mime-version:subject:from:in-reply-to:date :message-id:references:to:x-mailer:x-original-authentication-results :x-original-sender:reply-to:precedence:mailing-list:list-id :list-post:list-help:list-archive:x-thread-url:x-message-url:sender :list-subscribe:list-unsubscribe:content-type :content-transfer-encoding; b=UCt5ulRmUIVOTJmXRkjVIppB0MZkWHymWQbfO0f9XgAT0krsYXVvhcU2fOcsWFsEza V0wAAuJd6zMaqE6heDVRPCp3fT3mvmQNajLADbVtcZQqcRIboByxA9lc+oj7bYCxEiJM ab5eMbehDPztBS2KuBAqAa25nVeIYCRlKoh9k= Received: by 10.90.125.12 with SMTP id x12mr74822agc.57.1270716401843; Thu, 08 Apr 2010 01:46:41 -0700 (PDT) X-BeenThere: rack-devel@googlegroups.com Received: by 10.87.8.39 with SMTP id l39ls778457fgi.2.p; Thu, 08 Apr 2010 01:46:39 -0700 (PDT) Received: by 10.87.48.38 with SMTP id a38mr634859fgk.20.1270716399168; Thu, 08 Apr 2010 01:46:39 -0700 (PDT) Received: by 10.87.48.38 with SMTP id a38mr634858fgk.20.1270716399139; Thu, 08 Apr 2010 01:46:39 -0700 (PDT) Return-Path: Received: from mail-bw0-f211.google.com (mail-bw0-f211.google.com [209.85.218.211]) by gmr-mx.google.com with ESMTP id 18si1218779fxm.1.2010.04.08.01.46.38; Thu, 08 Apr 2010 01:46:38 -0700 (PDT) Received-SPF: pass (google.com: domain of jftucker@gmail.com designates 209.85.218.211 as permitted sender) client-ip=209.85.218.211; Received: by mail-bw0-f211.google.com with SMTP id 3so1594164bwz.31 for ; Thu, 08 Apr 2010 01:46:38 -0700 (PDT) Received: by 10.204.84.23 with SMTP id h23mr5532722bkl.141.1270716397654; Thu, 08 Apr 2010 01:46:37 -0700 (PDT) Return-Path: Received: from [192.168.1.110] (bb-87-81-237-21.ukonline.co.uk [87.81.237.21]) by mx.google.com with ESMTPS id 16sm7346238bwz.9.2010.04.08.01.46.35 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 08 Apr 2010 01:46:36 -0700 (PDT) Mime-Version: 1.0 (Apple Message framework v1078) Subject: Re: ENV["RACK_ENV"] is not set on startup [rack/rack GH-11] From: James Tucker In-Reply-To: Date: Thu, 8 Apr 2010 09:46:34 +0100 Message-Id: <525E49F0-5E42-4040-8743-98D29A2DF781@gmail.com> References: <87hbnwr4pu.fsf@gmail.com> <20100401071650.GB30070@dcvr.yhbt.net> <35ED831D-F9B9-4D4C-A463-46CF62241EFE@gmail.com> <20100401211302.GA19563@dcvr.yhbt.net> To: rack-devel@googlegroups.com X-Mailer: Apple Mail (2.1078) X-Original-Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of jftucker@gmail.com designates 209.85.218.211 as permitted sender) smtp.mail=jftucker@gmail.com; dkim=pass (test mode) header.i=@gmail.com X-Original-Sender: jftucker@gmail.com Reply-To: rack-devel@googlegroups.com Precedence: list Mailing-list: list rack-devel@googlegroups.com; contact rack-devel+owners@googlegroups.com List-ID: List-Post: , List-Help: , List-Archive: X-Thread-Url: http://groups.google.com/group/rack-devel/t/838c8abdaae55bb8 X-Message-Url: http://groups.google.com/group/rack-devel/msg/16639e4f22651bd0 Sender: rack-devel@googlegroups.com List-Subscribe: , List-Unsubscribe: , Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable On 2 Apr 2010, at 05:03, Matt Todd wrote: > On Thu, Apr 1, 2010 at 5:13 PM, Eric Wong = wrote: >> James Tucker wrote: >>> On 1 Apr 2010, at 09:21, Matt Todd wrote: >>>> I'm not a fan of --env/:env in general, specifically taking issue = with >>>> implicitly modifying the middleware stack. >>>>=20 >>>> Because of this, I'm actually quite happy with the fact that >>>> ENV['RACK_ENV'] isn't set when --env/:env is set. >>>>=20 >>>> I'd much rather this feature go away and let handling environments = be >>>> left up to the user. >>>>=20 >>>> More specifically: >>>> * --env/:env should default to "development" >>>> * --env/:env should set ENV['RACK_ENV'] >>>> * --end/:env should have no other affect >>>> * applications/frameworks should adjust their environments = according >>>> to ENV['RACK_ENV'] as they see fit >>>>=20 >>>> I'm aware that this is mostly done to ease development and lower = the >>>> barrier of entry, which I'm not opposed to doing, but I think there >>>> are other, better ways we can explore such as a separate >>>> feature/option, perhaps only in rackup, that can enable these >>>> middleware. >>>=20 >>> Rackup wants a logger mostly. I'm actually wondering if rackup wants = a >>> logger in all environments (not --envs) apart from CGI. We're never >>> going to please everyone on this front, but maybe we need a way for >>> rackup to turn off the default logger middleware separately to the >>> --env setting. >>>=20 >>> --env development also has one other significantly relevant action, >>> and that is to add Rack::Lint to the middleware stack in order to >>> validate conformance to http and rack specs. I feel this should = stay, >>> regardless of other changes. >>>=20 >>> I propose then, that we modify the logger middleware setup to be >>> affected by another argument, and that --env development adds >>> Rack::Lint, any other --env does not modify the middleware stack at >>> all. >>=20 >> Yes. Lint is special. It is important for development and should be >> easily toggleable between different environments. Heck, I wouldn't = mind >> a version that adds Lint between every part of the middleware stack, >> even. That would of course be a pain to configure by hand. >=20 > Ah, yeah, I see the value of that. >=20 > Maybe there's another solution besides Lint just being a middleware? > Perhaps a Lintified response? Not saying the middleware is bad, just > looking at our options. >=20 >>> This should be compatible with Rails envs, and also satisfy Erics >>> desires. We can also then deprecate the unusual "deployment" >>> environment which seems to be unique to rack. >>=20 >> I prefer Matt's approach to not do any middleware changes to go with >> RACK_ENV (except Lint, above). >>=20 >> Extra command-line options that try to do the same thing as editing >> config.ru make things more confusing than necessary. I was not happy >> with Rails inventing their own middleware configuration, either. I must point you at the Handler implementations in core, most of which = attach one or two middlewares to every app before attaching them to the = server... >=20 > Agreed, agreed, and agreed. Lint is acceptable, but I think there > shouldn't be any other side effects by setting the environment other > than making sure ENV['RACK_ENV'] is set, imo. To be clear, I think > that we are just making it easy for others to utilize this feature, > but if it was taken out of Rack altogether, nothing should change but > give frameworks a little more work. >=20 >> If people want a request logger, they can configure = Rack::CommonLogger, >> Clogger or whatever else in config.ru. >=20 > Agreed. >=20 >=20 > --=20 > Matt Todd > Highgroove Studios > www.highgroove.com > cell: 404-314-2612 > blog: maraby.org >=20 > Scout - Web Monitoring and Reporting Software > www.scoutapp.com >=20 >=20 > --=20 > To unsubscribe, reply using "remove me" as the subject.