Reloading Your plugin in development mode

For one of my customers I was developing API, wrapped around some older service. This API was meant to be used by new application developed (using RoR of course) by customer itself. Since I was only wrapping old code I could finish quite soon, before main application was ready.

The problem was that API was not defined in every detail upfront. Since I did plain wrapping I did keep old business logic and flow with this API, and new application was not thinking the same way. This was seen before so we have agreed that integration will be done by me and we needed simple way to hook into new application with my integration code. One of obvious ways to achieve it is to use Rails plugin to keep code separated.

Things went OK but I want to share one thing I have learned. Using Rails plugin to wrap code is good idea with one issue – code reloading. Plugin code is not reloaded in development mode (like it is done with controllers or models) so changes in plugin will be visible after application restart. Not very comfortable for development…

Tools for developer

(c) batega

Being lazy and didn’t want to restart application with every change I make, I have started search for some workaround:

Continue reading