<?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/"
	>

<channel>
	<title>Adam Bair</title>
	<atom:link href="http://www.adambair.com/blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.adambair.com/blog</link>
	<description></description>
	<pubDate>Fri, 20 Mar 2009 20:24:00 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.7</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Git Hooks, Presently, Mice, Sharks, and Zombies</title>
		<link>http://www.adambair.com/blog/2009/03/20/git-hooks-presently-mice-sharks-and-zombies/</link>
		<comments>http://www.adambair.com/blog/2009/03/20/git-hooks-presently-mice-sharks-and-zombies/#comments</comments>
		<pubDate>Fri, 20 Mar 2009 20:24:00 +0000</pubDate>
		<dc:creator>Adam</dc:creator>
		
		<category><![CDATA[git]]></category>

		<guid isPermaLink="false">http://www.adambair.com/blog/?p=106</guid>
		<description><![CDATA[Way back in the day we used to use Campfire and Subversion. Time happened, it&#8217;s the future, and now we use Present.ly and Git. Remember how those commit messages would just show up in Campfire whenever anyone did an svn commit -m &#8216;whatever&#8217;? Wouldn&#8217;t it be nice to be able to publish Git commit messages [...]]]></description>
			<content:encoded><![CDATA[<p>Way back in the day we used to use Campfire and Subversion. Time happened, it&#8217;s the future, and now we use <a href='http://www.presentlyapp.com/'>Present.ly</a> and <a href='http://www.git-scm'>Git</a>. Remember how those commit messages would just show up in Campfire whenever anyone did an svn commit -m &#8216;whatever&#8217;? Wouldn&#8217;t it be nice to be able to publish Git commit messages to Present.ly just like the old days with Campfire and Subversion? </p>
<p>We can do it. We&#8217;ve been doing it. We&#8217;re doing it right now.</p>
<p><img alt="can i help you? can i help YOU? what do you do? i do it all. have a seat. i will because thats something I can do. do something. i am, i did, its already done." src="http://img.skitch.com/20090319-rc8msrsrpb7r527i38s3jhiu57.jpg" title="can i help you? can i help YOU? what do you do? i do it all. have a seat. i will because that&#39;s something I can do. do something. i am, i did, it&#39;s already done." width="480" height="359" /></p>
<p>The first thing you&#8217;ll need to know is that Git has hooks. Lots of them. They live in the hidden &#8216;.git/hooks&#8217; folder in your project. Their names are relatively descriptive and tell you when these hooks will fire. The one we&#8217;re particularly interested in right now is &#8216;.git/hooks/post-commit&#8217;.</p>
<p>Open up that file, there&#8217;s stuff in there, delete it and add the following hotness instead:</p>
<p><script src="http://gist.github.com/81994.js"></script></p>
<p>Once you&#8217;ve updated your account, username, password, and the group to which you want to send your messages - you need to make this bad man active so it will fire at your will. The zombies will never see it coming:</p>
<p>chmod +x .git/hooks/post-commit</p>
<p>Keep in mind that none of these hooks will fire unless they are marked as executable. This will bite you; it did me, and I&#8217;m still recovering. It&#8217;s okay son, that&#8217;s how we earn our stripes.</p>
<p>Make some changes, queue &#8216;em up, hit commit, and BLAM: you&#8217;re knee deep in dead zombies and commit messages! But how do you kill something that&#8217;s already dead&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.adambair.com/blog/2009/03/20/git-hooks-presently-mice-sharks-and-zombies/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Disabling Test::Unit Rake Output</title>
		<link>http://www.adambair.com/blog/2009/01/21/disabling-testunit-rake-output/</link>
		<comments>http://www.adambair.com/blog/2009/01/21/disabling-testunit-rake-output/#comments</comments>
		<pubDate>Thu, 22 Jan 2009 01:45:15 +0000</pubDate>
		<dc:creator>Adam</dc:creator>
		
		<category><![CDATA[Testing]]></category>

		<category><![CDATA[rails]]></category>

		<category><![CDATA[rake]]></category>

		<category><![CDATA[rspec]]></category>

		<category><![CDATA[ruby]]></category>

		<category><![CDATA[testunit]]></category>

		<guid isPermaLink="false">http://www.adambair.com/blog/?p=74</guid>
		<description><![CDATA[If you&#8217;re like me you prefer RSpec to the Test::Unit (the default testing framework that comes with Rails by default). You immediately kill off the &#8220;test&#8221; folder in your app and bootstrap RSpec with &#8220;./script/generate rspec&#8221;. When you run the default rake command (&#8217;rake&#8217;) in the root of your app you are greeted with the [...]]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;re like me you prefer RSpec to the Test::Unit (the default testing framework that comes with Rails by default). You immediately kill off the &#8220;test&#8221; folder in your app and bootstrap RSpec with &#8220;./script/generate rspec&#8221;. When you run the default rake command (&#8217;rake&#8217;) in the root of your app you are greeted with the following:</p>
<script src="http://gist.github.com/50191.js"></script><noscript><code class="gist"><pre><br />
/opt/local/bin/ruby -Ilib:test &#8220;/opt/local/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake/rake_test_loader.rb&#8221;<br />
/opt/local/bin/ruby -Ilib:test &#8220;/opt/local/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake/rake_test_loader.rb&#8221;<br />
/opt/local/bin/ruby -Ilib:test &#8220;/opt/local/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake/rake_test_loader.rb&#8221;<br />
</pre></code></noscript>
<div id="attachment_99" class="wp-caption alignnone" style="width: 508px"><img src="http://www.adambair.com/blog/wp-content/uploads/2009/01/gtfo.jpg" alt="OMG - WHAT IS THIS CRAP IN MY CONSOLE? " title="gtfo" width="498" height="253" class="size-full wp-image-99" /><p class="wp-caption-text">OMG - WHAT IS THIS CRAP IN MY CONSOLE? </p></div>
<p>I know these don&#8217;t come with RSpec because &#8216;rake spec&#8217; is silent (because we don&#8217;t have any specs yet &#8212; which is fine, we&#8217;ll build them later, don&#8217;t worry). This little thing has annoyed me for a while now but I&#8217;ve just had more important things to do instead of digging in and figuring out where this output is being generated, you know, like client work, the stuff that pays the bills.</p>
<p>Today, I took the time to figure it out and it was crazy simple. I&#8217;m kicking myself for not checking it out sooner (I feel like such a dirty noob *shakes head*). It turns out that each one of these blank lines represents one level in Test::Unit - unit, functional, and integration. Since I delete the &#8220;test&#8221; folder on sight (in new projects using RSpec) there aren&#8217;t any tests to run and this is actually part of the default output each Test::Unit  run.</p>
<p>Now that we have an understanding of what&#8217;s going on here &#8212; we have to dig in a little more and figure out where this rake task is being defined. Since Test::Unit is being fired off when we call a &#8216;rake&#8217; by itself it means that there is a default rake task (&#8217;task :default =&gt; :sometask&#8217;) specified somewhere that is causing this behavior. Another thing I tend to do in my applications is freezing Rails so I don&#8217;t have to depend on the version of Rails lives on each machine on which this app is hanging out. This allows me to search through the Rake tasks that come with Rails by default. A good portion of these tasks live in &#8216;railties&#8217; (general framework utilities) so we can start our search there (in &#8216;vendor/rails/railties/lib/tasks&#8217; - because &#8216;lib/tasks&#8217; is where Rake tasks tend to live). In order to search for &#8216;:default&#8217; within Railties we&#8217;ll bust out our trusty friend &#8216;grep&#8217;:</p>
<p><script src="http://gist.github.com/50234.js"></script></p>
<p>That grep command says: search inside all files &#8216;-R&#8217; found in &#8216;vendor/rails/railties/lib/tasks&#8217; for any line containing &#8216;:default&#8217; and show the line number &#8216;-n&#8217;.</p>
<p>BINGO! There it is! All you need to do is edit &#8216;vendor/rails/railties/lib/tasks/misc.rake&#8217; and comment out line number one. Then if you run the default rake command &#8216;rake&#8217; (by itself) you should no longer have to endure the filthy remnants of the Test::Unit.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.adambair.com/blog/2009/01/21/disabling-testunit-rake-output/feed/</wfw:commentRss>
		</item>
		<item>
		<title>RSpec Syntax Highlighting In Vim</title>
		<link>http://www.adambair.com/blog/2008/12/29/rspec-syntax-highlighting-in-vim/</link>
		<comments>http://www.adambair.com/blog/2008/12/29/rspec-syntax-highlighting-in-vim/#comments</comments>
		<pubDate>Mon, 29 Dec 2008 20:29:51 +0000</pubDate>
		<dc:creator>Adam</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<category><![CDATA[rspec]]></category>

		<category><![CDATA[ruby]]></category>

		<category><![CDATA[vim]]></category>

		<guid isPermaLink="false">http://www.adambair.com/blog/?p=13</guid>
		<description><![CDATA[Recently I began the migration back to Vim for my day-to-day text crunching needs.  Textmate is good but it&#8217;s starting to feel like abandonware; who knows when Textmate 2 is going to be released or if it even exists. It&#8217;s future feels uncertain. I need certainty. Anyway. Not what I want to talk about.
I want [...]]]></description>
			<content:encoded><![CDATA[<p>Recently I began the migration back to Vim for my day-to-day text crunching needs.  Textmate is good but it&#8217;s starting to feel like abandonware; who knows when Textmate 2 is going to be released or if it even exists. It&#8217;s future feels uncertain. I need certainty. Anyway. Not what I want to talk about.</p>
<p>I want to talk about RSpec syntax highlighing in Vim or my apparent lack thereof.  Check it out:</p>
<div id="attachment_15" class="wp-caption alignnone" style="width: 524px"><a href="http://www.adambair.com/blog/wp-content/uploads/2008/12/rspec_syntax.jpg"><img class="size-full wp-image-15" title="rspec_syntax" src="http://www.adambair.com/blog/wp-content/uploads/2008/12/rspec_syntax.jpg" alt="Missing RSpec keyword syntax highlighting" width="514" height="151" /></a><p class="wp-caption-text">Missing RSpec keyword syntax highlighting</p></div>
<p>I&#8217;m using MacVim with the vim-ruby gem installed. There has to be an easy way to get RSpec syntax highlighting for all the RSpec keywords although I couldn&#8217;t fine one after spending time scouring the Google. Time to break out the &#8216;Hard Way&#8217;.</p>
<p>That SEXY theme you see is a modified port of the TextMate theme called <a title="Monokai Textmate Theme" href="http://www.monokai.nl/blog/2006/07/15/textmate-color-theme/" target="_blank">Monokai</a>.  It&#8217;s was originally <a title="Monokai Vim Theme" href="http://www.vim.org/scripts/script.php?script_id=2340" target="_blank">ported to Vim by Thomas Restrepo</a>. Monokai forms a solid basis for some supurb eye candy but my taste requires a bit more flare.</p>
<p>BEHOLD: <a title="Monokai Modified for Vim" href="http://www.adambair.com/monokai_modified/monokai_modified.vim" target="_blank">Monokai Modified for Vim</a> and <a title="Monokai Modified for TextMate" href="http://www.adambair.com/monokai_modified/monokai_modified.tmTheme" target="_blank">Monokai Modified for TextMate</a>. It&#8217;s rumored that more than a few retinas have been burned by the Monokai - shhh, don&#8217;t listen to them, trust me, it&#8217;s great!</p>
<p>Anyway, we&#8217;re drifting again, let&#8217;s continue.</p>
<p>It was a pain to figure out how to tag things with the proper colors when working on a new vim color file. After quite a bit of initial pain I found <a href="http://www.vim.org/scripts/script.php?script_id=383">SyntaxAttr.vim</a> and it made my Vim themeing life quite a bit more enjoyable. SyntaxAttr will tell you the exact syntax highlighting attribute Vim is using to attach a color to an element. In the case of RSpec &#8216;description&#8217; and &#8216;it&#8217; keywords Vim was telling me: &#8220;&lt;no syntax group here&gt;&#8221;. Bummer.</p>
<p>Now we have to go in and force Vim to recognize these keywords as syntax so we can hang colors off of them. You can do this using &#8216;after&#8217; syntax files. This will allow you to add to an existing syntax file without modifying the original. You can see a more detailed explanation of this in the <a title="Vim Documentation for Syntax Files" href="http://www.vim.org/htmldoc/syntax.html#:syn-files" target="_blank">Vim documentation for syntax files</a>.</p>
<p>I chose to override the ruby.vim syntax file. I did this by creating a blank ruby.vim syntax file in ~/.vim/after/syntax/. You may need to make the after and syntax directories if they don&#8217;t already exist. This is what I put into my ruby.vim override file:</p>
<script src="http://gist.github.com/41179.js"></script>
<p>UPDATE: This code from Tim Pope (via Josh Nichols in the comment) is better as it will only apply this formatting for &#8216;_spec.rb&#8217; files. Thanks Josh!</p>
<script src="http://gist.github.com/64635.js"></script>
<p>This is just standard syntax file stuff: the first two lines are searching for matches and the next two lines are assigning them to an existing syntax structure.</p>
<p><em>(If you don&#8217;t want to piggy-back on an existing syntax definition [as I've done here] you can take a look at your theme in ~/.vim/colors for the proper way to add a new definition.  Instead of specifying &#8220;Define&#8221; you would specify your new definition.)</em></p>
<p>The override ruby.vim finds lines starting with &#8220;describe&#8221; and &#8220;it&#8221; and assigns them to the &#8220;Define&#8221; syntax definition. In Monokai Modified this is HOT PINK (as it should be):</p>
<div id="attachment_52" class="wp-caption alignnone" style="width: 522px"><a href="http://www.adambair.com/blog/wp-content/uploads/2008/12/correct_rspec_syntax.jpg"><img class="size-full wp-image-52" title="correct_rspec_syntax" src="http://www.adambair.com/blog/wp-content/uploads/2008/12/correct_rspec_syntax.jpg" alt="Correct RSpec Syntax Highlighting in Vim" width="512" height="151" /></a><p class="wp-caption-text">Correct RSpec Syntax Highlighting in Vim</p></div>
<p>Sweet. We&#8217;re in business.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.adambair.com/blog/2008/12/29/rspec-syntax-highlighting-in-vim/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Sometimes Tumblr isn&#8217;t enough</title>
		<link>http://www.adambair.com/blog/2008/11/24/sometimes-tumblr-isnt-enough/</link>
		<comments>http://www.adambair.com/blog/2008/11/24/sometimes-tumblr-isnt-enough/#comments</comments>
		<pubDate>Tue, 25 Nov 2008 04:13:06 +0000</pubDate>
		<dc:creator>Adam</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.adambair.com/blog/?p=9</guid>
		<description><![CDATA[Tumblr is great for quick bits of info: quotes, pictures, images sent from my iPhone, etc.  But I&#8217;ve started to feel compelled to post information that wants to go long-form.  This is where that will happen.
]]></description>
			<content:encoded><![CDATA[<p>Tumblr is great for quick bits of info: quotes, pictures, images sent from my iPhone, etc.  But I&#8217;ve started to feel compelled to post information that wants to go long-form.  This is where that will happen.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.adambair.com/blog/2008/11/24/sometimes-tumblr-isnt-enough/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
