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: AS14383 205.234.109.0/24 X-Spam-Status: No, score=0.5 required=3.0 tests=FROM_LOCAL_NOVOWEL, MSGID_FROM_MTA_HEADER shortcircuit=no autolearn=unavailable version=3.3.2 Path: news.gmane.org!not-for-mail From: russell muetzelfeldt Newsgroups: gmane.comp.lang.ruby.rainbows.general Subject: Re: access to Rainbows! config from within the application Date: Fri, 3 Sep 2010 16:55:50 +1000 Message-ID: <2E490C28-2499-482B-8897-CC93DC3F3802@slofith.org> References: <72D036D6-8B60-4CC4-A311-C6F3F56424CA@slofith.org> <20100903062826.GA28607@dcvr.yhbt.net> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 (Apple Message framework v1081) Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1283496905 13926 80.91.229.12 (3 Sep 2010 06:55:05 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 3 Sep 2010 06:55:05 +0000 (UTC) To: Rainbows! list Original-X-From: rainbows-talk-bounces-GrnCvJ7WPxnNLxjTenLetw@public.gmane.org Fri Sep 03 08:55:01 2010 Return-path: Envelope-to: gclrrg-rainbows-talk@m.gmane.org X-Original-To: rainbows-talk-GrnCvJ7WPxnNLxjTenLetw@public.gmane.org Delivered-To: rainbows-talk-GrnCvJ7WPxnNLxjTenLetw@public.gmane.org X-Virus-Scanned: amavisd-new at bluefish.com.au In-Reply-To: <20100903062826.GA28607-yBiyF41qdooeIZ0/mPfg9Q@public.gmane.org> X-Mailer: Apple Mail (2.1081) X-BeenThere: rainbows-talk-GrnCvJ7WPxnNLxjTenLetw@public.gmane.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: rainbows-talk-bounces-GrnCvJ7WPxnNLxjTenLetw@public.gmane.org Errors-To: rainbows-talk-bounces-GrnCvJ7WPxnNLxjTenLetw@public.gmane.org Xref: news.gmane.org gmane.comp.lang.ruby.rainbows.general:127 Archived-At: Received: from rubyforge.org ([205.234.109.19]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1OrQAt-00010r-Ew for gclrrg-rainbows-talk@m.gmane.org; Fri, 03 Sep 2010 08:54:59 +0200 Received: from rubyforge.org (rubyforge.org [127.0.0.1]) by rubyforge.org (Postfix) with ESMTP id DB10D185835E for ; Fri, 3 Sep 2010 02:54:58 -0400 (EDT) Received: from bfg-xserve-1.bluefish.com.au (bfg-xserve-1.bluefish.com.au [203.89.242.132]) by rubyforge.org (Postfix) with ESMTP id ECC3B185835E for ; Fri, 3 Sep 2010 02:54:48 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by bfg-xserve-1.bluefish.com.au (Postfix) with ESMTP id 5E37299038B for ; Fri, 3 Sep 2010 16:54:47 +1000 (EST) Received: from bfg-xserve-1.bluefish.com.au ([127.0.0.1]) by localhost (bfg-xserve-1.bluefish.com.au [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 7g5oP-npjjwy for ; Fri, 3 Sep 2010 16:54:42 +1000 (EST) Received: from [192.168.1.115] (203-206-142-233.perm.iinet.net.au [203.206.142.233]) by bfg-xserve-1.bluefish.com.au (Postfix) with ESMTPSA id 99A9C990380 for ; Fri, 3 Sep 2010 16:54:42 +1000 (EST) On 03/09/2010, at 4:28 PM, Eric Wong wrote: > russell muetzelfeldt wrote: >> >> Is there any way to read the server configuration from within the >> application that's being hosted? > > There's no stable/official internal API, and there probably won't be. > We try not to encourage propagating new, ad-hoc standards that other > Rack servers do not support. absolutely fair enough... > So something like this: > > Rainbows! do > client_max_body_size($client_max_body_size = 200*1024*1024) > end > > If you have more variables you want to set, I know some folks > that use a global hash object or Struct, too. ah, OK. I wasn't sure what context the Rainbows! config was evaluated in and tried MAX_UPLOAD = 200*1024*1024 Rainbows! do client_max_body_size MAX_UPLOAD end and then referencing MAX_UPLOAD in my config.ru where app-wide stuff gets stuffed into Rack::Config but couldn't resolve that constant - rather than wading into looking at the scopes used for config evaluation I thought I'd just ask... rather than using global vars I've packed some constants into a Config module in my app and it's all good. thanks for the pointer! cheers Russell >> (please cc: replies as I'm not subscribed to the list) (now subscribed) _______________________________________________ Rainbows! mailing list - rainbows-talk-GrnCvJ7WPxnNLxjTenLetw@public.gmane.org http://rubyforge.org/mailman/listinfo/rainbows-talk Do not quote signatures (like this one) or top post when replying