views:

42

answers:

3

Is there any way to use the command line to debug an ERB file? I would like to know if there is any way to get rdebug or rdebug-ide to do this.

A: 

There probably is, but I have been doing the equiv of print.

puts YAML::dump(variable)

easement
Yes, I can do this, but I'm trying to build a web page front end for the ERB debugger, so really need something that can do it programmatically. So far I can't find anything like ruby-debug. I have heard netbeans can do it but its not documented anywhere.
Zubair
A: 

Try something like, STDERR.puts "Debug message" and it'll appear in the console window or in your log if it's Rails or Sinatra.

The Wicked Flea
This can be done in standard Ruby too, to print debug statements, but I'm looking for a debugger which allows you to manually step through the code programatically.
Zubair
Sorry, but I don't think you can do this.
The Wicked Flea
+1  A: 

What if you monkey patch the method you need, and you include a call to debugger? You'd need the ruby-debug gem for the debugger method.

Geo
I have since stopped trying to do this, but at the time I was going to do something like that. Its just s shame it had not already been done
Zubair