From: Alexandre Mutel Date: 2009-11-22T07:47:32+09:00 Subject: Re: problem step-in debug through instance_eval Brian Candler wrote: >> instance_eval(File.read("dyn.dsl"),"dyn.dsl") > > Could you not just do this instead? > > load "dyn.dsl" > > The 'self' object context would be lost. But at worst you could pass > that through a constant or a global or thread-local variable, e.g. > dyn.dsl contains > > $SELF.instance_eval { ... original content ... > } I would prefer another option... I would like to keep the dsl code clean, and yes, I need the self... > A debugger is probably not going to be able to find the source file if > the source is not in a file but is in a String. Well, with the 2nd argument of the instance_eval, even if it's more used to report a correct error, could be used for that (and I believe that this is used probably by some of those debuggers). Seems that there is an inconsistency between the different debuggers : JRuby 1.4.0 seems to be able to step in the code without no problem. The ruby-debug-ide 0.4.9 is working well. The ruby-debug-ide19 is not working on this, the -r debug command line is not working... weird... Anyway, i can still live with that. It's working at least from an ide on 1.8.6 and in jruby 1.4.0. I'm also curious if it's a bug (not being able to step in the code) or a feature that is undocumented... -- Posted via http://www.ruby-forum.com/.