Thanks, that's a really nice piece of code that helps a lot :)

Why use a @__bsp__ variable instead of using @__behavior_stack__.pop or 
@__behavior_stack__.last ?

It seems that the trick to undo Object.extend is done by erasing all 
instance methods in the modules. Isn't this a bit strange? If Ruby 
allows including modules in an instance's ancestor chain, there should 
be a way to remove them...
-- 
Posted via http://www.ruby-forum.com/.