Martinicity: Tag subversion Mike Blake tag:www.martinicity.net,2005:Typo Typo 2007-01-31T16:42:21+00:00 Mike Blake urn:uuid:dee6f8d3-128c-49df-abbe-ffc8ff243570 2007-01-31T16:25:00+00:00 2007-01-31T16:42:21+00:00 Keeping your Rails Codebase Clean with SVN Externals <p>As you develop a nice well organized Rails application, you&#8217;re sure to utilize some of the great open source code already written by Rails developers.</p> <p>A common practice is to install a plugin or some other code into your application, then add that code to subversion. Some problems with this are that a checkout of your app now takes longer, and if the plugin improves, you are using old code in your application. A neater solution is to access third party code using <i><span class="caps">SVN</span> Externals.</i></p> <p>Using <a href="http://tortoisesvn.tigris.org">Tortoise <span class="caps">SVN</span></a>, right click inside the vendor directory of your app, then choose &#8216;properties&#8217; from the menu.</p> <p>!<a href="/images/svn_properties.gif">svn properties</a></p> <p>Click the &#8216;Subversion&#8217; Tab with the little turtle. Then choose <b>svn:externals</b> from the dropdown in the middle of the screen.</p> <p>!<a href="/images/externals.gif">svn:externals</a></p> Now in the text area, enter the plugin you want to include. <code>acts_as_authenticated&amp;nbsp;http://svn.techno-weenie.net/projects/plugins/acts\_as\_authenticated </code> <p>The format here is important, the first word the entry, before the first space will be the <b>directory name</b> where the code will live. After the first space is the <b>url for the repository</b>. Click &#8216;OK to save the external. Then go up one directory and do a checkout of the &#8216;vendor&#8217; directory.</p> <p>Now:</p> <p>1. If the plugin code changes, you&#8217;ll receive the new code whenever you do an Update. 1. Additional coders who check out the repository have the option to &#8216;Omit externals&#8217; if they don&#8217;t need the portion of the code you&#8217;ve included. 1. There&#8217;s a clear distinction in your repository between the code you&#8217;re maintaining, and third party code.</p>