Topic: developing additions with rails app or seperately

Hi folks,

I'm wondering how you guys develop you additions by what i mean the stuff that goes into the lib/ dir...
Do you develop it with the current rails app you are working on and later try to move it to a separate plugin.. or do you guys create a plugin right away and when done developing put it into your actual rails application?

For example i was developing an rails application and needed a navigation... first i started to build it in the normal way by adding models to the application.. and so on... after a little developing i decided to build a Plugin for my models... now... when i realize this.. should i go and create a separate rails plugin and move all the code and testing stuff there... and put it back into my application when i think the plugin is done... or should i just continue and fill the lib/ directory of my rails application?

How do you guys do it? how do you decide when to move the code?

Thanks.. and i hope someone understands what i'm trying to ask :-)