From mboxrd@z Thu Jan 1 00:00:00 1970 Delivered-To: chneukirchen@gmail.com Received: by 10.227.24.3 with SMTP id t3csp81950wbb; Mon, 28 Oct 2013 17:00:20 -0700 (PDT) Return-Path: Received-SPF: pass (google.com: domain of rack-devel+bncBD75LW742ECRBEXVXOJQKGQEFHGHVTI@googlegroups.com designates 10.49.12.100 as permitted sender) client-ip=10.49.12.100 Authentication-Results: mr.google.com; spf=pass (google.com: domain of rack-devel+bncBD75LW742ECRBEXVXOJQKGQEFHGHVTI@googlegroups.com designates 10.49.12.100 as permitted sender) smtp.mail=rack-devel+bncBD75LW742ECRBEXVXOJQKGQEFHGHVTI@googlegroups.com; dkim=pass header.i=@googlegroups.com X-Received: from mr.google.com ([10.49.12.100]) by 10.49.12.100 with SMTP id x4mr5138178qeb.0.1383004819781 (num_hops = 1); Mon, 28 Oct 2013 17:00:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20120806; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :x-original-sender:x-original-authentication-results:reply-to :precedence:mailing-list:list-id:list-post:list-help:list-archive :sender:list-subscribe:list-unsubscribe:content-type; bh=EGK/ikRZYPJ2ZtTDbMUovMQ1DbUNsrV/7YoQziQB78w=; b=DIoFcK0RiRBaCrDMtb03oSdln07M7uGZ2sp/aHz3oY1hl9lOqA6veQ47Qs8q2gDBWO ndQBSAqh7BTtBYdmoe9tVMqpvWeDOK5H1RxRw2dGTl077Xi4YI5fEqjVb6nyWVP8OXRl 4k8KRb4C8WVJul2nE9UPOI3CW2K9If+1GJqvCg3Z0pBumPv9k2r6tMVpngfyJVnDb2ZD t153am2t3jvI6dkZ88F8+kwxEvUtaFyxNGdhzyQHLi6YJhyUQ7qdufsrE8gG0BA2awvg DsMvOLRf4zyNNDgaLfsoevpszi/dd1nbcZMvORMabpHSwV55sibjvPUHkVoanPShH42i mW5g== X-Received: by 10.49.12.100 with SMTP id x4mr618748qeb.0.1383004819388; Mon, 28 Oct 2013 17:00:19 -0700 (PDT) X-BeenThere: rack-devel@googlegroups.com Received: by 10.49.98.35 with SMTP id ef3ls2131994qeb.76.gmail; Mon, 28 Oct 2013 17:00:17 -0700 (PDT) X-Received: by 10.236.75.201 with SMTP id z49mr26118962yhd.0.1383004817869; Mon, 28 Oct 2013 17:00:17 -0700 (PDT) Received: from mail-vb0-x229.google.com (mail-vb0-x229.google.com [2607:f8b0:400c:c02::229]) by gmr-mx.google.com with ESMTPS id yz14si2331378vdb.0.2013.10.28.17.00.17 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 28 Oct 2013 17:00:17 -0700 (PDT) Received-SPF: pass (google.com: domain of jftucker@gmail.com designates 2607:f8b0:400c:c02::229 as permitted sender) client-ip=2607:f8b0:400c:c02::229; Received: by mail-vb0-f41.google.com with SMTP id w8so5090681vbj.14 for ; Mon, 28 Oct 2013 17:00:17 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.58.216.74 with SMTP id oo10mr15337954vec.0.1383004817688; Mon, 28 Oct 2013 17:00:17 -0700 (PDT) Received: by 10.220.192.71 with HTTP; Mon, 28 Oct 2013 17:00:17 -0700 (PDT) In-Reply-To: References: Date: Mon, 28 Oct 2013 17:00:17 -0700 Message-ID: Subject: Re: transforming a rack response into a Goliath-compatible response From: James Tucker To: rack-devel@googlegroups.com X-Original-Sender: jftucker@gmail.com X-Original-Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of jftucker@gmail.com designates 2607:f8b0:400c:c02::229 as permitted sender) smtp.mail=jftucker@gmail.com; dkim=pass header.i=@gmail.com; dmarc=pass (p=NONE dis=NONE) header.from=gmail.com 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: multipart/alternative; boundary=047d7b86e3d8e193a904e9d5e6ed --047d7b86e3d8e193a904e9d5e6ed Content-Type: text/plain; charset=ISO-8859-1 body.each { |string| send_data string } On Fri, Oct 18, 2013 at 10:39 AM, Daniel Doubrovkine wrote: > I am trying to integrate Grape + Goliath. > > From Grape we get something like this: > > [200, {"Content-Type"=>"application/json", "Content-Length"=>"15"}, > # @status=200, @header={"Content-Type"=>"application/json", > "Content-Length"=>"15"}, @chunked=false, @writer=# (lambda)>, @block=nil, @length=15, @body=["{\"ping\":\"pong\"}"]>, > @block=#, > @closed=false>] > > What's the proper way to transform it into a Goliath-compatible response, > basically how do I cleanly translate a BodyProxy into a string body? > > Thanks, > dB. > > -- > > dB. | Moscow - Geneva - Seattle - New York > code.dblock.org - @dblockdotorg - > artsy.net - github/dblock > > -- > > --- > You received this message because you are subscribed to the Google Groups > "Rack Development" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to rack-devel+unsubscribe@googlegroups.com. > For more options, visit https://groups.google.com/groups/opt_out. > -- --- You received this message because you are subscribed to the Google Groups "Rack Development" group. To unsubscribe from this group and stop receiving emails from it, send an email to rack-devel+unsubscribe@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. --047d7b86e3d8e193a904e9d5e6ed Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
body.each { |string| send_data string }


On Fri, Oct 18, 2013 at 10= :39 AM, Daniel Doubrovkine <dblock@dblock.org> wrote:
I am trying to integrate Gr= ape + Goliath.

From Grape we get something like this:

[200, {"Content-Type"=3D>"application= /json", "Content-Length"=3D>"15"}, #<Rack::B= odyProxy:0x007fd606ea26d8 @body=3D#<Rack::Response:0x007fd606e98430 @sta= tus=3D200, @header=3D{"Content-Type"=3D>"application/json= ", "Content-Length"=3D>"15"}, @chunked=3Dfalse,= @writer=3D#<Proc:0x007fd606e98228@/Users/dblock/.rvm/gems/ruby-1.9.3-p3= 85/gems/rack-1.5.2/lib/rack/response.rb:27 (lambda)>, @block=3Dnil, @len= gth=3D15, @body=3D["{\"ping\":\"pong\"}"]>= , @block=3D#<Proc:0x007fd606ea2688@/Users/dblock/.rvm/gems/ruby-1.9.3-p3= 85/gems/rack-1.5.2/lib/rack/response.rb:79>, @closed=3Dfalse>]

What's the proper way to transform it into a Goliat= h-compatible response, basically how do I cleanly translate a BodyProxy int= o a string body?

Thanks,
dB.

--

dB. | Moscow = - Geneva - Seattle - New York
code.dblock.org=A0-=A0@dblockdotorg=A0-=A0artsy.net=A0-=A0github/dblock

--
=A0
---
You received this message because you are subscribed to the Google Groups &= quot;Rack Development" group.
To unsubscribe from this group and stop receiving emails from it, send an e= mail to rack-devel+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

--
 
---
You received this message because you are subscribed to the Google Groups &= quot;Rack Development" group.
To unsubscribe from this group and stop receiving emails from it, send an e= mail to rack-devel+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
--047d7b86e3d8e193a904e9d5e6ed--