Tuesday, December 4, 2007

Plugin Development

Developing a Plugin for Rails can be a lot of fun. You can find a good guide here with the complete guide to rails plugins.

Piston

Be sure to read Managing Rails Plugins with Piston.

The best way to produce a good plugin is to create a separate application which can be used to test the plugin and use piston to import changes into you main application using 'piston update'.

Avoid Restarting Mongrel

I have learned one helpful trick. By default, you will have to restart your Mongrel server every time you make a change to your plugin. You can avoid this by placing the following code at the top of your plugin's init.rb file:

  Dependencies.load_once_paths.delete(lib_path)

0 comments: