The most efficient way to create gem/engine/plugin

Hi all,

We are looking for the most efficient way to create
gem/engine/plugin.Which
can be integrated with any application with minimum effort.

Any suggestion is highly appreciated.