Return-Path: Delivered-To: apmail-couchdb-dev-archive@www.apache.org Received: (qmail 9074 invoked from network); 10 Jan 2011 11:04:04 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 10 Jan 2011 11:04:04 -0000 Received: (qmail 35392 invoked by uid 500); 10 Jan 2011 11:04:04 -0000 Delivered-To: apmail-couchdb-dev-archive@couchdb.apache.org Received: (qmail 35067 invoked by uid 500); 10 Jan 2011 11:04:02 -0000 Mailing-List: contact dev-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@couchdb.apache.org Delivered-To: mailing list dev@couchdb.apache.org Received: (qmail 35059 invoked by uid 99); 10 Jan 2011 11:04:01 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 10 Jan 2011 11:04:01 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=10.0 tests=FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,RFC_ABUSE_POST,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of volker.mische@gmail.com designates 209.85.161.52 as permitted sender) Received: from [209.85.161.52] (HELO mail-fx0-f52.google.com) (209.85.161.52) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 10 Jan 2011 11:03:52 +0000 Received: by fxm5 with SMTP id 5so17996404fxm.11 for ; Mon, 10 Jan 2011 03:03:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:cc:subject:references:in-reply-to :content-type:content-transfer-encoding; bh=9CxkiZ30kylrIy4m9z8kDiFWH5R8SVPN/xI5ir1So4g=; b=b3nsCGNlenCIs2hOo4iKrrisw68ZRfMpgC4w90z8XnWew7KEaDtVDtFkoH02TToMxA 0sOpcerYM3OK6DJeb0qbJl9jNthVOINnmfCivGb3x67hmt+mrHx8YgNGA9CfkJ9T6/Ph 7R6Ij/sDx/JG6PhraxCPIwGW1jcu8Y2WWYe/U= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; b=aeUh7W/24RVlKdM7mvCFZJypXdW7HCemb299+Eq+ehiKSkTElLFGxLNEnMmwvM1EIe VQcAct02HHbP+/ndRnpG8TV6hutrk1D6OTzlVbwZbUfOLKfn9GsUlkeQAHJooIF1Sp65 PNH1v8zLVc5Q1cYcGGYufysaFZTIbmJIA9kDI= Received: by 10.223.100.15 with SMTP id w15mr3381963fan.121.1294657412008; Mon, 10 Jan 2011 03:03:32 -0800 (PST) Received: from [192.168.0.3] (dslb-084-056-005-178.pools.arcor-ip.net [84.56.5.178]) by mx.google.com with ESMTPS id a25sm6886005fak.20.2011.01.10.03.03.30 (version=SSLv3 cipher=RC4-MD5); Mon, 10 Jan 2011 03:03:30 -0800 (PST) Message-ID: <4D2AE790.5000001@gmail.com> Date: Mon, 10 Jan 2011 12:03:44 +0100 From: Volker Mische User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.13) Gecko/20101208 Lightning/1.0b2 Thunderbird/3.1.7 MIME-Version: 1.0 To: dev@couchdb.apache.org CC: Benoit Chesneau Subject: Re: rewriter needed changes References: In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Virus-Checked: Checked by ClamAV on apache.org Hi, On 10.01.2011 01:32, Benoit Chesneau wrote: > 2. Use mongrel2 pattern matching: > > > URL patterns always match from the start, routes are broken into > prefix and pattern part. We uses the routes to find the longest > matching prefix and then tests the pattern. If the pattern matches, > then the route works. If the route doesn't have a pattern, then it's > assumed to match, and you're done. > > The only caveat is you have to wrap your pattern parts in parenthesis, > but these don't mean anything other than to delimit where a pattern > starts. So instead of /images/.⋆.jpg, write /images/(.⋆.jpg) for it to > work. > > [...] > > > This solution is really simple, remove the useless things you have in > regexp and give complete power to the users. Also this kind of parsing > is relatively easy to do in erlang. > > [...] > > Any thoughts ? > > > - benoît I'm +1 for a more powerful rewriter. Though I haven't quite understood how those mongrel2 style rewrites will actually look like. I understand how to match a pattern, but how is it rewritten after that? Cheers, Volker