rack-devel archive mirror (unofficial) https://groups.google.com/group/rack-devel
 help / color / mirror / Atom feed
* transforming a rack response into a Goliath-compatible response
@ 2013-10-18 17:39 Daniel Doubrovkine
  2013-10-29  0:00 ` James Tucker
  0 siblings, 1 reply; 2+ messages in thread
From: Daniel Doubrovkine @ 2013-10-18 17:39 UTC (permalink / raw)
  To: rack-devel

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

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.

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: transforming a rack response into a Goliath-compatible response
  2013-10-18 17:39 transforming a rack response into a Goliath-compatible response Daniel Doubrovkine
@ 2013-10-29  0:00 ` James Tucker
  0 siblings, 0 replies; 2+ messages in thread
From: James Tucker @ 2013-10-29  0:00 UTC (permalink / raw)
  To: rack-devel

[-- 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 --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-10-29  0:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-10-18 17:39 transforming a rack response into a Goliath-compatible response Daniel Doubrovkine
2013-10-29  0:00 ` James Tucker

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).