<?xml version="1.0" encoding="UTF-8"?>
<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/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Backdrifter &#187; chrysalis</title>
	<atom:link href="http://www.backdrifter.com/tags/chrysalis/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.backdrifter.com</link>
	<description>The personal site of Jared Hanson</description>
	<lastBuildDate>Tue, 22 Jun 2010 22:16:08 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Using Multiple Versions of Rake</title>
		<link>http://www.backdrifter.com/2009/04/07/using-multiple-versions-of-rake/</link>
		<comments>http://www.backdrifter.com/2009/04/07/using-multiple-versions-of-rake/#comments</comments>
		<pubDate>Tue, 07 Apr 2009 18:58:04 +0000</pubDate>
		<dc:creator>Jared Hanson</dc:creator>
				<category><![CDATA[Unknown]]></category>
		<category><![CDATA[chrysalis]]></category>
		<category><![CDATA[rake]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[rubygems]]></category>

		<guid isPermaLink="false">http://www.backdrifter.com/?p=129</guid>
		<description><![CDATA[Rake has become a critical component of my development toolchain.  So much so that I have developed extensions, such as Chrysalis, to assist with common aspects of the build cycle.
However, due to time constraints, Chrysalis does not support the latest version of Rake (currently 0.8.3).  The 0.8 branch reworked some of the internals, [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://rake.rubyforge.org/">Rake</a> has become a critical component of my development toolchain.  So much so that I have developed extensions, such as <a href="http://chrysalis.rubyforge.org/">Chrysalis</a>, to assist with common aspects of the build cycle.</p>
<p>However, due to time constraints, Chrysalis does not support the latest version of Rake (currently 0.8.3).  The 0.8 branch reworked some of the internals, and Chrysalis was developed against 0.7.3.  As such, I often need to quickly switch between multiple versions of Rake.</p>
<p>Thankfully, the executable <a href="http://www.rubygems.org/">RubyGems</a> places in the bin directory makes this easy.  I had long been curious how this works, so I took the time to figure it out.</p>
<p><span id="more-129"></span></p>
<p>The executable scripts generated by RubyGems, in this case for Rake, look like the following:<br />
<code><br />
require 'rubygems'<br />
&nbsp;<br />
version = "&gt;= 0"<br />
&nbsp;<br />
if ARGV.first =~ /^_(.*)_$/ and Gem::Version.correct? $1 then<br />
&nbsp;&nbsp;version = $1<br />
&nbsp;&nbsp;ARGV.shift<br />
end<br />
&nbsp;<br />
gem 'rake', version<br />
load 'rake'<br />
</code></p>
<p>There is a bit of regular expression magic that works on the first argument to the command, accessed through <code>ARGV.first</code>.  The <code>=~</code> is the positive match operator for regular expressions.  If a match is found, a portion of it will be stored in the global variable <code>$1</code>.</p>
<p>The goal of the RubyGems-generated script is to match a user-supplied version number, without interfering with any other arguments the actual script may expect.  In order to do so, the version argument is surrounded by underscores.  This is enforced by using the <code>^</code> and <code>$</code> as achors for the beginning and end of the string, respectively.</p>
<p>The result of all this is a simple way to switch between versions easily on the command line.<br />
<code><br />
$ rake _0.7.3_ --version<br />
$ rake _0.8.3_ --version<br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.backdrifter.com/2009/04/07/using-multiple-versions-of-rake/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Chrysalis 0.1.0 Is Out</title>
		<link>http://www.backdrifter.com/2007/12/10/chrysalis-010-is-out/</link>
		<comments>http://www.backdrifter.com/2007/12/10/chrysalis-010-is-out/#comments</comments>
		<pubDate>Mon, 10 Dec 2007 17:16:27 +0000</pubDate>
		<dc:creator>Jared Hanson</dc:creator>
				<category><![CDATA[Unknown]]></category>
		<category><![CDATA[chrysalis]]></category>
		<category><![CDATA[rake]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://www.backdrifter.com/2007/12/10/chrysalis-010-is-out/</guid>
		<description><![CDATA[Last night I released the initial version of Chrysalis, a simple, yet powerful dependency manager built on Ruby and Rake.  This morning, the gem has circulated out to the mirrors, so the launch is off the ground.
I&#8217;ve long thought that building applications, along with their dependencies, could be easier and more efficient.  Chrysalis [...]]]></description>
			<content:encoded><![CDATA[<p>Last night I <a href="http://chrysalis.rubyforge.org/news/2007/12/09/chrysalis-010-released/">released</a> the initial version of <a href="http://chrysalis.rubyforge.org/">Chrysalis</a>, a simple, yet powerful dependency manager built on <a href="http://www.ruby-lang.org/">Ruby</a> and <a href="http://docs.rubyrake.org/">Rake</a>.  This morning, the gem has circulated out to the mirrors, so the launch is off the ground.</p>
<p>I&#8217;ve long thought that building applications, along with their dependencies, could be easier and more efficient.  Chrysalis is my attempt at making it so.  I&#8217;ve been putting it to use in my projects, and have been pleased with the results.</p>
<p>If you&#8217;ve had the same thoughts, check out Chrysalis.  There&#8217;s plenty of <a href="http://chrysalis.rubyforge.org/documentation/">documentation</a> on the site to get you started.  The core of initial release is stable, but there are additional features that would be useful.  Feel free to send me your feedback and suggestions.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.backdrifter.com/2007/12/10/chrysalis-010-is-out/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
