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 readable. or am i missing something? regads --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On 1/16/07, dweinand <mail4ng-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote:> 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 > readable.debug() just calls to_yaml on whatever you pass it. So, require ''yaml'' variable.to_yaml instead of variable.inspect. Also, if your debugger is automatically calling #inspect: require ''yaml'' class Object def inspect to_yaml end end -- Chris Wanstrath http://errtheblog.com --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
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? On 17 Jan., 22:04, "Chris Wanstrath" <c...-G5sj8e7vJc8@public.gmane.org> wrote:> On 1/16/07, dweinand <mail...-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote: > > > 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 > > readable.debug() just calls to_yaml on whatever you pass it. > > So, > > require ''yaml'' > > variable.to_yaml > > instead of variable.inspect. > > Also, if your debugger is automatically calling #inspect: > > require ''yaml'' > class Object > def inspect > to_yaml > end > end > > -- > Chris Wanstrathhttp://errtheblog.com--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---