2011/1/12 Lukas Renggli <renggli@gmail.com>:
The stack-trace and your code snippet does not match. There are no references (and should be no references) to #compileTree: or RBClass in the code you pasted into the mail.
The thing was to replace the line marked with [1] as I've commented above.
I don't get it, the code you posted looks ok.
RBClass is a class private to the framework, you should never need to instantiate it directly. And if you do, only through an instance of RBNamespace that provides a delta to the current system state. In your example you don't need to do that.
That's exactly what I wanted to know :)
The easiest is probably if you use the refactoring tools as integrated into OB. This does all automatically.
It should be too obvious but I didn't find how. May you comment how to perform the task in the script with OB?
1. Select "MyClass" 2. Menu "Refactoring Scope" -> "Class" 3. Menu "Rewrite Code" and fill the template 4. Accept the rewrite expression 5. Review and accept the proposed changes
This is also show here in a slightly older version of OB: http://www.lukas-renggli.ch/blog/ob-rb-3
Thanks, just an *idea* you may like: It would be cool to select a method category, then a menu item for having a rewrite to be applied only to that category.
Lukas
-- Lukas Renggli www.lukas-renggli.ch