rack-devel archive mirror (unofficial) https://groups.google.com/group/rack-devel
 help / color / mirror / code / Atom feed
From: James Tucker <jftucker@gmail.com>
To: rack-devel@googlegroups.com
Subject: Re: transforming a rack response into a Goliath-compatible response
Date: Mon, 28 Oct 2013 17:00:17 -0700	[thread overview]
Message-ID: <CABGa_T-tcLaEQSiBXVxtyihaxsgXMwoorvdrGFkBJPw2B4y7Ng@mail.gmail.com> (raw)
In-Reply-To: <CALCE7p=71wVRiv8N1UKBp8zScUAxZB8zosvDCzNk_pAHxLpfyw@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1743 bytes --]

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 Grape + Goliath.
>
> From Grape we get something like this:
>
> [200, {"Content-Type"=>"application/json", "Content-Length"=>"15"},
> #<Rack::BodyProxy:0x007fd606ea26d8 @body=#<Rack::Response:0x007fd606e98430
> @status=200, @header={"Content-Type"=>"application/json",
> "Content-Length"=>"15"}, @chunked=false, @writer=#<Proc:0x007fd606e98228@/Users/dblock/.rvm/gems/ruby-1.9.3-p385/gems/rack-1.5.2/lib/rack/response.rb:27
> (lambda)>, @block=nil, @length=15, @body=["{\"ping\":\"pong\"}"]>,
> @block=#<Proc:0x007fd606ea2688@/Users/dblock/.rvm/gems/ruby-1.9.3-p385/gems/rack-1.5.2/lib/rack/response.rb:79>,
> @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 <http://twitter.com/#!/dblockdotorg> -
> artsy.net - github/dblock <https://github.com/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.

[-- Attachment #2: Type: text/html, Size: 3245 bytes --]

      reply	other threads:[~2013-10-29  0:00 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-18 17:39 Daniel Doubrovkine
2013-10-29  0:00 ` James Tucker [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://groups.google.com/group/rack-devel

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CABGa_T-tcLaEQSiBXVxtyihaxsgXMwoorvdrGFkBJPw2B4y7Ng@mail.gmail.com \
    --to=rack-devel@googlegroups.com \
    --subject='Re: transforming a rack response into a Goliath-compatible response' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Code repositories for project(s) associated with this inbox:

	https://80x24.org/mirrors/rack.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).