From mboxrd@z Thu Jan 1 00:00:00 1970 Delivered-To: chneukirchen@gmail.com Received: by 10.103.134.12 with SMTP id l12cs390913mun; Fri, 16 Oct 2009 10:48:58 -0700 (PDT) Received-SPF: pass (google.com: domain of grbounce-ceibQwUAAAB4YPBqaDIjI2bFOCxyyh3G=chneukirchen=gmail.com@googlegroups.com designates 10.100.172.1 as permitted sender) client-ip=10.100.172.1; Authentication-Results: mr.google.com; spf=pass (google.com: domain of grbounce-ceibQwUAAAB4YPBqaDIjI2bFOCxyyh3G=chneukirchen=gmail.com@googlegroups.com designates 10.100.172.1 as permitted sender) smtp.mail=grbounce-ceibQwUAAAB4YPBqaDIjI2bFOCxyyh3G=chneukirchen=gmail.com@googlegroups.com; dkim=pass header.i=grbounce-ceibQwUAAAB4YPBqaDIjI2bFOCxyyh3G=chneukirchen=gmail.com@googlegroups.com Received: from mr.google.com ([10.100.172.1]) by 10.100.172.1 with SMTP id u1mr1630293ane.18.1255715337454 (num_hops = 1); Fri, 16 Oct 2009 10:48:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=beta; h=domainkey-signature:received:received:x-sender:x-apparently-to :received:received:received:received-spf:received:received:received :from:to:subject:date:user-agent:mime-version:content-type :content-transfer-encoding:message-id:reply-to:sender:precedence :x-google-loop:mailing-list:list-id:list-post:list-help :list-unsubscribe:x-beenthere-env:x-beenthere; bh=0VClGT9lkPxbxNr+/MRSM7ejP7UK9clfo1lkIwzexS8=; b=NITMaQq/mKGmi+9P5GNenDQQjXN51IYfxf6IKByTzmr5/mOjHd52Lk4+u/OQ64kuou HXa6AWSK9rp7nNLjA/D5j3TVnqXCMYvo2sh9G7Lf/v81mGo66igsIkWcG9Lhhtfza5fg eBVz0f8JNUiAWFCIUzxXApa4/RxAaLnroiLNg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlegroups.com; s=beta; h=x-sender:x-apparently-to:received-spf:authentication-results:from :to:subject:date:user-agent:mime-version:content-type :content-transfer-encoding:message-id:reply-to:sender:precedence :x-google-loop:mailing-list:list-id:list-post:list-help :list-unsubscribe:x-beenthere-env:x-beenthere; b=Efz6BvtX317YZIYPd4cgNPo8LhKvrfIe922G/Gc8InnQoTTSjqK0al2e93vYGPAFTI pUBzo0xr7tl265yohSOPLJdzfNAxfNwCbfXP0g2KiwejqfbPvf8E6kIIx2MkBTK0oJbW Vy/6x5JWbCdLRm5CUKUEjQZmJtw5Umd8GuUik= Received: by 10.100.172.1 with SMTP id u1mr151952ane.18.1255715337366; Fri, 16 Oct 2009 10:48:57 -0700 (PDT) Received: by 10.176.233.14 with SMTP id f14gr1692yqh.0; Fri, 16 Oct 2009 10:48:48 -0700 (PDT) X-Sender: ibc@aliax.net X-Apparently-To: rack-devel@googlegroups.com Received: by 10.210.9.19 with SMTP id 19mr133654ebi.24.1255715327416; Fri, 16 Oct 2009 10:48:47 -0700 (PDT) Received: by 10.210.9.19 with SMTP id 19mr133653ebi.24.1255715327396; Fri, 16 Oct 2009 10:48:47 -0700 (PDT) Return-Path: Received: from mail-ew0-f209.google.com (mail-ew0-f209.google.com [209.85.219.209]) by gmr-mx.google.com with ESMTP id 15si359920ewy.4.2009.10.16.10.48.47; Fri, 16 Oct 2009 10:48:47 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.219.209 is neither permitted nor denied by best guess record for domain of ibc@aliax.net) client-ip=209.85.219.209; Authentication-Results: gmr-mx.google.com; spf=neutral (google.com: 209.85.219.209 is neither permitted nor denied by best guess record for domain of ibc@aliax.net) smtp.mail=ibc@aliax.net Received: by ewy5 with SMTP id 5so1729414ewy.12 for ; Fri, 16 Oct 2009 10:48:47 -0700 (PDT) Received: by 10.211.131.39 with SMTP id i39mr1902569ebn.98.1255715327129; Fri, 16 Oct 2009 10:48:47 -0700 (PDT) Return-Path: Received: from ibc-laptop.localnet (30.pool85-58-8.dynamic.orange.es [85.58.8.30]) by mx.google.com with ESMTPS id 10sm170748eyd.34.2009.10.16.10.48.46 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 16 Oct 2009 10:48:46 -0700 (PDT) From: =?utf-8?q?I=C3=B1aki_Baz_Castillo?= To: Rack Development Subject: "run Proc.new" using "do ... end" fails ("{ }" required) Date: Fri, 16 Oct 2009 19:48:43 +0200 User-Agent: KMail/1.12.2 (Linux/2.6.28-15-generic; KDE/4.3.2; x86_64; ; ) MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <200910161948.44121.ibc@aliax.net> Reply-To: rack-devel@googlegroups.com Sender: rack-devel@googlegroups.com Precedence: bulk X-Google-Loop: groups Mailing-List: list rack-devel@googlegroups.com; contact rack-devel+owner@googlegroups.com List-Id: List-Post: List-Help: List-Unsubscribe: , X-BeenThere-Env: rack-devel@googlegroups.com X-BeenThere: rack-devel@googlegroups.com Hi, the following works: 1 ::Rack::Builder.new do 2 map "/" do 3 run Proc.new { |env| 4 [ 404, {"Content-Type" =3D> "text/plain"}), [""] ] 5 } 6 end 7 end but the following gives an error: 1 ::Rack::Builder.new do 2 map "/" do 3 run Proc.new do |env| 4 [ 404, {"Content-Type" =3D> "text/plain"}), [""] ] 5 end 6 end 7 end /home/me/myfile.rb:3:in `new': tried to create Proc object without a block = (ArgumentError) from /home/me/myfile.rb:3:in `block (2 levels) in core' from /usr/local/lib/ruby1.9/gems/1.9.1/gems/rack-1.0.0/lib/rack/builder.rb:= 29:in `instance_eval' from /usr/local/lib/ruby1.9/gems/1.9.1/gems/rack-1.0.0/lib/rack/builder.rb:= 29:in `initialize' from /usr/local/lib/ruby1.9/gems/1.9.1/gems/rack-1.0.0/lib/rack/builder.rb:= 46:in `new' from /usr/local/lib/ruby1.9/gems/1.9.1/gems/rack-1.0.0/lib/rack/builder.rb:= 46:in `map' from /root/svn_local_copies/OpenXDMS/trunk/lib/rack/core.rb:46:in `block in= core' from /usr/local/lib/ruby1.9/gems/1.9.1/gems/rack-1.0.0/lib/rack/builder.rb:= 29:in `instance_eval' from /usr/local/lib/ruby1.9/gems/1.9.1/gems/rack-1.0.0/lib/rack/builder.rb:= 29:in `initialize' from /home/me/myfile.rb:1:in `new' =2E.. It fails in ruby 1.8 and 1.9. Why cannot I use "do-end" syntax for a block instead of "{ }". Of course, Proc.new does allow "do-end" syntax, so I wond= er if this issue has something to do with Rack itself. Thanks. =2D-=20 I=C3=B1aki Baz Castillo