News
As I’m sure everyone knows, Rails 2.1.0 was released earlier today, and I’m pleased to say that the engines plugin has been keeping quietly up to date with the changes. Many of the improvements in Rails 2.1.0 have made the plugin simpler, most notably the refactoring of ActionView (see ActionView::TemplateFinder, for example). Thanks to everyone who’s contributed to this release so far; there are plenty of improvements that I’ve yet to integrate!
You can grab a compatible version of the plugin straight from github :
script/plugin install git://github.com/lazyatom/engines.git
Or, direct access to the 2.1.0 tag, in fancier git parlance:
cd vendor/plugins
git clone git://github.com/lazyatom/engines.git
git checkout 2.1.0
If you’re using SVN, do any of these instead (although I’m not sure how often I’ll be keeping that up to date)
script/plugin install engines
svn checkout http://svn.rails-engines.org/engines/tags/rel_2.1.0
As ever, feedback and bug reports are very welcome!
Continue Reading…
Posted by James Adam on Jun 01, 2008
Michael Klishin keeps a great blog for updates to Merb, and I follow his posts regularly. I was a bit bemused to read his latest post about merb-slices, however:
The difference with Rails Engines is that merb-slices use Merb core API for plugins, and nothing else. It does not do crazy black magic, it does not use guesses and Ruby introspection to hook into framework boot process at “god knows when” point in time. It utilizes idea of merb-core to just be simple to extend. Where Rails engines add layers of magic by hooking into complicated Rails boot process with magical alias method chain, it also did not rely just on API in version 1.x. When Rails 2.0 came out with plugins API being refactored, Engines collapse on upgrade of your app.
Certainly in the past, the interaction between the engines plugin and Rails updates has been… well, interesting. That’s because at the time, the Rails core developers took a stance that they didn’t want to support ‘slice’ style development. The plugin mechanism in Rails 1.0 was simple and unsophisticated, so we had to do ‘crazy black magic’, as you call it, to get engines to work.
However, times have changed. Please take a look at how the plugin mechanism works in Rails 2.0. It’s designed to be cleanly extensible, so you don’t need to resort to ‘black magic’, and hopefully it succeeds at that. And a lot of those improvements have been a result (directly or indirectly) of the things I felt plugins should be able to do - the things that the engines plugin originally patched in. If you need some evidence of this, the current plugin mechanism was implemented by, well, me.
Probably future versions of Engines, like 2.5 or 3.0 will be much much cleaner and won’t use hacks, I do not know. I just think that Slices and Engines example shows how simple and modular code applied to simple task (extand darn load paths and register some routes; it is that simple) is beautiful, does not break and easy to comprehend compared to monuments of personal cleverness. It also shows how easy it is to hook into Merb boot process using one simple convention.
There are a couple of things going on here. Firstly, I think it’s great that merb can support changes in it’s behaviour very easily. As I said a few days back, to have that kind of extensibility supported cleanly by the framework makes life a lot easier. So Michael’s point here could just be that merb is cleaner internally that Rails is. Fine.
But - “Probably future versions of Engines, like 2.5 or 3.0 will be much much cleaner and won’t use hacks” - huh? Please point out the hacks you’re refering to. Have you actually looked at the engines plugin source code recently? This post reads to me as classic FUD about engines, feeding misconception back into public opinion because you don’t want ‘merb-slices’ to be attacked in the same way that Rails engines were a couple of years back.
It’s fine if you think that merb is ‘better’ than Rails, but if you’re going to decry code as hacky, at least be constructive about it.
Continue Reading…
Posted by James Adam on May 24, 2008
Ezra just posted about a new feature for merb - slices. Seems like these cover much of what the engines plugin enables for Rails - sharing models, controllers, views and assets between your applications. It’s really great to see framework-level support for this kind of development style, as it can be incredibly powerful; certainly there’s a balance to be sought when sharing implementation between projects, but that balance is for the developer to gauge, without necessarily having to work against the framework. Great stuff!
Continue Reading…
Posted by James Adam on May 22, 2008
I’ve been using Git for a few months now, so I’m happy to say that the engines plugin development is going to be heading over to GitHub in the near future.
Continue Reading…
Posted by James Adam on Apr 28, 2008
Hi all,
Just a quick note to let you know, should it be relevant, that we’re readied a new release of the Engines plugin, revamped and ready for
Rails 2.0, and would absolutely love for you to start using it and sending feedback about what’s broken, what’s missing and what could be improved.
Grab the plugin here, check out the README, and find out more after the cut…
Continue Reading…
Posted by James Adam on Dec 11, 2007