<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="http://feeds.feedburner.com/~d/styles/rss2full.xsl" type="text/xsl" media="screen"?><?xml-stylesheet href="http://feeds.feedburner.com/~d/styles/itemcontent.css" type="text/css" media="screen"?><rss 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" version="2.0">

<channel>
	<title>The Lucid</title>
	
	<link>http://thelucid.com</link>
	<description>Lightweight ramblings</description>
	<pubDate>Tue, 11 Nov 2008 20:32:22 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.3</generator>
	<language>en</language>
			<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" href="http://feeds.feedburner.com/thelucid" type="application/rss+xml" /><item>
		<title>Hiding system files such as /usr and /bin on OSX Leopard</title>
		<link>http://thelucid.com/2008/11/11/hiding-system-files-such-as-usr-and-bin-on-osx-leopard/</link>
		<comments>http://thelucid.com/2008/11/11/hiding-system-files-such-as-usr-and-bin-on-osx-leopard/#comments</comments>
		<pubDate>Tue, 11 Nov 2008 10:49:49 +0000</pubDate>
		<dc:creator>Jamie</dc:creator>
		
		<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://thelucid.com/?p=471</guid>
		<description><![CDATA[This is a very boring post considering it&#8217;s the first in over a year but hey, I have to start somewhere.

Since upgrading to Leopard, even on clean installs, it decides to show system files such as /usr /bin /etc etc. To re-hide these files use the following:

  sudo /Developer/Tools/SetFile -a V /bin

The -a means [...]]]></description>
			<content:encoded><![CDATA[<p>This is a very boring post considering it&#8217;s the first in over a year but hey, I have to start somewhere.</p>

<p>Since upgrading to Leopard, even on clean installs, it decides to show system files such as /usr /bin /etc etc. To re-hide these files use the following:</p>

<p>  sudo /Developer/Tools/SetFile -a V /bin</p>

<p>The -a means &#8220;set attributes&#8221; and the V means make in(V)isible (obviously!?). You will need developer tools installed from the Leopard disc for this to work.</p>

<h3>Why so long since the last post?</h3>

<p>The reason for not posting in such a long time is that I was running on a broken Typo install for ages with no time to fix it. I have now moved to Wordpress as it has grown up a little since I last used it. I will be porting the Lucid theme and adding features at some point, in the meantime the Typo version is still available as a download.</p>]]></content:encoded>
			<wfw:commentRss>http://thelucid.com/2008/11/11/hiding-system-files-such-as-usr-and-bin-on-osx-leopard/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Proprietary CSS rules - Are we returning to 1995?</title>
		<link>http://thelucid.com/2007/10/30/proprietary-css-rules-are-we-returning-to-1995/</link>
		<comments>http://thelucid.com/2007/10/30/proprietary-css-rules-are-we-returning-to-1995/#comments</comments>
		<pubDate>Tue, 30 Oct 2007 13:44:00 +0000</pubDate>
		<dc:creator>Jamie</dc:creator>
		
		<category><![CDATA[CSS]]></category>

		<category><![CDATA[General]]></category>

		<category><![CDATA[Mac / OS X]]></category>

		<category><![CDATA[design]]></category>

		<category><![CDATA[webkit]]></category>

		<guid isPermaLink="false">88bcddf7-b862-47f8-8788-3a0abd4c8ab7</guid>
		<description><![CDATA[Call me a cynic, but posts like this one on the Surfin&#8217; Safari blog worry me a little. Let me explain&#8230;

I don&#8217;t know if anyone remembers back to the days of Netscape 4 and Explorer 3.5? - It was a time of table based layouts and browser sniffing. Each browser had it&#8217;s own &#8220;feature&#8221; set [...]]]></description>
			<content:encoded><![CDATA[<p>Call me a cynic, but <a href="http://webkit.org/blog/130/css-transforms">posts like this one on the Surfin&#8217; Safari blog</a> worry me a little. Let me explain&#8230;</p>

<p>I don&#8217;t know if anyone remembers back to the days of Netscape 4 and Explorer 3.5? - It was a time of table based layouts and browser sniffing. Each browser had it&#8217;s own &#8220;feature&#8221; set and this resulted in hacks galore, for example Netscape had &#8220;Layers&#8221; but Explorer didn&#8217;t, Explorer had feature X but Netscape didn&#8217;t.</p>

<p>Along came <a href="http://www.w3c.org">Web Standards</a> and the likes of <a href="http://www.zeldman.com">Jeffrey Zeldman</a> fighting for a standards based approach to web development. Over a decade on, it looks like were finally getting there as <em>even</em> Microsoft <em>slowly</em> start to get things right with <span class="caps">IE7.</span></p>

<p>As cool as the <a href="http://webkit.org/blog/130/css-transforms"><span class="caps">CSS</span> Transform</a> stuff looks, I can&#8217;t help but thing we&#8217;re stepping right back into 1995.</p>

<p>What does everyone else think?</p>]]></content:encoded>
			<wfw:commentRss>http://thelucid.com/2007/10/30/proprietary-css-rules-are-we-returning-to-1995/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Rails: Using Autotest with UnitRecord</title>
		<link>http://thelucid.com/2007/09/05/rails-using-autotest-with-unitrecord/</link>
		<comments>http://thelucid.com/2007/09/05/rails-using-autotest-with-unitrecord/#comments</comments>
		<pubDate>Thu, 06 Sep 2007 00:17:00 +0000</pubDate>
		<dc:creator>Jamie</dc:creator>
		
		<category><![CDATA[Rails]]></category>

		<category><![CDATA[Ruby]]></category>

		<category><![CDATA[autotest]]></category>

		<category><![CDATA[test]]></category>

		<category><![CDATA[unit_record]]></category>

		<guid isPermaLink="false">d3754554-5787-434b-8741-474c805c4a4e</guid>
		<description><![CDATA[Myself and a colleague have just managed to waste away a good couple of hours trying to figure out Autotests strange &#8217;style&#8217; mechanism to add the ability to test in the way Jay Fields explains using UnitRecord.

You can grab our plugin to enable UnitRecord when using Autotest below:

http://svn.soniciq.com/public/rails/plugins/iq_autotest

By default, running autotest in the Rails directory [...]]]></description>
			<content:encoded><![CDATA[<p>Myself and a colleague have just managed to waste away a good couple of hours trying to figure out Autotests strange &#8217;style&#8217; mechanism to add the ability to <a href="http://blog.jayfields.com/2007/09/rails-how-we-test.html">test in the way Jay Fields explains</a> using <a href="http://unit-test-ar.rubyforge.org/">UnitRecord</a>.</p>

<p>You can grab our plugin to enable <a href="http://unit-test-ar.rubyforge.org/">UnitRecord</a> when using <a href="http://rubyforge.org/projects/zentest">Autotest</a> below:</p>

<p><a href="http://svn.soniciq.com/public/rails/plugins/iq_autotest">http://svn.soniciq.com/public/rails/plugins/iq_autotest</a></p>

<p>By default, running <code>autotest</code> in the Rails directory will run the unit tests. To run the functional tests, do: <code>AUTOTEST='functional' autotest</code></p>

<p>I hope this saves some people some time!!</p>]]></content:encoded>
			<wfw:commentRss>http://thelucid.com/2007/09/05/rails-using-autotest-with-unitrecord/feed/</wfw:commentRss>
		</item>
		<item>
		<title>SonicIQ Hiring! - UK, Ruby on Rails Developer Required</title>
		<link>http://thelucid.com/2007/08/28/soniciq-hiring-uk-ruby-on-rails-developer-required/</link>
		<comments>http://thelucid.com/2007/08/28/soniciq-hiring-uk-ruby-on-rails-developer-required/#comments</comments>
		<pubDate>Tue, 28 Aug 2007 04:49:00 +0000</pubDate>
		<dc:creator>Jamie</dc:creator>
		
		<category><![CDATA[Rails]]></category>

		<category><![CDATA[Ruby]]></category>

		<category><![CDATA[SonicIQ]]></category>

		<category><![CDATA[CSS]]></category>

		<category><![CDATA[jobs]]></category>

		<category><![CDATA[xhtml]]></category>

		<guid isPermaLink="false">c7aaa47a-1bb0-428e-99ac-5852f8dc1bdf</guid>
		<description><![CDATA[We are looking for a Ruby on Rails, XHTML &#38; CSS Developer to join our team at SonicIQ. Head over to 43folders job board to view our ad.

These are exiting times with projects like Propel&#8217;r in the pipeline, along with the ever-growing opportunities for new and interesting client projects.

If you are a highly motivated developer [...]]]></description>
			<content:encoded><![CDATA[<p>We are looking for a Ruby on Rails, <span class="caps">XHTML </span>&amp; <span class="caps">CSS</span> Developer to join our team at <a href="http://soniciq.com">SonicIQ</a>. Head over to <a href="http://jobs.43folders.com/job/6a5255713e8351a5eb2efef7805b7629/?d=1">43folders job board to view our ad</a>.</p>

<p>These are exiting times with projects like <a href="http://propelr.com">Propel&#8217;r</a> in the pipeline, along with the ever-growing opportunities for new and interesting client projects.</p>

<p>If you are a highly motivated developer and can see yourself in a Ruby on Rails position in sunny (sometimes) Bournemouth, UK then <a href="http://jobs.43folders.com/job/6a5255713e8351a5eb2efef7805b7629/?d=1">apply at 43folders</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://thelucid.com/2007/08/28/soniciq-hiring-uk-ruby-on-rails-developer-required/feed/</wfw:commentRss>
		</item>
		<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">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; do &#124;rcov&#124;
 [...]]]></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"><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> |rcov|
    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> |rcov|
    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 <span class="caps">OSX </span>this will open automatically) in a browser to view the results.</p>

<p>Thanks to <a href="http://clarkware.com/cgi/blosxom">Mike Clark</a> for his <a href="http://clarkware.com/cgi/blosxom/2007/01/05#RcovRakeTask">Rcov rake task for Rails</a> which this task is based on.</p>

<p><strong>Update (11-11-08):</strong> 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>
		</item>
		<item>
		<title>Ruby Ternary operator re-written with Boolean operators</title>
		<link>http://thelucid.com/2007/08/23/ruby-ternary-operator-re-written-with-boolean-operators/</link>
		<comments>http://thelucid.com/2007/08/23/ruby-ternary-operator-re-written-with-boolean-operators/#comments</comments>
		<pubDate>Thu, 23 Aug 2007 16:43:00 +0000</pubDate>
		<dc:creator>Jamie</dc:creator>
		
		<category><![CDATA[Ruby]]></category>

		<category><![CDATA[boolean]]></category>

		<category><![CDATA[operator]]></category>

		<category><![CDATA[ternary]]></category>

		<guid isPermaLink="false">8b9af4c0-38d3-444d-8072-94ec308fc3b2</guid>
		<description><![CDATA[Just noticed something interesting (well not that interesting). Ternary operators in Ruby can be re-written using Boolean operators e.g.


method = object.respond_to?&#40;:foo&#41; ? :foo : :bar




would become&#8230;


method = object.respond_to?&#40;:foo&#41; &#38;&#38; :foo &#124;&#124; :bar




Simply replace ? with &#38;&#38; and : with &#124;&#124;

I don&#8217;t know if there is any performance gain here, anyone care to investigate?]]></description>
			<content:encoded><![CDATA[<p>Just noticed something interesting (well not that interesting). Ternary operators in Ruby can be re-written using Boolean operators e.g.</p>


<div class="wp_syntax"><div class="code"><pre class="ruby">method = object.<span style="color:#9900CC;">respond_to</span>?<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#ff3333; font-weight:bold;">:foo</span><span style="color:#006600; font-weight:bold;">&#41;</span> ? <span style="color:#ff3333; font-weight:bold;">:foo</span> : <span style="color:#ff3333; font-weight:bold;">:bar</span></pre></div></div>




<p>would become&#8230;</p>


<div class="wp_syntax"><div class="code"><pre class="ruby">method = object.<span style="color:#9900CC;">respond_to</span>?<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#ff3333; font-weight:bold;">:foo</span><span style="color:#006600; font-weight:bold;">&#41;</span> &amp;&amp; <span style="color:#ff3333; font-weight:bold;">:foo</span> || <span style="color:#ff3333; font-weight:bold;">:bar</span></pre></div></div>




<p>Simply replace <code>?</code> with <code>&amp;&amp;</code> and <code>:</code> with <code>||</code></p>

<p>I don&#8217;t know if there is any performance gain here, anyone care to investigate?</p>]]></content:encoded>
			<wfw:commentRss>http://thelucid.com/2007/08/23/ruby-ternary-operator-re-written-with-boolean-operators/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Typo 4.1 slow comment posting</title>
		<link>http://thelucid.com/2007/08/17/typo-4-1-slow-comment-posting/</link>
		<comments>http://thelucid.com/2007/08/17/typo-4-1-slow-comment-posting/#comments</comments>
		<pubDate>Fri, 17 Aug 2007 05:33:00 +0000</pubDate>
		<dc:creator>Jamie</dc:creator>
		
		<category><![CDATA[Rails]]></category>

		<category><![CDATA[Ruby]]></category>

		<category><![CDATA[Typo]]></category>

		<category><![CDATA[comments]]></category>

		<category><![CDATA[slow]]></category>

		<guid isPermaLink="false">90e0bfe2-accb-4d2d-94f3-874072a888cc</guid>
		<description><![CDATA[Is anyone else having problems with Typo 4.1 taking ages to process new comments. If anyone has any suggestions I would love to hear them (If you can be bothered to wait for the comment to go through!)]]></description>
			<content:encoded><![CDATA[<p>Is anyone else having problems with Typo 4.1 taking ages to process new comments. If anyone has any suggestions I would love to hear them (If you can be bothered to wait for the comment to go through!)</p>]]></content:encoded>
			<wfw:commentRss>http://thelucid.com/2007/08/17/typo-4-1-slow-comment-posting/feed/</wfw:commentRss>
		</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">b421d2ad-f2ac-4995-ab32-f869688736fb</guid>
		<description><![CDATA[John Nunemaker posted a handy tip on setting up autotest to work with Growl

I use this all the time now however I didn&#8217;t like the ugly smilies (call me shallow if you like). I used Wolfgang Bartelme&#8217;s Smily Devkit to make a couple of PNG&#8217;s slightly more pleasing to the eye.





The zip file can be [...]]]></description>
			<content:encoded><![CDATA[<p>John Nunemaker posted a handy tip on <a href="http://railstips.org/2007/7/23/autotest-growl-pass-fail-notifications">setting up autotest to work with Growl</a></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 <a href="http://bartelme.at">Wolfgang Bartelme&#8217;s</a> <a href="http://bartelme.at/journal/archive/smiley_devkit">Smily Devkit</a> to make a couple of <span class="caps">PNG&#8217;</span>s slightly more pleasing to the eye.</p>

<p class="center" style="text-align:center"><img src="http://thelucid.com/files/fail.png" alt="Autotest Fail image" height="154" width="154" />
<img src="http://thelucid.com/files/pending.png" alt="Autotest Pending image" height="154" width="154" />
<img src="http://thelucid.com/files/pass.png" alt="Autotest Pass image" height="154" width="154" /></p>

<p>The zip file can be downloaded here: <a href="http://thelucid.com/files/autotest_images.zip">autotest_images.zip</a></p>

<p><strong>Update</strong> 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>
		</item>
		<item>
		<title>A Ruby reject! that returns the rejected items</title>
		<link>http://thelucid.com/2007/07/25/a-ruby-reject-that-returns-the-rejected-items/</link>
		<comments>http://thelucid.com/2007/07/25/a-ruby-reject-that-returns-the-rejected-items/#comments</comments>
		<pubDate>Wed, 25 Jul 2007 14:48:00 +0000</pubDate>
		<dc:creator>Jamie</dc:creator>
		
		<category><![CDATA[Ruby]]></category>

		<category><![CDATA[hash]]></category>

		<category><![CDATA[reject]]></category>

		<guid isPermaLink="false">76591e7d-a15e-45ac-a512-a0548e18e88d</guid>
		<description><![CDATA[I often need to do a reject! and return the rejected items instead of the modified collection. This saves having to do a select beforehand.

An example of how accomplish this:


options = &#123; :a =&#62; 1, :b =&#62; 2, :c =&#62; 3 &#125;
rejects = Hash&#91;*options.select &#123; &#124;k, v&#124; k == :b &#38;&#38; options.delete&#40;k&#41; &#125;.flatten&#93;
&#160;
assert_equal &#123; :a [...]]]></description>
			<content:encoded><![CDATA[<p>I often need to do a <code>reject!</code> and return the rejected items instead of the modified collection. This saves having to do a <code>select</code> beforehand.</p>

<p>An example of how accomplish this:</p>


<div class="wp_syntax"><div class="code"><pre class="ruby">options = <span style="color:#006600; font-weight:bold;">&#123;</span> <span style="color:#ff3333; font-weight:bold;">:a</span> =&gt; <span style="color:#006666;">1</span>, <span style="color:#ff3333; font-weight:bold;">:b</span> =&gt; <span style="color:#006666;">2</span>, <span style="color:#ff3333; font-weight:bold;">:c</span> =&gt; <span style="color:#006666;">3</span> <span style="color:#006600; font-weight:bold;">&#125;</span>
rejects = <span style="color:#CC00FF; font-weight:bold;">Hash</span><span style="color:#006600; font-weight:bold;">&#91;</span>*options.<span style="color:#CC0066; font-weight:bold;">select</span> <span style="color:#006600; font-weight:bold;">&#123;</span> |k, v| k == <span style="color:#ff3333; font-weight:bold;">:b</span> &amp;&amp; options.<span style="color:#9900CC;">delete</span><span style="color:#006600; font-weight:bold;">&#40;</span>k<span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#125;</span>.<span style="color:#9900CC;">flatten</span><span style="color:#006600; font-weight:bold;">&#93;</span>
&nbsp;
assert_equal <span style="color:#006600; font-weight:bold;">&#123;</span> <span style="color:#ff3333; font-weight:bold;">:a</span> =&gt; <span style="color:#006666;">1</span>, <span style="color:#ff3333; font-weight:bold;">:c</span> =&gt; <span style="color:#006666;">3</span> <span style="color:#006600; font-weight:bold;">&#125;</span>, options
assert_equal <span style="color:#006600; font-weight:bold;">&#123;</span> <span style="color:#ff3333; font-weight:bold;">:b</span> =&gt; <span style="color:#006666;">2</span> <span style="color:#006600; font-weight:bold;">&#125;</span>, rejects</pre></div></div>




<p>This could be written as a method of the <code>Hash</code> class and an alternative for <code>Array</code>.</p>

<p>For <code>Hash</code>, the code would look something like:</p>


<div class="wp_syntax"><div class="code"><pre class="ruby"><span style="color:#9966CC; font-weight:bold;">class</span> <span style="color:#CC00FF; font-weight:bold;">Hash</span>
  <span style="color:#9966CC; font-weight:bold;">def</span> extract!
    <span style="color:#CC00FF; font-weight:bold;">Hash</span><span style="color:#006600; font-weight:bold;">&#91;</span>*<span style="color:#0000FF; font-weight:bold;">self</span>.<span style="color:#CC0066; font-weight:bold;">select</span> <span style="color:#006600; font-weight:bold;">&#123;</span> |k, v| <span style="color:#9966CC; font-weight:bold;">yield</span><span style="color:#006600; font-weight:bold;">&#40;</span>k, v<span style="color:#006600; font-weight:bold;">&#41;</span> &amp;&amp; <span style="color:#0000FF; font-weight:bold;">self</span>.<span style="color:#9900CC;">delete</span><span style="color:#006600; font-weight:bold;">&#40;</span>k<span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#125;</span>.<span style="color:#9900CC;">flatten</span><span style="color:#006600; font-weight:bold;">&#93;</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
<span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
options = <span style="color:#006600; font-weight:bold;">&#123;</span> <span style="color:#ff3333; font-weight:bold;">:a</span> =&gt; <span style="color:#006666;">1</span>, <span style="color:#ff3333; font-weight:bold;">:b</span> =&gt; <span style="color:#006666;">2</span>, <span style="color:#ff3333; font-weight:bold;">:c</span> =&gt; <span style="color:#006666;">3</span> <span style="color:#006600; font-weight:bold;">&#125;</span>
rejects = options.<span style="color:#9900CC;">extract</span>! <span style="color:#006600; font-weight:bold;">&#123;</span> |k, v| k == <span style="color:#ff3333; font-weight:bold;">:b</span> <span style="color:#006600; font-weight:bold;">&#125;</span>
&nbsp;
assert_equal <span style="color:#006600; font-weight:bold;">&#123;</span> <span style="color:#ff3333; font-weight:bold;">:a</span> =&gt; <span style="color:#006666;">1</span>, <span style="color:#ff3333; font-weight:bold;">:c</span> =&gt; <span style="color:#006666;">3</span> <span style="color:#006600; font-weight:bold;">&#125;</span>, options
assert_equal <span style="color:#006600; font-weight:bold;">&#123;</span> <span style="color:#ff3333; font-weight:bold;">:b</span> =&gt; <span style="color:#006666;">2</span> <span style="color:#006600; font-weight:bold;">&#125;</span>, rejects</pre></div></div>




<p>If I am missing something obvious in Ruby that accomplishes the same, please leave a comment.</p>]]></content:encoded>
			<wfw:commentRss>http://thelucid.com/2007/07/25/a-ruby-reject-that-returns-the-rejected-items/feed/</wfw:commentRss>
		</item>
		<item>
		<title>TheLucid Typo theme now works with version 4.1</title>
		<link>http://thelucid.com/2007/07/24/thelucid-typo-theme-now-works-with-version-4-1/</link>
		<comments>http://thelucid.com/2007/07/24/thelucid-typo-theme-now-works-with-version-4-1/#comments</comments>
		<pubDate>Wed, 25 Jul 2007 03:53:00 +0000</pubDate>
		<dc:creator>Jamie</dc:creator>
		
		<category><![CDATA[Lucid theme]]></category>

		<category><![CDATA[Rails]]></category>

		<category><![CDATA[Typo]]></category>

		<category><![CDATA[lucid]]></category>

		<category><![CDATA[theme]]></category>

		<category><![CDATA[update]]></category>

		<guid isPermaLink="false">e95b7d07-1106-4b73-9e55-3b572aaec7b7</guid>
		<description><![CDATA[TheLucid Typo theme finally works with version 4.1 of Typo.

Please bear in mind that this is quick-fix and and there will still be a Version 2 release sometime in the near future.

The new release can be downloaded below:

lucid-typo-theme-1-1.zip

There are a couple of improvements such as cookies remembering which colour scheme and layout have been selected [...]]]></description>
			<content:encoded><![CDATA[<p>TheLucid Typo theme finally works with version 4.1 of Typo.</p>

<p>Please bear in mind that this is quick-fix and and there will still be a Version 2 release sometime in the near future.</p>

<p>The new release can be downloaded below:</p>

<p><a href="http://thelucid.com/files/lucid-typo-theme-1-1.zip">lucid-typo-theme-1-1.zip</a></p>

<p>There are a couple of improvements such as cookies remembering which colour scheme and layout have been selected along with some IE fixes.</p>

<p>Thanks to everyone who notified me of browser issues etc. and I hope to release v2.0 as soon as possible (for both Typo and Mephisto).</p>]]></content:encoded>
			<wfw:commentRss>http://thelucid.com/2007/07/24/thelucid-typo-theme-now-works-with-version-4-1/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
