Engines for Rails 2.0 preview released

posted: December 12th, 2007 · by: Sven

in: Programming · tagged as: , , ·  0 comments »

So, James Adam has published a preview release version of Engines for Rails 2.0 that I’ve helped to put together. Let me quote James from his announcement on the Rails engines mailinglists:

Just a quick note to let you know, should it be relevant, that we’ve 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: http://svn.rails-engines.org/engines/trunk

In order to work with the new plugin loading mechanism in Rails 2.0, you’ll also need to add a line to environment.rb, just after the require of Rails’ boot file:

require File.join(File.dirname(__FILE__), '../vendor/plugins/engines/boot')

After that, you’re good to go. Kick the tires, take it for a spin around the block, and please do let me know how it runs. There may be problems, we’ll try and resolve them as you guys report them back.

(Update: I’ve just seen that there’s also an announcement on the Rails Engines blog which explains some additional details.)

My initial port amended Engines to use the new plugin architecture that Rails 2.0 now implements and it already covered probably 80% of the features of Engines. I also ported and revisited the test cases which by now run with 91 assertations in 49 tests.

James generously granted me commit access for the Engines repository and took care of some of the more challenging features (like fixing the ActionMailer integration) and factored out the entire ActionView part.

Working with James was a great joy and it’s pretty cool to know that Engines is lead by a both rational and nice guy like him.

With now relying on Rails’ own architecture for locating and loading plugins Engines’ own code has slimmed down by a large part. It’s quite telling to look at the SLOC of various Rails Engines releases:

Rails Engines rel_1.1.0                                     
---------------------------------------------
Files      SLOC      CLOC      BLOC      TLOC
   17      1104       506       273      1883

Rails Engines rel_1.2.1                                     
---------------------------------------------
Files      SLOC      CLOC      BLOC      TLOC
   18       633       950       180      1763

Rails Engines for Rails 2.0 (current trunk)                 
---------------------------------------------
Files      SLOC      CLOC      BLOC      TLOC
   18       481       680       105      1266

As you can see, Rails Engines is down to 50% of the SLOC of the 1.1.0 release and removed another 25% from the 1.2.1 release … and that even still includes some general purpose support like sharing assets and testing plugins.

So, I think this is great news!

Rails Engines supplies the need to share controllers, models, views and stuff like routes and assets in a standarized way. It does this in the most reasonable and unobstrusive way I could think of by using the great new plugin architecture features that Rails 2.0 implements.

Leave a comment

Name required
E-Mail and Website optional

If you can read this, you don't use a typical webbrowser that plays nice with CSS.
Please do not fill in anything here!

Hint: Markdown will be applied to your comment. If you post any code, be sure to escape underscores (like so: \_) if you do not want them to be converted to an <em>phasis.

artweb design
Sven Fuchs
Grünberger Str. 65
10245 Berlin, Germany


http://www.artweb-design.de

Fon +49 (30) 47 98 69 96
Fax +49 (30) 47 98 69 97