how to format '.inspect' output?

is there a way to get the .inspect output formatted like the <%= debug
whatever %> output in views?
i'm using ruby-debug. would be great if the output could be more
or am i missing something?


debug() just calls to_yaml on whatever you pass it.


require 'yaml'


instead of variable.inspect.

Also, if your debugger is automatically calling #inspect:

require 'yaml'
class Object
  def inspect

thx, already tried variable.to_yaml.

its a bit more readable.
but unfortunately the \n will not be displayed as line breaks in
console window.

but i realised that pp will format the ruby-debug output readable.
don't know if its a bug. "pp" is documented as alias for "p expression
=> evaluate expression and print its value"

so pp fits for my needs. 'til now.

thanks anyway

just seen that the development console isnt dispaying the yaml \n as
line breaks.
am i missing some settings?