From mboxrd@z Thu Jan 1 00:00:00 1970 Delivered-To: chneukirchen@gmail.com Received: by 10.229.6.76 with SMTP id 12cs61096qcy; Fri, 28 Oct 2011 14:02:09 -0700 (PDT) Return-Path: Received-SPF: pass (google.com: domain of rack-devel+bncCNv0qIbzCBDMsKz1BBoEThoygg@googlegroups.com designates 10.182.155.37 as permitted sender) client-ip=10.182.155.37; Authentication-Results: mr.google.com; spf=pass (google.com: domain of rack-devel+bncCNv0qIbzCBDMsKz1BBoEThoygg@googlegroups.com designates 10.182.155.37 as permitted sender) smtp.mail=rack-devel+bncCNv0qIbzCBDMsKz1BBoEThoygg@googlegroups.com; dkim=pass header.i=rack-devel+bncCNv0qIbzCBDMsKz1BBoEThoygg@googlegroups.com Received: from mr.google.com ([10.182.155.37]) by 10.182.155.37 with SMTP id vt5mr1280654obb.2.1319835727514 (num_hops = 1); Fri, 28 Oct 2011 14:02:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=beta; h=x-beenthere:received-spf:x-sourceip:message-id:date:from:user-agent :mime-version:to:subject:references:in-reply-to:x-cloudmark-analysis :x-original-sender:x-original-authentication-results:reply-to :precedence:mailing-list:list-id:x-google-group-id:list-post :list-help:list-archive:sender:list-subscribe:list-unsubscribe :content-type:content-transfer-encoding; bh=YiwFw5xM/JNBJUPR4+eEVdXBZNOGbW0S60tAZWB7V+I=; b=TJtcgNFYLi4ggYUwGNa8Y1REBcY/TGABFNS+O4JccUPkrznGxLw2+Rzk+KEc0Id2ya VmX5Sw4c6oiCSGiYJXEB5nDaTj3c6X4YQIL3ucUbWbAKOIrZdX1mqvfKStkLF0KP7MeI dND+CL/wHOezG5zBRzCjMIFtiAYOXlIzhzoiU= Received: by 10.182.155.37 with SMTP id vt5mr350389obb.2.1319835724914; Fri, 28 Oct 2011 14:02:04 -0700 (PDT) X-BeenThere: rack-devel@googlegroups.com Received: by 10.231.142.80 with SMTP id p16ls2105410ibu.5.gmail; Fri, 28 Oct 2011 14:02:03 -0700 (PDT) Received: by 10.42.141.194 with SMTP id p2mr4931782icu.8.1319835723790; Fri, 28 Oct 2011 14:02:03 -0700 (PDT) Received: by 10.42.141.194 with SMTP id p2mr4931781icu.8.1319835723779; Fri, 28 Oct 2011 14:02:03 -0700 (PDT) Received: from fep14.mx.upcmail.net (fep14.mx.upcmail.net. [62.179.121.34]) by gmr-mx.google.com with ESMTP id ht10si1385856icc.7.2011.10.28.14.02.02; Fri, 28 Oct 2011 14:02:03 -0700 (PDT) Received-SPF: neutral (google.com: 62.179.121.34 is neither permitted nor denied by best guess record for domain of matthias@waechter.wiz.at) client-ip=62.179.121.34; Received: from edge03.upcmail.net ([192.168.13.238]) by viefep14-int.chello.at (InterMail vM.8.01.02.02 201-2260-120-106-20100312) with ESMTP id <20111028210201.OWAT1569.viefep14-int.chello.at@edge03.upcmail.net> for ; Fri, 28 Oct 2011 23:02:01 +0200 Received: from waechter.wiz.at ([84.112.189.224]) by edge03.upcmail.net with edge id qM201h01Z4qw4HQ03M21mr; Fri, 28 Oct 2011 23:02:01 +0200 X-SourceIP: 84.112.189.224 Received: from [192.168.1.24] (brummsi.waechter.lan. [192.168.1.24]) by waechter.wiz.at (MeTA1-1.0.Alpha5.0) with ESMTPSA (TLS=TLSv1/SSLv3, cipher=CAMELLIA256-SHA, bits=256, verify=NO) id S00000000008FC6C900; Fri, 28 Oct 2011 23:02:00 +0200 Message-ID: <4EAB1844.7060506@waechter.wiz.at> Date: Fri, 28 Oct 2011 23:01:56 +0200 From: =?UTF-8?B?TWF0dGhpYXMgV8OkY2h0ZXI=?= User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:10.0a1) Gecko/20111026 Thunderbird/10.0a1 MIME-Version: 1.0 To: rack-devel@googlegroups.com Subject: Re: Purpose of config.ru (regarding server options), #245 References: <4E884A1D.2080102@waechter.wiz.at> <175A67F5-6EEB-46F4-A91A-967976D17869@gmail.com> In-Reply-To: <175A67F5-6EEB-46F4-A91A-967976D17869@gmail.com> X-Cloudmark-Analysis: v=1.1 cv=M8vhz+/PDo6jLH0Og6FCcf05BWUaCljLuzswz2qsRtE= c=1 sm=0 a=mLeUc3tfZRQA:10 a=Z8bTy6_CSIEA:10 a=IkcTkHD0fZMA:10 a=NEAV23lmAAAA:8 a=x4VFsOJmMxevrTjkJfkA:9 a=jQbdJcvwyeV4A3lhSy8A:7 a=QEXdDO2ut3YA:10 a=HpAAvcLHHh0Zw7uRqdWCyQ==:117 X-Original-Sender: matthias@waechter.wiz.at X-Original-Authentication-Results: gmr-mx.google.com; spf=neutral (google.com: 62.179.121.34 is neither permitted nor denied by best guess record for domain of matthias@waechter.wiz.at) smtp.mail=matthias@waechter.wiz.at Reply-To: rack-devel@googlegroups.com Precedence: list Mailing-list: list rack-devel@googlegroups.com; contact rack-devel+owners@googlegroups.com List-ID: X-Google-Group-Id: 486215384060 List-Post: , List-Help: , List-Archive: Sender: rack-devel@googlegroups.com List-Subscribe: , List-Unsubscribe: , Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Hi James, Thank you for the reply. On 03.10.2011 01:20, James Tucker wrote: > I understand what you want, but I do not want to maintain it. Okay, let’s try it once more. I am really sorry for my initial pull request which might have caused your dislike of the patch as it included patches for another feature. I am really willing to enhance my git skills, so bear with me. The actual change is simple and I think that you won’t have any trouble maintaining it. Remember, it’s coming with tests! :) I haven’t filed a new pull request, so please review the two commits I made on my branch, based on the latest rack/master branch. https://github.com/typingArtist/rack/commit/a10b227c32c061fb18e42204bb6da07e237c80ad https://github.com/typingArtist/rack/commit/0fd5b873de2096bb1b9e83e6f41fb5ed62ea8632 The changes do two things (not counting the changes for the test). First, I changed the eval() to not just return the app object – reduced from the Rack::Builder object via #to_app – but the full Rack::Builder object. As a side effect, this reduces the amount of code that runs within eval(). It allows to get the Builder object’s options to be returned and merged with the options given on the command line and on the special comment line. Second, I added the function which allows setting/adding options and retrieving them once the Builder object creation is done. >> It >> • defines which server technology to use (if there are multiple to choose from or if I want a specific solution), > > This is not an intended feature of config.ru. If you add a shebang with arguments, that will only work on *some* platforms. Not all exec*(2) implementations support arguments. This approach is not portable. Nonono. I refer to the comment line starting as "#\" (yes, a backslash) which carries options – parsing these options is actually the first thing done in parse_file() after reading the .ru file. My patch is all about removing the need to use this #\ special comment line and allow Ruby constructs to be used instead. >> • configures the used server, and > There is no portable way to do this from inside config.ru. Portable in which sense? If I want to use rackup, I can use the #\ line or a whole lot of command line options to choose and configure the server. Why not allow those users to make those settings in a more Ruby-ish way? >> • defines which application and possible middleware to load. > This is all that config.ru is supposed to do. Ouch. Then please remove rackup from rack. > You should be able to run rackup(1) with a different -s flag and the config.ru will work … As long as only portable options are entered to config.ru, the -s flag will work, certainly. At the moment, mongrel2 is special as it requires more and different options than a standard webrick/mongrel/thin server, i.e. just a port to run from. > (furthermore, if the user executes rackup(1) directly, then the shebang is entirely ignored) No, as said above, I am not referring to the standard shebang line but the one with the backslash. > . Your proposal would lead to config.ru files that are not portable in this manner. Yes and very much no. Users who want to use rackup and who want to setup their servers inside config.ru and know the limitations of the #\ line can do that already, but it comes at the price of having only one such line, special string escaping and just supporting strings. My patch allows for a much more elegant way of specifying these options within config.ru’s Ruby part, for those who want to use this feature – maybe it will lead to rackup being much more than an example binary in the future? – Matthias