<?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>The Lucid &#187; Rake</title>
	<atom:link href="http://thelucid.com/category/rake/feed/" rel="self" type="application/rss+xml" />
	<link>http://thelucid.com</link>
	<description>Lightweight ramblings</description>
	<lastBuildDate>Tue, 27 Jul 2010 17:41:46 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Using Rcov to measure the test coverage of Rails plugins</title>
		<link>http://thelucid.com/2007/08/24/using-rcov-to-measure-the-test-coverage-of-rails-plugins/</link>
		<comments>http://thelucid.com/2007/08/24/using-rcov-to-measure-the-test-coverage-of-rails-plugins/#comments</comments>
		<pubDate>Fri, 24 Aug 2007 23:43:00 +0000</pubDate>
		<dc:creator>Jamie</dc:creator>
				<category><![CDATA[Rails]]></category>
		<category><![CDATA[Rake]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[coverage]]></category>
		<category><![CDATA[plugins]]></category>
		<category><![CDATA[rcov]]></category>
		<category><![CDATA[tests]]></category>

		<guid isPermaLink="false">http://c533fc04-524b-4de6-bd09-fe3ed45a3a0f</guid>
		<description><![CDATA[To view the coverage of your plugins using Rcov, first install the rcov gem with sudo gem install rcov, then copy and paste the following onto the end of the Rakefile inside your plugin directory: require 'rcov/rcovtask' &#160; desc 'Measures test coverage using rcov' namespace :rcov do desc 'Output unit test coverage of plugin.' Rcov::RcovTask.new&#40;:unit&#41; [...]]]></description>
			<content:encoded><![CDATA[<p>To view the coverage of your plugins using Rcov, first install the <code>rcov</code> gem with <code>sudo gem install rcov</code>, then copy and paste the following onto the end of the <code>Rakefile</code> inside your plugin directory:</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#CC0066; font-weight:bold;">require</span> <span style="color:#996600;">'rcov/rcovtask'</span>
&nbsp;
desc <span style="color:#996600;">'Measures test coverage using rcov'</span>
namespace <span style="color:#ff3333; font-weight:bold;">:rcov</span> <span style="color:#9966CC; font-weight:bold;">do</span>
  desc <span style="color:#996600;">'Output unit test coverage of plugin.'</span>
  <span style="color:#6666ff; font-weight:bold;">Rcov::RcovTask</span>.<span style="color:#9900CC;">new</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#ff3333; font-weight:bold;">:unit</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#9966CC; font-weight:bold;">do</span> <span style="color:#006600; font-weight:bold;">|</span>rcov<span style="color:#006600; font-weight:bold;">|</span>
    rcov.<span style="color:#9900CC;">pattern</span>    = <span style="color:#996600;">'test/unit/**/*_test.rb'</span>
    rcov.<span style="color:#9900CC;">output_dir</span> = <span style="color:#996600;">'rcov'</span>
    rcov.<span style="color:#9900CC;">verbose</span>    = <span style="color:#0000FF; font-weight:bold;">true</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
  desc <span style="color:#996600;">'Output functional test coverage of plugin.'</span>
  <span style="color:#6666ff; font-weight:bold;">Rcov::RcovTask</span>.<span style="color:#9900CC;">new</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#ff3333; font-weight:bold;">:functional</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#9966CC; font-weight:bold;">do</span> <span style="color:#006600; font-weight:bold;">|</span>rcov<span style="color:#006600; font-weight:bold;">|</span>
    rcov.<span style="color:#9900CC;">pattern</span>    = <span style="color:#996600;">'test/functional/**/*_test.rb'</span>
    rcov.<span style="color:#9900CC;">output_dir</span> = <span style="color:#996600;">'rcov'</span>
    rcov.<span style="color:#9900CC;">verbose</span>    = <span style="color:#0000FF; font-weight:bold;">true</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
<span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div>

<p>You can now simply run <code>rake rcov</code> from inside your plugin directory which will generate an <code>rcov</code> directory with the results. Open <code>rcov/index.html</code> (if you are on OSX this will open automatically) in a browser to view the results.</p>
<p>Thanks to &#8220;Mike Clark&#8221;:http://clarkware.com/cgi/blosxom for his &#8220;Rcov rake task for Rails&#8221;:http://clarkware.com/cgi/blosxom/2007/01/05#RcovRakeTask which this task is based on.</p>
<p>*Update (11-11-08):* Changed code to use the RcovTask class.</p>
]]></content:encoded>
			<wfw:commentRss>http://thelucid.com/2007/08/24/using-rcov-to-measure-the-test-coverage-of-rails-plugins/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Autotest Growl Fail/Pass Smilies</title>
		<link>http://thelucid.com/2007/07/30/autotest-growl-fail-pass-smilies/</link>
		<comments>http://thelucid.com/2007/07/30/autotest-growl-fail-pass-smilies/#comments</comments>
		<pubDate>Mon, 30 Jul 2007 19:03:00 +0000</pubDate>
		<dc:creator>Jamie</dc:creator>
				<category><![CDATA[Mac / OS X]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[Rake]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[autotest]]></category>
		<category><![CDATA[rspec]]></category>
		<category><![CDATA[smily]]></category>
		<category><![CDATA[testing]]></category>

		<guid isPermaLink="false">http://b421d2ad-f2ac-4995-ab32-f869688736fb</guid>
		<description><![CDATA[John Nunemaker posted a handy tip on &#8220;setting up autotest to work with Growl&#8221;:http://railstips.org/2007/7/23/autotest-growl-pass-fail-notifications I use this all the time now however I didn&#8217;t like the ugly smilies (call me shallow if you like). I used &#8220;Wolfgang Bartelme&#8217;s&#8221;:http://bartelme.at &#8220;Smily Devkit&#8221;:http://bartelme.at/journal/archive/smiley_devkit to make a couple of PNG&#8217;s slightly more pleasing to the eye. p=. !http://thelucid.com/files/fail.png(Autotest Fail [...]]]></description>
			<content:encoded><![CDATA[<p>John Nunemaker posted a handy tip on &#8220;setting up autotest to work with Growl&#8221;:http://railstips.org/2007/7/23/autotest-growl-pass-fail-notifications</p>
<p>I use this all the time now however I didn&#8217;t like the ugly smilies (call me shallow if you like). I used &#8220;Wolfgang Bartelme&#8217;s&#8221;:http://bartelme.at &#8220;Smily Devkit&#8221;:http://bartelme.at/journal/archive/smiley_devkit to make a couple of PNG&#8217;s slightly more pleasing to the eye.</p>
<p>p=. !http://thelucid.com/files/fail.png(Autotest Fail image)!<br />
!http://thelucid.com/files/pending.png(Autotest Pending image)!<br />
!http://thelucid.com/files/pass.png(Autotest Pass image)!</p>
<p>The zip file can be downloaded here: &#8220;autotest_images.zip&#8221;:http://thelucid.com/files/autotest_images.zip</p>
<p>*Update* 17-08-07: Added &#8216;pending&#8217; image for RSpec as requested by Aslak Hellesoy</p>
]]></content:encoded>
			<wfw:commentRss>http://thelucid.com/2007/07/30/autotest-growl-fail-pass-smilies/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Rails Edge: Getting your view extensions ready for edge</title>
		<link>http://thelucid.com/2007/05/16/rails-edge-getting-your-view-extensions-ready-for-edge/</link>
		<comments>http://thelucid.com/2007/05/16/rails-edge-getting-your-view-extensions-ready-for-edge/#comments</comments>
		<pubDate>Wed, 16 May 2007 18:07:00 +0000</pubDate>
		<dc:creator>Jamie</dc:creator>
				<category><![CDATA[Ajax]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[Rake]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[edge]]></category>
		<category><![CDATA[erb]]></category>
		<category><![CDATA[rjs]]></category>
		<category><![CDATA[views]]></category>

		<guid isPermaLink="false">http://0aa2ec8d-5d7f-4bce-9b6b-2b08a86c202e</guid>
		<description><![CDATA[Following my previous post, below is a modified version of &#8220;John Nunemaker&#8217;s &#8216;Renaming RHTML to ERB&#8217;&#8221;:http://railstips.org/2007/3/4/renaming-rhtml-to-erb to take into account the format in the extension, and handle &#8220;the RJS issues I was having&#8221;:http://www.thelucid.com/articles/2007/05/16/rails-edge-view-file-extention-functionality-has-changed. namespace 'views' do desc 'Renames all .rhtml views to .html.erb, .rjs to .js.rjs, .rxml to .xml.builder and .haml to .html.haml' task 'rename' [...]]]></description>
			<content:encoded><![CDATA[<p>Following my previous post, below is a modified version of &#8220;John Nunemaker&#8217;s &#8216;Renaming RHTML to ERB&#8217;&#8221;:http://railstips.org/2007/3/4/renaming-rhtml-to-erb to take into account the format in the extension, and handle &#8220;the RJS issues I was having&#8221;:http://www.thelucid.com/articles/2007/05/16/rails-edge-view-file-extention-functionality-has-changed.</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;">namespace <span style="color:#996600;">'views'</span> <span style="color:#9966CC; font-weight:bold;">do</span>
  desc <span style="color:#996600;">'Renames all .rhtml views to .html.erb, .rjs to .js.rjs, .rxml to .xml.builder and .haml to .html.haml'</span>
  task <span style="color:#996600;">'rename'</span> <span style="color:#9966CC; font-weight:bold;">do</span>
    <span style="color:#CC00FF; font-weight:bold;">Dir</span>.<span style="color:#9900CC;">glob</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">'app/views/**/[^_]*.rhtml'</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color:#9900CC;">each</span> <span style="color:#9966CC; font-weight:bold;">do</span> <span style="color:#006600; font-weight:bold;">|</span>file<span style="color:#006600; font-weight:bold;">|</span>
      <span style="color:#CC0066; font-weight:bold;">puts</span> <span style="color:#996600;">`svn mv #{file} #{file.gsub(/<span style="color:#000099;">\.</span>rhtml$/, '.html.erb')}`</span>
    <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
    <span style="color:#CC00FF; font-weight:bold;">Dir</span>.<span style="color:#9900CC;">glob</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">'app/views/**/[^_]*.rjs'</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color:#9900CC;">each</span> <span style="color:#9966CC; font-weight:bold;">do</span> <span style="color:#006600; font-weight:bold;">|</span>file<span style="color:#006600; font-weight:bold;">|</span>
      <span style="color:#CC0066; font-weight:bold;">puts</span> <span style="color:#996600;">`svn mv #{file} #{file.gsub(/<span style="color:#000099;">\.</span>rjs$/, '.js.rjs')}`</span>
    <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
    <span style="color:#CC00FF; font-weight:bold;">Dir</span>.<span style="color:#9900CC;">glob</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">'app/views/**/[^_]*.rxml'</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color:#9900CC;">each</span> <span style="color:#9966CC; font-weight:bold;">do</span> <span style="color:#006600; font-weight:bold;">|</span>file<span style="color:#006600; font-weight:bold;">|</span>
      <span style="color:#CC0066; font-weight:bold;">puts</span> <span style="color:#996600;">`svn mv #{file} #{file.gsub(/<span style="color:#000099;">\.</span>rxml$/, '.xml.builder')}`</span>
    <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
    <span style="color:#CC00FF; font-weight:bold;">Dir</span>.<span style="color:#9900CC;">glob</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">'app/views/**/[^_]*.haml'</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color:#9900CC;">each</span> <span style="color:#9966CC; font-weight:bold;">do</span> <span style="color:#006600; font-weight:bold;">|</span>file<span style="color:#006600; font-weight:bold;">|</span>
      <span style="color:#CC0066; font-weight:bold;">puts</span> <span style="color:#996600;">`svn mv #{file} #{file.gsub(/<span style="color:#000099;">\.</span>haml$/, '.html.haml')}`</span>
    <span style="color:#9966CC; font-weight:bold;">end</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
<span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div>

<p>h4. Update</p>
<p>Added haml conversion.</p>
]]></content:encoded>
			<wfw:commentRss>http://thelucid.com/2007/05/16/rails-edge-getting-your-view-extensions-ready-for-edge/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Disabling plugin code in generators/migrations</title>
		<link>http://thelucid.com/2006/09/21/disabling-plugin-code-in-generators-migrations/</link>
		<comments>http://thelucid.com/2006/09/21/disabling-plugin-code-in-generators-migrations/#comments</comments>
		<pubDate>Thu, 21 Sep 2006 15:48:00 +0000</pubDate>
		<dc:creator>Jamie</dc:creator>
				<category><![CDATA[Rails]]></category>
		<category><![CDATA[Rake]]></category>
		<category><![CDATA[plugins]]></category>

		<guid isPermaLink="false">http://8b1c3f77-017c-4ab9-a302-4c6789c397d2</guid>
		<description><![CDATA[I have found on numerous occasions that I need to disable certain plugin functionality if running a generator / rake db:migrate etc. An easy way to disable certain functionality follows: def method_that_shouldnt_be_run_in_migrations_or_generators # Return if we are using a generator or migrations script = File.basename&#40;$0&#41; return if &#40;script == 'generate'&#41; &#124;&#124; &#40;script == 'rake' &#38;&#38; [...]]]></description>
			<content:encoded><![CDATA[<p>I have found on numerous occasions that I need to disable certain plugin functionality if running a generator / <code>rake db:migrate</code> etc.</p>
<p>An easy way to disable certain functionality follows:</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#9966CC; font-weight:bold;">def</span> method_that_shouldnt_be_run_in_migrations_or_generators
  <span style="color:#008000; font-style:italic;"># Return if we are using a generator or migrations</span>
  script = <span style="color:#CC00FF; font-weight:bold;">File</span>.<span style="color:#9900CC;">basename</span><span style="color:#006600; font-weight:bold;">&#40;</span>$<span style="color:#006666;">0</span><span style="color:#006600; font-weight:bold;">&#41;</span>
  <span style="color:#0000FF; font-weight:bold;">return</span> <span style="color:#9966CC; font-weight:bold;">if</span> <span style="color:#006600; font-weight:bold;">&#40;</span>script == <span style="color:#996600;">'generate'</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">||</span> <span style="color:#006600; font-weight:bold;">&#40;</span>script == <span style="color:#996600;">'rake'</span> <span style="color:#006600; font-weight:bold;">&amp;&amp;</span> ARGV<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#006666;">0</span><span style="color:#006600; font-weight:bold;">&#93;</span> =~ <span style="color:#006600; font-weight:bold;">/</span>migrate$<span style="color:#006600; font-weight:bold;">/</span><span style="color:#006600; font-weight:bold;">&#41;</span>
<span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://thelucid.com/2006/09/21/disabling-plugin-code-in-generators-migrations/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Handy Subversion Rake task</title>
		<link>http://thelucid.com/2006/07/29/handy-subversion-rake-task/</link>
		<comments>http://thelucid.com/2006/07/29/handy-subversion-rake-task/#comments</comments>
		<pubDate>Sat, 29 Jul 2006 14:22:00 +0000</pubDate>
		<dc:creator>Jamie</dc:creator>
				<category><![CDATA[Rails]]></category>
		<category><![CDATA[Rake]]></category>
		<category><![CDATA[Subversion]]></category>

		<guid isPermaLink="false">http://b178603a-494e-438a-988c-2082b771dacc</guid>
		<description><![CDATA[Just read a post from &#8220;David&#8221;:http://david.planetargon.us at &#8220;Planet Argon&#8221;:http://planetargon.us/ showing a way to &#8220;add un-added files&#8221;:http://david.planetargon.us/articles/2006/07/28/i-love-shell-scripting in your Subversion working copy. I have made this into a simple rake task: namespace :svn do desc &#34;Adds all files with an svn status flag of '?'&#34; task&#40;:add_new&#41; &#123; `svn status &#124; awk '/\\?/ {print $2}' &#124; xargs [...]]]></description>
			<content:encoded><![CDATA[<p>Just read a post from &#8220;David&#8221;:http://david.planetargon.us at &#8220;Planet Argon&#8221;:http://planetargon.us/ showing a way to &#8220;add un-added files&#8221;:http://david.planetargon.us/articles/2006/07/28/i-love-shell-scripting in your Subversion working copy.</p>
<p>I have made this into a simple rake task:</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;">namespace <span style="color:#ff3333; font-weight:bold;">:svn</span> <span style="color:#9966CC; font-weight:bold;">do</span>
  desc <span style="color:#996600;">&quot;Adds all files with an svn status flag of '?'&quot;</span>
  task<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#ff3333; font-weight:bold;">:add_new</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span> <span style="color:#996600;">`svn status | awk '/<span style="color:#000099;">\\</span>?/ {print $2}' | xargs svn add`</span> <span style="color:#006600; font-weight:bold;">&#125;</span>
<span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div>

<p>Just drop this code in a file called subversion.rake inside the tasks directory. Now you can run <code>rake svn:add_new</code> which will add all new files with an svn status flag of &#8216;?&#8217; in your working copy.</p>
]]></content:encoded>
			<wfw:commentRss>http://thelucid.com/2006/07/29/handy-subversion-rake-task/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
	</channel>
</rss>
