From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS47066 71.19.144.0/20 X-Spam-Status: No, score=-1.9 required=3.0 tests=AWL,BAYES_00, MSGID_FROM_MTA_HEADER shortcircuit=no autolearn=unavailable version=3.3.2 Path: news.gmane.org!not-for-mail From: Eric Wong Newsgroups: gmane.comp.lang.ruby.clogger.general Subject: [PATCH] README: document $env support for reading Rack env Date: Thu, 14 Aug 2014 19:46:21 +0000 Message-ID: <20140814194621.GA7161@dcvr.yhbt.net> References: <20140814194621.GA7161@dcvr.yhbt.net> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1408045605 26806 80.91.229.3 (14 Aug 2014 19:46:45 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 14 Aug 2014 19:46:45 +0000 (UTC) To: clogger@librelist.org Original-X-From: clogger@librelist.org Thu Aug 14 21:46:36 2014 Return-path: Envelope-to: gcrcg-clogger@m.gmane.org In-Reply-To: <20140814194621.GA7161@dcvr.yhbt.net> List-Archive: List-Help: List-Id: List-Post: List-Subscribe: List-Unsubscribe: Precedence: list Original-Sender: clogger@librelist.org Xref: news.gmane.org gmane.comp.lang.ruby.clogger.general:72 Archived-At: Received: from zedshaw2.xen.prgmr.com ([71.19.156.177]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1XI0yp-00032E-0h for gcrcg-clogger@m.gmane.org; Thu, 14 Aug 2014 21:46:35 +0200 Received: from zedshaw2.xen.prgmr.com (unknown [IPv6:::1]) by zedshaw2.xen.prgmr.com (Postfix) with ESMTP id 15BCA75242 for ; Thu, 14 Aug 2014 19:58:19 +0000 (UTC) This is more portable across different servers than Thread.current in case of non-blocking servers which may be serving multiple clients at once. This is also faster than relying on $e{...} since $e{...} uses eval and that is slow. --- README | 1 + 1 file changed, 1 insertion(+) diff --git a/README b/README index e125b6f..74c8185 100644 --- a/README +++ b/README @@ -88,6 +88,7 @@ that receives a "<<" method: * $pid - process ID of the current process * $e{Thread.current} - Thread processing the request * $e{Actor.current} - Actor processing the request (Revactor or Rubinius) +* $env{variable_name} - any Rack environment variable (e.g. rack.url_scheme) == REQUIREMENTS -- EW