Engines 1.2 Released
I’ve just pushed the 1.2 release of the engines plugin forward as the official release found by script/plugin. The 1.2 release is compatible with Rails 1.2, and undoubtedly the best release so far. It’s never been easier to make your plugins more powerful, and I’m very happy with some of the new features 1.2 gives, including routes in plugins and a new “best-practise” for sharing migrations.
Engines are dead…
The new 1.2 release also represents a psychological “reboot” for the engines plugin. Thanks to some of the features we managed to contribute to Rails itself, any plugin can be enhanced by the engines plugin. This is the final blow to the unfortunate misunderstanding that “engines are evil”, because there’s literally no such thing as “an engine” anymore. The engines plugin is just a plugin that makes other plugins more powerful.
Below the cut you can read about some of the enhancements that the engines plugin contributes to making sharing code amongst your projects even simpler.
Plugin migrations
While you could run plugin migrations with earlier versions of the engines plugin, the 1.2 release tackles the issue from an entirely new perspective. The addition of a plugin into your application should be recorded properly in the trail of migrations which describes your app’s history, so now plugin migrations are fully integrated into the main db/migrate stream.
You - the developer - remain in complete control of your databases current state.
Routes in plugins
It’s also trivial to include routes within plugins, and mix them into your applications URL space. The new map.from_plugin method means that you can control the precedence of each plugin’s routing additions, integrating its functionality in the way which best suits your application
All of the old engines good stuff, now available for EVERY plugin
Controllers, models, helpers, components - any plugin can now carry these payloads, and they become instantly available when the engines plugin is loaded - without any changes to your plugin. I’ve already said this, but it’s worth saying again: there is no such thing as an “engine” anymore; they’re all just plugins.
For the full list of changes, check out the CHANGELOG and particularly the UPGRADING notes - if you’re an old-style “engine” developer and you want to rejoin the Light side of the Force, you’re going to need to make some small changes to your code.
Thanks to everyone who’s contributed to this project so far; as ever, if you have any problems please report them on our mailing lists or on the Collaboa site (login required to add new tickets).