RBAddClassRefactoring ensuring existence
Hi, is it possible to "ensure" that class exists with RBAddClassRefactoring? Right now RBAddClassRefactoring will throw up if the class already exists. I would like it to create the class if it doesn't exist and just do nothing if it already exists. Is it possible? (if not I will just work around it on my side). Thanks, Peter
2016-04-16 20:59 GMT+02:00 Peter Uhnák <i.uhnak@gmail.com>:
Hi,
is it possible to "ensure" that class exists with RBAddClassRefactoring?
Right now RBAddClassRefactoring will throw up if the class already exists.
I would like it to create the class if it doesn't exist and just do nothing if it already exists.
Is it possible? (if not I will just work around it on my side).
Thanks, Peter
The ugly way: [ refactoring execute ] on: RBRefactoringError do:[:ex | ex resume].
The ugly way:
[ refactoring execute ] on: RBRefactoringError do:[:ex | ex resume].
I thought about this, but there are many things that could go wrong (there are about ten preconditions), and I am certainly not interested in breaking my system by accident. However after fighting a lot with refactorings I found that I would need this behavior for many other things⦠ensuring that attribute exists, that method is the same... etc. And since there is no such support in refactorings it's kind of pointless for me to use as I will need to always work around it... or maybe I could make some sort of "Ensuring" framework on top... Peter
participants (2)
-
Nicolai Hess -
Peter Uhnák