[TxMt] RubyMate errors

Sune Foldager cryo at cyanite.org
Mon Feb 20 23:08:59 UTC 2006


On 20/02/2006, at 10:51, Allan Odgaard wrote:

> The problem is that for some reason erb does not see local  
> variables when started from RubyMate (it does see globals, so  
> change low => $low and high => $high, and it works).

Yes, I looked into it and the reason is that 'load' sets up a new  
binding to keep local variables from overflowing into the main  
program. Normally this wouldn't be a problem, but for some weird  
reason ERB's run and result take an optional binding argument, which  
_defaults_ to the 'magic' value TOPLEVEL_BINDING.

I don't really see why this is done, as it would seem to make more  
sense to just default to the current binding (which is default for  
eval when not given). Maybe I can change the way RubyMate invokes the  
user code, so I use eval instead of load. I'll look at it tomorrow.

As for the bug in RubyMate with the backtrace, I've fixed it so it at  
least reports the correct error.

-- Sune.




More information about the textmate mailing list