rack-devel archive mirror (unofficial) https://groups.google.com/group/rack-devel
 help / color / mirror / Atom feed
From: James Tucker <jftucker@gmail.com>
To: rack-devel@googlegroups.com
Subject: Re: ENV["RACK_ENV"] is not set on startup [rack/rack GH-11]
Date: Thu, 1 Apr 2010 09:49:06 +0100	[thread overview]
Message-ID: <35ED831D-F9B9-4D4C-A463-46CF62241EFE@gmail.com> (raw)
In-Reply-To: <s2z2a8d4a711004010121w99fdae8eo65ba3a8fe0ebc4fe@mail.gmail.com>



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.
> 
> Because of this, I'm actually quite happy with the fact that
> ENV['RACK_ENV'] isn't set when --env/:env is set.
> 
> I'd much rather this feature go away and let handling environments be
> left up to the user.
> 
> 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
> 
> 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.


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.

--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.

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.

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.



-- 
To unsubscribe, reply using "remove me" as the subject.

  reply	other threads:[~2010-04-01  8:49 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-31 13:38 [GitHub] ENV["RACK_ENV"] is not set on startup [rack/rack GH-11] Christian Neukirchen
2010-03-31 13:58 ` Nicolás Sanguinetti
2010-03-31 14:12 ` James Tucker
2010-03-31 22:40 ` Joshua Peek
2010-04-01  7:16   ` Eric Wong
2010-04-01  8:21     ` Matt Todd
2010-04-01  8:49       ` James Tucker [this message]
2010-04-01 21:13         ` Eric Wong
2010-04-02  4:03           ` Matt Todd
2010-04-08  8:46             ` James Tucker
2010-04-08 11:23               ` Matt Todd

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://groups.google.com/group/rack-devel

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=35ED831D-F9B9-4D4C-A463-46CF62241EFE@gmail.com \
    --to=rack-devel@googlegroups.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).