<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="wordpress/2.3.2" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	>

<channel>
	<title>jeremy burks</title>
	<link>http://jeremyburks.net</link>
	<description>be simple</description>
	<pubDate>Sat, 12 Apr 2008 03:05:05 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.3.2</generator>
	<language>en</language>
			<item>
		<title>spam is evil</title>
		<link>http://jeremyburks.net/2008/04/11/spam-is-evil/</link>
		<comments>http://jeremyburks.net/2008/04/11/spam-is-evil/#comments</comments>
		<pubDate>Sat, 12 Apr 2008 03:05:05 +0000</pubDate>
		<dc:creator>jeremy</dc:creator>
		
		<category><![CDATA[weblog]]></category>

		<guid isPermaLink="false">http://jeremyburks.net/2008/04/11/spam-is-evil/</guid>
		<description><![CDATA[Uploaded with plasq&#8217;s Skitch!]]></description>
			<content:encoded><![CDATA[<div style="margin:20px"><a href="http://skitch.com/jrun/jm8k/gmail-inbox-3-jeremy.burks-gmail.com"><img src="http://img.skitch.com/20080412-1dpe4s2q3ymxx8k4x72q8aasiy.preview.jpg" alt="Gmail - Inbox (3) - jeremy.burks@gmail.com" /></a><br /><span style="font-family: Lucida Grande, Trebuchet, sans-serif, Helvetica, Arial; font-size: 10px; color: #808080">Uploaded with <a href="http://plasq.com/">plasq</a>&#8217;s <a href="http://skitch.com">Skitch</a>!</span></div>]]></content:encoded>
			<wfw:commentRss>http://jeremyburks.net/2008/04/11/spam-is-evil/feed/</wfw:commentRss>
		</item>
		<item>
		<title>merb_annotate_models</title>
		<link>http://jeremyburks.net/2008/03/17/merb_annotate_models/</link>
		<comments>http://jeremyburks.net/2008/03/17/merb_annotate_models/#comments</comments>
		<pubDate>Tue, 18 Mar 2008 03:07:53 +0000</pubDate>
		<dc:creator>jeremy</dc:creator>
		
		<category><![CDATA[merb]]></category>

		<guid isPermaLink="false">http://jeremyburks.net/2008/03/17/merb_annotate_models/</guid>
		<description><![CDATA[I like the handiness of Dave Thomas&#8217; Rails plugin annotate_models. I&#8217;ve been doing some Merb development so I decided to do a quick port of the plugin.

It can be found over at GitHub.]]></description>
			<content:encoded><![CDATA[<p>I like the handiness of <a href="http://pragdave.pragprog.com/">Dave Thomas&#8217;</a> Rails plugin <a href="http://agilewebdevelopment.com/plugins/annotate_models">annotate_models</a>. I&#8217;ve been doing some <a href="http://merbivore.com/">Merb</a> development so I decided to do a quick port of the plugin.</p>

<p>It can be found over at <a href="http://github.com/jrun/merb_annotate_models/tree/master">GitHub</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://jeremyburks.net/2008/03/17/merb_annotate_models/feed/</wfw:commentRss>
		</item>
		<item>
		<title>stack: A Ruby Build Tool For .Net Development</title>
		<link>http://jeremyburks.net/2008/03/17/stack-a-ruby-build-tool-for-net-development/</link>
		<comments>http://jeremyburks.net/2008/03/17/stack-a-ruby-build-tool-for-net-development/#comments</comments>
		<pubDate>Mon, 17 Mar 2008 20:10:25 +0000</pubDate>
		<dc:creator>jeremy</dc:creator>
		
		<category><![CDATA[stack]]></category>

		<guid isPermaLink="false">http://jeremyburks.net/2008/03/17/stack-a-ruby-build-tool-for-net-development/</guid>
		<description><![CDATA[This is an introduction to an internal .Net build tool written in Ruby. Although it&#8217;s not Open Source I thought some would be interested in hearing about it.

The idea of writing a .Net build tool in Ruby comes up from time-to-time. Most recently, that I&#8217;ve seen,  Jeremy Miller briefly mentioned the idea. Now that [...]]]></description>
			<content:encoded><![CDATA[<p>This is an introduction to an internal .Net build tool written in Ruby. Although it&#8217;s not Open Source I thought some would be interested in hearing about it.</p>

<p>The idea of writing a .Net build tool in Ruby comes up from time-to-time. Most recently, that I&#8217;ve seen,  Jeremy Miller <a href="http://codebetter.com/blogs/jeremy.miller/archive/2008/01/01/new-year-new-challenges-and-an-mvp.aspx">briefly mentioned the idea</a>. Now that I finally got around to setting up a weblog I thought I would share my experiences in writing such a tool.</p>

<h2>Some History</h2>

<p>My employer started the transition to .Net about 1.5 - 2 years ago. There were a lot of discussion about whether or not to use Team System.  It was a discussion similar to the one <a href="http://weblogs.asp.net/rosherove/archive/2007/04/29/tfs-or-not-being-a-perfectionist-is-a-realistic-world.aspx">Roy Osherove</a> and <a href="http://ayende.com/Blog/archive/2007/04/29/TFS-Zero-Friction-and-living-in-an-imperfect-world.aspx">Ayende</a> had. In the end it was decided not to use Team System. </p>

<p>A downside to that decision is the number of pieces involved. Some of the different pieces that had to be managed include Subversion, NUnit, <span class="caps">MSB</span>uild, NCover, log4net, iBatis, internal frameworks and libraries. Everything needed to be managed as one cohesive unit. Beyond encapsulating the various development tools, there was the desire to enforce things like solution and <a href="http://jeremyburks.net/wp-content/uploads/2008/02/stack_directory_structure-2.jpg">directory layouts</a>, namespacing, project names, unit tests, continuous integration, etc&#8230;</p>

<p>Stack was developed to solve the above problems.</p>

<h2>Why Ruby?</h2>

<p>So, why Ruby? Ruby is an excellent language for gluing things together. Stack had to bring in many disparate tools together so it was a good fit. In addition, .Net was just being introduced so there were no legacy NAnt or MsBuild scripts to contend with. There was no interest in going down that road if it could be avoided. Lastly, my feeling is, the more exposure .Net developers have to Ruby the better (or more generally, exposure to different languages is a good thing). Being introduced to Ruby through using Stack is a delicate way to do that.</p>

<h2>Some Details</h2>


<ul>
<li>Stack is a <a href="http://www.rubygems.org/">gem</a> that is distributed via an internal gem server.</li>
</ul>




<ul>
<li>All dependencies are packaged with stack. That includes all required <span class="caps">SDK </span>tools. You should be able to build a Stack based solution anywhere where the .Net Framework and Stack is installed.</li>
</ul>




<ul>
<li>Stack is used to generate new solutions. There are several defined solution templates like <em>lib</em>, <em>forms</em> and <em>shell</em> to name a few. For every <span class="caps">VS.N</span>et project generated a corresponding <em>.Test</em> project is generated. The one exception is the View project, if there is one. 
<ul>
<li style="list-style-type:none"><a href='http://jeremyburks.net/wp-content/uploads/2008/02/select-windows-powershell.jpg' title='select-windows-powershell.jpg'><img src='http://jeremyburks.net/wp-content/uploads/2008/02/select-windows-powershell.thumbnail.jpg' alt='select-windows-powershell.jpg' /></a></li>
</ul>
</li>
</ul>




<ul>
<li>It&#8217;s easy to retro fit Stack around an existing solution. </li>
</ul>




<ul>
<li>Stack has the concept of version freezing. There tends to be a lot of smallish solutions that become feature complete pretty quickly and then sit untouched for one or more years. To ensure the tests and the rest of the build continue to work, each solution is frozen to a specific version of stack. The solution must be explicitly upgraded to a newer version of Stack. As a result, Stack&#8217;s toolset can be upgraded without worrying about breaking builds when a new version of Stack is released. To illustrate the point a little bit, the build server has about 5 different versions of stack installed, all being used by solutions in various stages of development.</li>
</ul>




<ul>
<li>Stack initializes it&#8217;s environment by parsing a solution file to discover all the projects. Test projects are selected by matching a pattern, the default is project names ending in <em>Test</em>. Parsing the solution and project files allows stack to provide a basic set of tasks out of the box.
<ul>
<li style="list-style-type:none"><a href='http://jeremyburks.net/wp-content/uploads/2008/02/stack-task-listing.jpg' title='stack-task-listing.jpg'><img src='http://jeremyburks.net/wp-content/uploads/2008/02/stack-task-listing.thumbnail.jpg' alt='stack-task-listing.jpg' /></a></li>
</ul>
</li>
</ul>




<ul>
<li>Stack has an <em>import</em> task that creates a new Subversion repository, sets appropriate commit permissions (everything is anonymous read by default), imports the solution and does an inplace checkout. During the import process Stack also creates a new <em>product</em>, via a web service, on a Project Management type web app (written in <a href="http://www.rubyonrails.org/">Rails</a>).</li>
</ul>




<ul>
<li>Build output is written to both <span class="caps">STDOUT </span>and a <span class="caps">HTML </span>report when build tasks (compile, test, coverage, etc..) are run locally.
<ul>
<li style="list-style-type:none"><a href='http://jeremyburks.net/wp-content/uploads/2008/02/bulid-output.jpg' title='bulid-output.jpg'><img src='http://jeremyburks.net/wp-content/uploads/2008/02/bulid-output.thumbnail.jpg' alt='bulid-output.jpg' /></a><a href='http://jeremyburks.net/wp-content/uploads/2008/02/build_report.jpg' title='build_report.jpg'><img src='http://jeremyburks.net/wp-content/uploads/2008/02/build_report.thumbnail.jpg' alt='build_report.jpg' /></a></li>
</ul>
</li>
</ul>




<ul>
<li>Stack has a <em>cruise</em> task for easy integration with <a href="http://cruisecontrolrb.thoughtworks.com/">CriuseControl.rb</a>. If stack detects that its being run as a CruiseControl.rb build it redirects output to the appropriate location. </li>
</ul>



<h2>In Summary</h2>

<p>That is stack in a nutshell. It&#8217;s used on a daily basis to manage 100+ Visual Studio solutions and counting. </p>]]></content:encoded>
			<wfw:commentRss>http://jeremyburks.net/2008/03/17/stack-a-ruby-build-tool-for-net-development/feed/</wfw:commentRss>
		</item>
		<item>
		<title>DRY up ActiveRecord specs a bit</title>
		<link>http://jeremyburks.net/2008/03/08/dry-up-activerecord-specs-a-bit/</link>
		<comments>http://jeremyburks.net/2008/03/08/dry-up-activerecord-specs-a-bit/#comments</comments>
		<pubDate>Sun, 09 Mar 2008 04:23:57 +0000</pubDate>
		<dc:creator>jeremy</dc:creator>
		
		<category><![CDATA[spec]]></category>

		<guid isPermaLink="false">http://jeremyburks.net/2008/03/08/dry-up-activerecord-specs-a-bit/</guid>
		<description><![CDATA[These days I use RSpec exclusively. Well, there are those few remaining crufty test/unit tests hanging around but I digress. When writing specs for ActiveRecord models there is a particular pattern I follow. I tend not to use fixtures unless their required. Typically I just new up a model with the required data. If the [...]]]></description>
			<content:encoded><![CDATA[<p>These days I use <a href="http://rspec.info/">RSpec</a> exclusively. Well, there are those few remaining crufty test/unit tests hanging around but I digress. When writing specs for ActiveRecord models there is a particular pattern I follow. I tend not to use fixtures unless their required. Typically I just <code>new</code> up a model with the required data. If the model needs to exist on the database I use <code>create</code> instead.</p>

<p>With RSpec, examples tend to get broken up into several <code>describe</code> blocks. As a result I almost always create a helper module that gets included into the <code>describe</code> blocks.</p>

<p>Assuming a <code>Post</code> model, <code>post_spec.rb</code> might start out looking like the following:</p>


<div class="wp_syntax"><div class="code"><pre class="ruby"><span style="color:#CC0066; font-weight:bold;">require</span> <span style="color:#CC00FF; font-weight:bold;">File</span>.<span style="color:#9900CC;">dirname</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF; font-weight:bold;">__FILE__</span><span style="color:#006600; font-weight:bold;">&#41;</span> + <span style="color:#996600;">'/../spec_helper.rb'</span>
&nbsp;
<span style="color:#9966CC; font-weight:bold;">module</span> PostSpecHelpers
  <span style="color:#9966CC; font-weight:bold;">def</span> default_attributes
    <span style="color:#006600; font-weight:bold;">&#123;</span> <span style="color:#ff3333; font-weight:bold;">:title</span> =&gt; <span style="color:#996600;">'Ninjas Kick Ass'</span>,
       <span style="color:#ff3333; font-weight:bold;">:body</span> =&gt; <span style="color:#996600;">'Ninjas are dangerous, watch out!'</span> <span style="color:#006600; font-weight:bold;">&#125;</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
<span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
describe Post <span style="color:#9966CC; font-weight:bold;">do</span>
  <span style="color:#9966CC; font-weight:bold;">include</span> PostSpecHelpers
<span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
describe Post, <span style="color:#996600;">'validating'</span> <span style="color:#9966CC; font-weight:bold;">do</span>
  <span style="color:#9966CC; font-weight:bold;">include</span> PostSpecHelpers
&nbsp;
  it <span style="color:#996600;">&quot;should require a title&quot;</span> <span style="color:#9966CC; font-weight:bold;">do</span>
    post = Post.<span style="color:#9900CC;">create</span> default_attributes.<span style="color:#9900CC;">merge</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#ff3333; font-weight:bold;">:title</span> =&gt; <span style="color:#0000FF; font-weight:bold;">nil</span><span style="color:#006600; font-weight:bold;">&#41;</span>
    post.<span style="color:#9900CC;">should</span> have<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006666;">1</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color:#9900CC;">error_on</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#ff3333; font-weight:bold;">:title</span><span style="color:#006600; font-weight:bold;">&#41;</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
<span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div>




<p>There is not a whole lot to <span class="caps">DRY </span>there. The common pattern shown is to <code>create</code> the object while overriding one or more attribute defaults. The tediousness of the code is pretty minor but it starts to grow old. Another thing that bothers me is RSpec knows a model is being spec&#8217;d. That seems like useful information that should be taken advantage of. </p>

<p>Normally I would just deal with the above. You usually want to tread carefully when abstracting things out of specs.</p>

<p>I did end up coming up with something. What put me over the edge was the need to <code>create</code> and <code>new</code> up models in shared specs.</p>

<p>For example, what if there is a <code>Post</code> and a <code>WikiPage</code> that both have a title and body? You could do inheritance but I tend not to like that. You never know how the two models will diverge. Instead I usually create a module with the shared code. I&#8217;ll then write specs that are shared by both taking advantage of <code>it_should_behave_like</code>.</p>

<p>The result of what I ended up with is very simple. Just a couple of helper methods to create (and new up) models while taking advantage of the fact that RSpec knows modles are being spec&#8217;d.</p>

<p>Here is the example above rewritten:</p>


<div class="wp_syntax"><div class="code"><pre class="ruby">it <span style="color:#996600;">&quot;should require a title&quot;</span> <span style="color:#9966CC; font-weight:bold;">do</span>
  create_with<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#ff3333; font-weight:bold;">:title</span> =&gt; <span style="color:#0000FF; font-weight:bold;">nil</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color:#9900CC;">should</span> have<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006666;">1</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color:#9900CC;">error_on</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#ff3333; font-weight:bold;">:title</span><span style="color:#006600; font-weight:bold;">&#41;</span>
<span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div>




<p>Here is what I have in <code>spec_helper.rb</code>:</p>


<div class="wp_syntax"><div class="code"><pre class="ruby"><span style="color:#9966CC; font-weight:bold;">module</span> ModelExtensions
  <span style="color:#9966CC; font-weight:bold;">def</span> new_model<span style="color:#006600; font-weight:bold;">&#40;</span>overrides = <span style="color:#006600; font-weight:bold;">&#123;</span><span style="color:#006600; font-weight:bold;">&#125;</span><span style="color:#006600; font-weight:bold;">&#41;</span>
    <span style="color:#0000FF; font-weight:bold;">self</span>.<span style="color:#9966CC; font-weight:bold;">class</span>.<span style="color:#9900CC;">described_type</span>.<span style="color:#9900CC;">new</span><span style="color:#006600; font-weight:bold;">&#40;</span>respond_to?<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#ff3333; font-weight:bold;">:default_attributes</span><span style="color:#006600; font-weight:bold;">&#41;</span> ? 
      default_attributes.<span style="color:#9900CC;">merge</span><span style="color:#006600; font-weight:bold;">&#40;</span>overrides<span style="color:#006600; font-weight:bold;">&#41;</span> : overrides<span style="color:#006600; font-weight:bold;">&#41;</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
  <span style="color:#9966CC; font-weight:bold;">alias</span> new_with new_model
&nbsp;
  <span style="color:#9966CC; font-weight:bold;">def</span> create_model<span style="color:#006600; font-weight:bold;">&#40;</span>overrides = <span style="color:#006600; font-weight:bold;">&#123;</span><span style="color:#006600; font-weight:bold;">&#125;</span><span style="color:#006600; font-weight:bold;">&#41;</span>
    <span style="color:#0000FF; font-weight:bold;">self</span>.<span style="color:#9966CC; font-weight:bold;">class</span>.<span style="color:#9900CC;">described_type</span>.<span style="color:#9900CC;">create</span><span style="color:#006600; font-weight:bold;">&#40;</span>respond_to?<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#ff3333; font-weight:bold;">:default_attributes</span><span style="color:#006600; font-weight:bold;">&#41;</span> ? 
      default_attributes.<span style="color:#9900CC;">merge</span><span style="color:#006600; font-weight:bold;">&#40;</span>overrides<span style="color:#006600; font-weight:bold;">&#41;</span> : overrides<span style="color:#006600; font-weight:bold;">&#41;</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
  <span style="color:#9966CC; font-weight:bold;">alias</span> create_with create_model
<span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
<span style="color:#6666ff; font-weight:bold;">Spec::Runner</span>.<span style="color:#9900CC;">configure</span> <span style="color:#9966CC; font-weight:bold;">do</span> |config|
  <span style="color:#008000; font-style:italic;"># only include for Model examples</span>
  config.<span style="color:#9966CC; font-weight:bold;">include</span><span style="color:#006600; font-weight:bold;">&#40;</span>ModelExtensions, <span style="color:#ff3333; font-weight:bold;">:type</span> =&gt; <span style="color:#ff3333; font-weight:bold;">:model</span><span style="color:#006600; font-weight:bold;">&#41;</span>
<span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div>




<p>In the past I&#8217;ve used several more extensions, especially when it comes to specing controllers (controllers and their specs drive me nuts with there repetitive patterns). I often go back and forth. It&#8217;s a battle between <span class="caps">DRY</span>ness and obscuring the specs. Based on experienced its almost always (just plain always?) best to err on the side of maximum readability at the expense of <span class="caps">DRY</span>ness.  Although I don&#8217;t think the above example is too bad, sometimes I just can&#8217;t help myself. </p>]]></content:encoded>
			<wfw:commentRss>http://jeremyburks.net/2008/03/08/dry-up-activerecord-specs-a-bit/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Firefox Extensions</title>
		<link>http://jeremyburks.net/2008/02/29/firefox-extensions/</link>
		<comments>http://jeremyburks.net/2008/02/29/firefox-extensions/#comments</comments>
		<pubDate>Fri, 29 Feb 2008 17:29:23 +0000</pubDate>
		<dc:creator>jeremy</dc:creator>
		
		<category><![CDATA[firefox]]></category>

		<guid isPermaLink="false">http://jeremyburks.net/2008/02/29/firefox-extensions/</guid>
		<description><![CDATA[I&#8217;m in the process of setting up a new computer and I&#8217;m trying to remember all the Firefox extensions that I use. This list is mostly for myself, so that I don&#8217;t have to think so much the next time around. 



FireBug
Web Developer
Delicious Bookmarks
Tab Mix Plus
YSlow
PermaTabs
Resizeable Textarea




I only use these at work where it&#8217;s Windows. [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m in the process of setting up a new computer and I&#8217;m trying to remember all the Firefox extensions that I use. This list is mostly for myself, so that I don&#8217;t have to think so much the next time around. </p>


<ul>
<li><a href="https://addons.mozilla.org/en-US/firefox/addon/1843">FireBug</a></li>
<li><a href="https://addons.mozilla.org/en-US/firefox/addon/60">Web Developer</a></li>
<li><a href="https://addons.mozilla.org/en-US/firefox/addon/3615">Delicious Bookmarks</a></li>
<li><a href="https://addons.mozilla.org/en-US/firefox/addon/1122">Tab Mix Plus</a></li>
<li><a href="https://addons.mozilla.org/en-US/firefox/addon/5369">YSlow</a></li>
<li><a href="https://addons.mozilla.org/en-US/firefox/addon/2558">PermaTabs</a></li>
<li><a href="https://addons.mozilla.org/en-US/firefox/addon/3818">Resizeable Textarea</a></li>
</ul>



<p>I only use these at work where it&#8217;s Windows. Brief, I use for intranet feeds otherwise I use Google Reader.</p>


<ul>
<li><a href="https://addons.mozilla.org/en-US/firefox/addon/1419">IE Tab</a></li>
<li><a href="https://addons.mozilla.org/en-US/firefox/addon/271">ColorZilla</a></li>
<li><a href="https://addons.mozilla.org/en-US/firefox/addon/4578">Brief</a></li>
</ul>

]]></content:encoded>
			<wfw:commentRss>http://jeremyburks.net/2008/02/29/firefox-extensions/feed/</wfw:commentRss>
		</item>
		<item>
		<title>deploying a gem using capistrano</title>
		<link>http://jeremyburks.net/2008/02/14/deploying-a-gem-using-capistrano/</link>
		<comments>http://jeremyburks.net/2008/02/14/deploying-a-gem-using-capistrano/#comments</comments>
		<pubDate>Thu, 14 Feb 2008 00:02:43 +0000</pubDate>
		<dc:creator>jeremy</dc:creator>
		
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://jeremyburks.net/2008/02/14/deploying-a-gem-using-capistrano/</guid>
		<description><![CDATA[This is something I wrote to push gems to an internal gem server. It is a simple Capistrano recipe. Here is the Capfile. You can easily move the GemDeployer module into a separate file if you want to reuse it.


module GemDeployer
  def deploy&#40;gem_path_glob&#41;
    gem = Dir&#91;gem_path_glob&#93;.first
&#160;
    unless gem
 [...]]]></description>
			<content:encoded><![CDATA[<p>This is something I wrote to push gems to an internal gem server. It is a simple <a href="http://capify.org/">Capistrano</a> recipe. Here is the Capfile. You can easily move the GemDeployer module into a separate file if you want to reuse it.</p>


<div class="wp_syntax"><div class="code"><pre class="ruby"><span style="color:#9966CC; font-weight:bold;">module</span> GemDeployer
  <span style="color:#9966CC; font-weight:bold;">def</span> deploy<span style="color:#006600; font-weight:bold;">&#40;</span>gem_path_glob<span style="color:#006600; font-weight:bold;">&#41;</span>
    gem = <span style="color:#CC00FF; font-weight:bold;">Dir</span><span style="color:#006600; font-weight:bold;">&#91;</span>gem_path_glob<span style="color:#006600; font-weight:bold;">&#93;</span>.<span style="color:#9900CC;">first</span>
&nbsp;
    <span style="color:#9966CC; font-weight:bold;">unless</span> gem
      <span style="color:#CC0066; font-weight:bold;">raise</span> <span style="color:#996600;">&quot;failed to find gem using #{gem_path_glob}&quot;</span>
    <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
    <span style="color:#008000; font-style:italic;"># the gem must be read in binary mode, its a</span>
    <span style="color:#008000; font-style:italic;"># windows thing</span>
    <span style="color:#CC00FF; font-weight:bold;">File</span>.<span style="color:#CC0066; font-weight:bold;">open</span><span style="color:#006600; font-weight:bold;">&#40;</span>gem, <span style="color:#996600;">'rb'</span><span style="color:#006600; font-weight:bold;">&#41;</span>  <span style="color:#9966CC; font-weight:bold;">do</span> |f|
      put f.<span style="color:#9900CC;">read</span>, 
          <span style="color:#996600;">&quot;/var/www/html/gems/gems/#{File.basename(gem)}&quot;</span>
    <span style="color:#9966CC; font-weight:bold;">end</span>   
&nbsp;
    run <span style="color:#996600;">'gem generate_index -d /var/www/html/gems'</span>
    <span style="color:#008000; font-style:italic;"># use this for rubygems &lt; 0.9.4</span>
    <span style="color:#008000; font-style:italic;"># run 'index_gem_repository.rb -d /var/www/html/gems'</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
<span style="color:#9966CC; font-weight:bold;">end</span>
Capistrano.<span style="color:#9900CC;">plugin</span> <span style="color:#ff3333; font-weight:bold;">:gem_deployer</span>, GemDeployer
&nbsp;
role <span style="color:#ff3333; font-weight:bold;">:app</span>, <span style="color:#996600;">'[SET HOSTNAME HERE]'</span>
&nbsp;
namespace <span style="color:#ff3333; font-weight:bold;">:deploy</span> <span style="color:#9966CC; font-weight:bold;">do</span>
  task <span style="color:#ff3333; font-weight:bold;">:default</span> <span style="color:#9966CC; font-weight:bold;">do</span>
    gem_deployer.<span style="color:#9900CC;">deploy</span> <span style="color:#CC00FF; font-weight:bold;">File</span>.<span style="color:#9900CC;">dirname</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF; font-weight:bold;">__FILE__</span><span style="color:#006600; font-weight:bold;">&#41;</span> +
                        <span style="color:#996600;">&quot;/pkg/name-of-your-gem-*.*.*.gem&quot;</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
<span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div>
]]></content:encoded>
			<wfw:commentRss>http://jeremyburks.net/2008/02/14/deploying-a-gem-using-capistrano/feed/</wfw:commentRss>
		</item>
		<item>
		<title>hello world and all of that</title>
		<link>http://jeremyburks.net/2008/02/03/hello-world/</link>
		<comments>http://jeremyburks.net/2008/02/03/hello-world/#comments</comments>
		<pubDate>Sun, 03 Feb 2008 04:18:11 +0000</pubDate>
		<dc:creator>jeremy</dc:creator>
		
		<category><![CDATA[weblog]]></category>

		<guid isPermaLink="false">http://jeremyburks.net/?p=1</guid>
		<description><![CDATA[The start of this weblog completes the first item on my nebulous list of 2008 New Years resolutions. I&#8217;ve been a lurker of the interwebs for many years. I&#8217;m a programmer going on 7 years. I read a lot of weblogs (148 feeds and counting, yeah, probably too many) and I always follow what the [...]]]></description>
			<content:encoded><![CDATA[<p>The start of this weblog completes the first item on my nebulous list of 2008 New Years resolutions. I&#8217;ve been a lurker of the interwebs for many years. I&#8217;m a programmer going on 7 years. I read a lot of weblogs (148 feeds and counting, yeah, probably too many) and I always follow what the cool kids are doing. This year I have decided to take on a more participatory role. It&#8217;s time to start using all that hosting space that I have.</p>

<p>You may be wondering whether or not you should care about this weblog. I&#8217;ll be discussing <a href="http://www.ruby-lang.org/en/">Ruby</a>, open source, some .Net stuff since that&#8217;s a lot of what my day job is, web development, internet technologies like <a href="http://www.xmpp.org/"><span class="caps">XMPP</span></a> and other things related to software development such as source control and agile. Lastly, I&#8217;ll occasionally throw in some things that interest me outside of technology like running and movies. If you&#8217;re interested you can read more <a href="/index.php/about">about me</a>.</p>

<p>I&#8217;m not much of a writer or grammarian (despite the efforts of my AP English teacher) so please forgive me in advance. The grammarati can correct me in comments if they like, maybe I&#8217;ll learn a thing or two. </p>]]></content:encoded>
			<wfw:commentRss>http://jeremyburks.net/2008/02/03/hello-world/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
