<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Rails Engines News</title>
    <link>http://rails-engines.org/rss/news/</link>
    <language>en-us</language>
    <ttl>40</ttl>
    <description>Updates from the Rails Engines site.</description>
    
    
        <item>
          <title>Engines at RailsConf</title>
          <description>
            &lt;p&gt;I gave my first presentation since &lt;a href=&quot;http://www.flickr.com/photos/lazyatom/128536540/&quot;&gt;Canada On Rails&lt;/a&gt; on Rails Engines at &lt;a href=&quot;http://en.oreilly.com/rails2009/public/schedule/detail/8497&quot;&gt;this year&amp;#8217;s RailsConf&lt;/a&gt;, to cover the new support in &lt;a href=&quot;http://rails-engines.org/news/2009/02/02/engines-in-rails-2-3/&quot;&gt;Rails 2.3 for engines&lt;/a&gt;, including the problems you might encounter, how to handle them, and some advice about how to work effectively with this kind of re-use.&lt;/p&gt;
              &lt;a href=&quot;/news/2009/05/18/engines-at-railsconf/#extended&quot;&gt;Continue Reading&amp;#8230;&lt;/a&gt;
          </description>
          <pubDate>Mon, 18 May 2009 03:19:00 GMT</pubDate>
          <guid>http://rails-engines.org/news/2009/05/18/engines-at-railsconf/</guid>
          <link>http://rails-engines.org/news/2009/05/18/engines-at-railsconf/</link>
        </item>
    
        <item>
          <title>Edge engines now compatible with Rails 2.3</title>
          <description>
            &lt;p&gt;I&amp;#8217;ve just made the appropriate changes to bring the engines plugin into compatibility with Rails 2.3, and &lt;a href=&quot;http://rails-engines.org/news/2009/02/02/engines-in-rails-2-3/&quot;&gt;the engine features it implements&lt;/a&gt;. You can find these changes in the &amp;#8216;edge&amp;#8217; branch of the git repository, which I&amp;#8217;m currently working on now.&lt;/p&gt;
              &lt;a href=&quot;/news/2009/04/20/edge-engines-now-compatible-with-rails-2-3/#extended&quot;&gt;Continue Reading&amp;#8230;&lt;/a&gt;
          </description>
          <pubDate>Mon, 20 Apr 2009 03:11:00 GMT</pubDate>
          <guid>http://rails-engines.org/news/2009/04/20/edge-engines-now-compatible-with-rails-2-3/</guid>
          <link>http://rails-engines.org/news/2009/04/20/edge-engines-now-compatible-with-rails-2-3/</link>
        </item>
    
        <item>
          <title>Engines in Rails 2.3</title>
          <description>
            &lt;p&gt;Some support for &amp;#8216;engine&amp;#8217; plugins has been merged into the Rails core codebase in Rails 2.3. In this guide, I&amp;#8217;ll try to explain what works, what has changed, and what is currently missing compared to the original engines plugin.&lt;/p&gt;

&lt;h1&gt;What works&lt;/h1&gt;

&lt;p&gt;The core of the engines plugin has always been sharing controllers, models and views seamlessly from within a plugin. I&amp;#8217;m glad to say that this is now fully supported by Rails itself. The same &lt;code&gt;app/controllers&lt;/code&gt; and &lt;code&gt;app/models&lt;/code&gt; folders will be added to the &lt;code&gt;$LOAD_PATH&lt;/code&gt; in the appropriate order.&lt;/p&gt;

&lt;p&gt;Secondly, loading &lt;code&gt;views&lt;/code&gt; also works in the same way you&amp;#8217;d expect. This means that you can override views and partials in your application, just like with the original engines plugin.&lt;/p&gt;

&lt;h1&gt;What has changed&lt;/h1&gt;

&lt;p&gt;Rails 2.3 also brings support for loading routes from plugins, but the technique has slightly changed. With Rails 2.3, create your routing file in your plugin as &lt;code&gt;config/routes.rb&lt;/code&gt; (the engines plugin did not require the &lt;code&gt;config&lt;/code&gt; directory). &lt;/p&gt;

&lt;p&gt;The other change is that they should be formatted as a normal routing file. For example, with the file &lt;code&gt;app/controllers/awesome_controller.rb&lt;/code&gt; in your plugin, the &lt;code&gt;config/routes.rb&lt;/code&gt; could be&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;ActionController::Routing::Routes.draw do |map|
  map.blah '/awesome', :controller =&amp;gt; 'awesome'
end
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;The main difference here is that you need to include the &lt;code&gt;ActionController::Routing::Routes.draw&lt;/code&gt; line.&lt;/p&gt;

&lt;h1&gt;What is missing&lt;/h1&gt;

&lt;p&gt;Sadly, there are a few features of the engines plugin that have not been ported to Rails 2.3 yet. Those are:&lt;/p&gt;

&lt;h2&gt;Migrations from plugins&lt;/h2&gt;

&lt;p&gt;It&amp;#8217;s not possibly to run migrations from plugins with Rails 2.3. There are a number of reasons for this, but principally the problem comes from needing to be able to determine which migrations from which plugins have already run.&lt;/p&gt;

&lt;p&gt;If you&amp;#8217;re using timestamped migrations there is no problem, since the likelihood of a timestamp collision is quite low. In this case, I would recommend writing a simple task or script to copy migrations from your plugin into the main &lt;code&gt;db/migrate&lt;/code&gt; directory. It&amp;#8217;s important that the migrations are anchored in some way to the main migration directory, since some folks use migrations to recreate their database rather than &lt;code&gt;schema.rb&lt;/code&gt;, and so the set of migrations should accurately reflect the actual state of the application at any point in time.&lt;/p&gt;

&lt;p&gt;If you are &lt;em&gt;not&lt;/em&gt; using timestamped migrations, this is a bigger problem. Imagine you are developing your application, and have several migrations:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;/my_app/db/migrate/001_create_users.rb
/my_app/db/migrate/002_add_widgets.rb
/my_app/db/migrate/003_reticulate_splines.rb
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;You then install a plugin with some migrations:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;/my_app/vendor/plugins/my_plugin/db/migrate/001_install_the_awesome.rb
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;We now have two migrations with the version &amp;#8216;1&amp;#8217; - one from the app (which has probably already run), and one pending from the plugin. There&amp;#8217;s no way to tell, at the moment, that the plugin migration needs to be run.&lt;/p&gt;

&lt;p&gt;I have some ideas for how to fix this, and so hopefully we&amp;#8217;ll see some progress soon.&lt;/p&gt;

&lt;h2&gt;Public Assets in plugins&lt;/h2&gt;

&lt;p&gt;The engines plugin will mirror files from &lt;code&gt;public&lt;/code&gt; or &lt;code&gt;assets&lt;/code&gt; directories into the main application &lt;code&gt;public&lt;/code&gt; directory, so that those files can be served directly to browsers. The plugin also augmented some of the view helpers so they could reference these files.&lt;/p&gt;

&lt;p&gt;Rails 2.3 won&amp;#8217;t automatically do this for you, but it shouldn&amp;#8217;t be too arduous to write a few lines of code in &lt;code&gt;init.rb&lt;/code&gt; to copy files into the &lt;code&gt;public&lt;/code&gt; directory. However, without the helper additions of the engines plugin, your files won&amp;#8217;t be automatically &amp;#8216;namespaced&amp;#8217; according to plugin, so if two plugins try to copy a file called &lt;code&gt;styles.css&lt;/code&gt;, one will overwrite the other. The solution? Try copying your files to a unique filename or subdirectory to avoid these clashes.&lt;/p&gt;

&lt;h2&gt;Code mixing&lt;/h2&gt;

&lt;p&gt;Rails 2.3 doesn&amp;#8217;t attempt to do any of the &amp;#8216;code mixing&amp;#8217; that the engines plugin does. For those of you not in the know, this is the functionality that lets your application override a single method in a controller or helper, without having to copy the whole file from the plugin into your application.&lt;/p&gt;

&lt;p&gt;I cannot say for sure, but I doubt this feature will ever make it into Rails itself, and to be honest, I think that&amp;#8217;s probably a good thing. While the code mixing mechanism is quite neat, there are other ways of overriding the implementation of methods which are more typically Rubyish, and involve less magic. I&amp;#8217;ll try and post some examples here soon.&lt;/p&gt;

&lt;h1&gt;There you go&lt;/h1&gt;

&lt;p&gt;I hope that&amp;#8217;s outlined the engines support in Rails 2.3 in a reasonably clear way. I hope that we&amp;#8217;ll be able to merge some of the simpler missing features into the core (migrations and assets, notable) soon. Maybe you&amp;#8217;re the one to write that patch? PDI :)&lt;/p&gt;
              &lt;a href=&quot;/news/2009/02/02/engines-in-rails-2-3/#extended&quot;&gt;Continue Reading&amp;#8230;&lt;/a&gt;
          </description>
          <pubDate>Mon, 02 Feb 2009 00:40:00 GMT</pubDate>
          <guid>http://rails-engines.org/news/2009/02/02/engines-in-rails-2-3/</guid>
          <link>http://rails-engines.org/news/2009/02/02/engines-in-rails-2-3/</link>
        </item>
    
        <item>
          <title>Engines 2.1.0 release</title>
          <description>
            &lt;p&gt;As I&amp;#8217;m sure everyone knows, &lt;a href=&quot;http://github.com/rails/rails/commits/v2.1.0&quot;&gt;Rails 2.1.0&lt;/a&gt; was released &lt;a href=&quot;http://weblog.rubyonrails.org/2008/6/1/rails-2-1-time-zones-dirty-caching-gem-dependencies-caching-etc&quot;&gt;earlier today&lt;/a&gt;, and I&amp;#8217;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 &lt;a href=&quot;http://github.com/lazyatom/engines/network&quot;&gt;everyone who&amp;#8217;s contributed&lt;/a&gt; to this release so far; there are plenty of improvements that I&amp;#8217;ve yet to integrate!&lt;/p&gt;

&lt;p&gt;You can grab a compatible version of the plugin straight from github :&lt;/p&gt;

&lt;pre class=&quot;code shell&quot;&gt;&lt;code&gt;script/plugin install git://github.com/lazyatom/engines.git&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Or, direct access to the 2.1.0 tag, in fancier git parlance:&lt;/p&gt;

&lt;pre class=&quot;code shell&quot;&gt;&lt;code&gt;cd vendor/plugins
git clone git://github.com/lazyatom/engines.git
git checkout 2.1.0&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;If you&amp;#8217;re using SVN, do any of these instead (although I&amp;#8217;m not sure how often I&amp;#8217;ll be keeping that up to date)&lt;/p&gt;

&lt;pre class=&quot;code shell&quot;&gt;&lt;code&gt;script/plugin install engines
svn checkout http://svn.rails-engines.org/engines/tags/rel_2.1.0&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;As ever, &lt;a href=&quot;http://rails-engines.org/bugs&quot;&gt;feedback and bug reports&lt;/a&gt; are very welcome!&lt;/p&gt;
              &lt;a href=&quot;/news/2008/06/01/engines-2-1-0-release/#extended&quot;&gt;Continue Reading&amp;#8230;&lt;/a&gt;
          </description>
          <pubDate>Sun, 01 Jun 2008 03:31:00 GMT</pubDate>
          <guid>http://rails-engines.org/news/2008/06/01/engines-2-1-0-release/</guid>
          <link>http://rails-engines.org/news/2008/06/01/engines-2-1-0-release/</link>
        </item>
    
        <item>
          <title>Merb slices, again</title>
          <description>
            &lt;p&gt;Michael Klishin keeps &lt;a href=&quot;http://www.novemberain.com/&quot;&gt;a great blog&lt;/a&gt; for updates to Merb, and I follow his posts regularly. I was a bit bemused to read &lt;a href=&quot;http://www.novemberain.com/2008/5/23/how-merb-slices-are-different-from-rails-engines&quot;&gt;his latest post about merb-slices&lt;/a&gt;, however:&lt;/p&gt;

&lt;blockquote&gt;
    &lt;p&gt;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 &amp;#8220;god knows when&amp;#8221; 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.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Certainly in the past, the interaction between the engines plugin and Rails updates has been&amp;#8230; well, interesting. That&amp;#8217;s because at the time, the Rails core developers took a stance that they didn&amp;#8217;t want to support &amp;#8216;slice&amp;#8217; style development. The plugin mechanism in Rails 1.0 was simple and unsophisticated, so we had to do &amp;#8216;crazy black magic&amp;#8217;, as you call it, to get engines to work.&lt;/p&gt;

&lt;p&gt;However, times have changed. Please take a look at how the plugin mechanism works in Rails 2.0. It&amp;#8217;s designed to be cleanly extensible, so you don&amp;#8217;t need to resort to &amp;#8216;black magic&amp;#8217;, 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, &lt;a href=&quot;http://dev.rubyonrails.org/ticket/9795&quot;&gt;me&lt;/a&gt;.&lt;/p&gt;

&lt;blockquote&gt;
    &lt;p&gt;Probably future versions of Engines, like 2.5 or 3.0 will be much much cleaner and won&amp;#8217;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.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;There are a couple of things going on here. Firstly, I think it&amp;#8217;s great that merb can support changes in it&amp;#8217;s behaviour very easily. &lt;a href=&quot;http://rails-engines.org/news/2008/05/22/merb-slices/&quot;&gt;As I said a few days back&lt;/a&gt;, to have that kind of extensibility supported cleanly by the framework makes life a lot easier. So Michael&amp;#8217;s point here could just be that merb is cleaner internally that Rails is. Fine.&lt;/p&gt;

&lt;p&gt;But - &amp;#8220;Probably future versions of Engines, like 2.5 or 3.0 will be much much cleaner and won&amp;#8217;t use hacks&amp;#8221; - huh? Please point out the hacks you&amp;#8217;re refering to. Have you actually &lt;em&gt;looked&lt;/em&gt; at the engines plugin source code recently? &lt;a href=&quot;http://www.novemberain.com/2008/5/23/how-merb-slices-are-different-from-rails-engines&quot;&gt;This post&lt;/a&gt; reads to me as classic FUD about engines, feeding misconception back into public opinion because you don&amp;#8217;t want &amp;#8216;merb-slices&amp;#8217; to be attacked in the same way that Rails engines were a couple of years back.&lt;/p&gt;

&lt;p&gt;It&amp;#8217;s fine if you think that merb is &amp;#8216;better&amp;#8217; than Rails, but if you&amp;#8217;re going to decry code as hacky, at least be constructive about it.&lt;/p&gt;
              &lt;a href=&quot;/news/2008/05/24/merb-slices-again/#extended&quot;&gt;Continue Reading&amp;#8230;&lt;/a&gt;
          </description>
          <pubDate>Sat, 24 May 2008 04:28:24 GMT</pubDate>
          <guid>http://rails-engines.org/news/2008/05/24/merb-slices-again/</guid>
          <link>http://rails-engines.org/news/2008/05/24/merb-slices-again/</link>
        </item>
    
        <item>
          <title>Merb slices</title>
          <description>
            &lt;p&gt;Ezra just posted about a new feature for merb - &lt;a href=&quot;http://brainspl.at/articles/2008/05/21/merb-slices&quot;&gt;slices&lt;/a&gt;. Seems like these cover much of what the engines plugin enables for Rails - sharing models, controllers, views and assets between your applications. It&amp;#8217;s really great to see framework-level support for this kind of development style, as it can be incredibly powerful; certainly there&amp;#8217;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!&lt;/p&gt;
              &lt;a href=&quot;/news/2008/05/22/merb-slices/#extended&quot;&gt;Continue Reading&amp;#8230;&lt;/a&gt;
          </description>
          <pubDate>Thu, 22 May 2008 04:15:17 GMT</pubDate>
          <guid>http://rails-engines.org/news/2008/05/22/merb-slices/</guid>
          <link>http://rails-engines.org/news/2008/05/22/merb-slices/</link>
        </item>
    
        <item>
          <title>Heading for Github</title>
          <description>
            &lt;p&gt;I&amp;#8217;ve been using Git for a few months now, so I&amp;#8217;m happy to say that the engines plugin development is going to be heading over to &lt;a href=&quot;http://github.com/lazyatom/engines&quot;&gt;GitHub&lt;/a&gt; in the near future.&lt;/p&gt;
              &lt;a href=&quot;/news/2008/04/28/heading-for-github/#extended&quot;&gt;Continue Reading&amp;#8230;&lt;/a&gt;
          </description>
          <pubDate>Mon, 28 Apr 2008 10:26:26 GMT</pubDate>
          <guid>http://rails-engines.org/news/2008/04/28/heading-for-github/</guid>
          <link>http://rails-engines.org/news/2008/04/28/heading-for-github/</link>
        </item>
    
        <item>
          <title>Engines 2.0 (ish)</title>
          <description>
            &lt;p&gt;Hi all,&lt;/p&gt;

&lt;p&gt;Just a quick note to let you know, should it be relevant, that we&amp;#8217;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&amp;#8217;s broken, what&amp;#8217;s missing and what could be improved.&lt;/p&gt;

&lt;p&gt;Grab the plugin &lt;a href=&quot;http://svn.rails-engines.org/engines/trunk&quot;&gt;here&lt;/a&gt;, check out the &lt;a href=&quot;http://api.rails-engines.org&quot;&gt;README&lt;/a&gt;, and find out more after the cut&amp;#8230;&lt;/p&gt;
              &lt;a href=&quot;/news/2007/12/11/engines-2-0-ish/#extended&quot;&gt;Continue Reading&amp;#8230;&lt;/a&gt;
          </description>
          <pubDate>Tue, 11 Dec 2007 06:02:00 GMT</pubDate>
          <guid>http://rails-engines.org/news/2007/12/11/engines-2-0-ish/</guid>
          <link>http://rails-engines.org/news/2007/12/11/engines-2-0-ish/</link>
        </item>
    
        <item>
          <title>Plugems, Welcome!</title>
          <description>
            &lt;p&gt;&lt;a href=&quot;http://revolutiononrails.blogspot.com/&quot;&gt;Revolution on Rails&lt;/a&gt; have &lt;a href=&quot;http://revolutiononrails.blogspot.com/2007/05/release-plugems-runtime.html&quot;&gt;finally released their solution&lt;/a&gt; to shared dependencies between Rails applications, which they have called &lt;a href=&quot;http://rubyforge.org/projects/plugems&quot;&gt;Plugems&lt;/a&gt; (see what they&amp;#8217;ve done there?). In their announcement they discuss some of the differences between plugins, &amp;#8220;engines&amp;#8221; (&lt;a href=&quot;http://rails-engines.org/news/2007/01/03/engines-are-dead-long-live-engines/&quot;&gt;ahem!&lt;/a&gt;) and Plugems, and I think they&amp;#8217;ve raised some interesting points.&lt;/p&gt;
              &lt;a href=&quot;/news/2007/05/02/plugems-welcome/#extended&quot;&gt;Continue Reading&amp;#8230;&lt;/a&gt;
          </description>
          <pubDate>Wed, 02 May 2007 03:02:19 GMT</pubDate>
          <guid>http://rails-engines.org/news/2007/05/02/plugems-welcome/</guid>
          <link>http://rails-engines.org/news/2007/05/02/plugems-welcome/</link>
        </item>
    
        <item>
          <title>Engines 1.2 Released</title>
          <description>
            &lt;p&gt;I&amp;#8217;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&amp;#8217;s never been easier to make your plugins more powerful, and I&amp;#8217;m very happy with some of the new features 1.2 gives, including routes in plugins and a new &amp;#8220;best-practise&amp;#8221; for sharing migrations.&lt;/p&gt;

&lt;h2&gt;Engines are dead&amp;#8230;&lt;/h2&gt;

&lt;p&gt;The new 1.2 release also represents a psychological &amp;#8220;reboot&amp;#8221; for the engines plugin. Thanks to some of the features we managed to contribute to Rails itself, &lt;em&gt;any&lt;/em&gt; plugin can be enhanced by the engines plugin. This is the final blow to the unfortunate misunderstanding that &amp;#8220;engines are evil&amp;#8221;, because there&amp;#8217;s literally no such thing as &amp;#8220;an engine&amp;#8221; anymore. The engines plugin is just a plugin that makes &lt;em&gt;other&lt;/em&gt; plugins more powerful.&lt;/p&gt;

&lt;p&gt;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.&lt;/p&gt;
              &lt;a href=&quot;/news/2007/02/04/engines-1-2-released/#extended&quot;&gt;Continue Reading&amp;#8230;&lt;/a&gt;
          </description>
          <pubDate>Sun, 04 Feb 2007 11:17:55 GMT</pubDate>
          <guid>http://rails-engines.org/news/2007/02/04/engines-1-2-released/</guid>
          <link>http://rails-engines.org/news/2007/02/04/engines-1-2-released/</link>
        </item>
    
    
  </channel>
</rss>

