Using the standard output in script/breakpointer

Posted on Sat May 06 15:52:00 UTC 2006

When you use script/breakpointer, once you have stopped in irb, if you try using print, puts or some other way to display something, your ouput goes to your main rails output, not to irb, which is not quite convenient.

First, it took me a while to realize where the output was in fact going. I guessed I was not too quick on that one.

Second, even knowing where to look, I did not find this solution very satisfying.

It turns out there is a solution. the client variable can help you use the right output

client.print “hello\n”

will output:

hello
=> nil

Works the same for puts.

Posted in Rails  |  Tags ,  |  0 comments

Comments

  1. There are no comments yet... Be the first to voice your opinion!

(leave url/email »)

Comment Markup Help