rack-devel archive mirror (unofficial) https://groups.google.com/group/rack-devel
 help / color / mirror / code / 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

rack-devel archive mirror (unofficial) https://groups.google.com/group/rack-devel

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://public-inbox.org/rack-devel

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V1 rack-devel rack-devel/ https://public-inbox.org/rack-devel \
		rack-devel@googlegroups.com
	public-inbox-index rack-devel

Example config snippet for mirrors.
Newsgroups are available over NNTP:
	nntp://news.public-inbox.org/inbox.comp.lang.ruby.rack.devel
	nntp://7fh6tueqddpjyxjmgtdiueylzoqt6pt7hec3pukyptlmohoowvhde4yd.onion/inbox.comp.lang.ruby.rack.devel
	nntp://news.gmane.io/gmane.comp.lang.ruby.rack.devel
 note: .onion URLs require Tor: https://www.torproject.org/

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

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

AGPL code for this site: git clone https://public-inbox.org/public-inbox.git