<?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>Blog &#124; Rubyyot</title>
	<atom:link href="http://blog.rubyyot.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.rubyyot.com</link>
	<description>Programming, Pragmatism and Getting By in the World</description>
	<lastBuildDate>Wed, 24 Mar 2010 00:14:27 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>So What&#8217;s the Deal with IndexCards?</title>
		<link>http://blog.rubyyot.com/2010/03/so-whats-the-deal-with-indexcards/</link>
		<comments>http://blog.rubyyot.com/2010/03/so-whats-the-deal-with-indexcards/#comments</comments>
		<pubDate>Wed, 24 Mar 2010 00:09:17 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Thoughts]]></category>
		<category><![CDATA[#daily365]]></category>
		<category><![CDATA[art]]></category>
		<category><![CDATA[indexcards]]></category>
		<category><![CDATA[rubyyot]]></category>
		<category><![CDATA[tokyo cabinet]]></category>

		<guid isPermaLink="false">http://blog.rubyyot.com/?p=721</guid>
		<description><![CDATA[What&#8217;s all this IndexCards nonsense?
IndexCards is a website that I&#8217;ve been devoting a good deal of my free time to recently.  It is a family project where we draw new stuff on index cards everyday.
So it&#8217;s an Art Project?
Well yes, and no.  IndexCards is:

An Art Project &#8211; You got me, yes it&#8217;s in [...]]]></description>
			<content:encoded><![CDATA[<h2>What&#8217;s all this IndexCards nonsense?</h2>
<p>IndexCards is a website that I&#8217;ve been devoting a good deal of my free time to recently.  It is a family project where we draw new stuff on index cards everyday.</p>
<h2>So it&#8217;s an Art Project?</h2>
<p>Well yes, and no.  <a href="http://indexcards.rubyyot.com" target="_blank">IndexCards</a> is:</p>
<ul>
<li>An Art Project &#8211; You got me, yes it&#8217;s in some ways completely non-technical.</li>
<li>A Family Activity &#8211; Since my kids have gotten involved, it has just gotten better and better.</li>
<li>An Evolving Sinatra Based Website &#8211; My first Sinatra based project, and I am really liking it.</li>
<li>A Way for Me to Try out Tokyo Cabinet &#8211; I&#8217;ve found that I don&#8217;t always need a relational database.</li>
<li>An Opportunity to Use my Razsell Gem &#8211; A live app that consumes feeds from Zazzle.</li>
<li>A Design Project &#8211; Let&#8217;s face it creating a website from scratch that is part of the design community raises the bar a little.</li>
</ul>
<h3>IndexCards is an Art Project</h3>
<p>I created IndexCards in response to the <a href="http://www.smashingmagazine.com/2009/12/22/design-something-every-day/" target="_blank">Design Something Every Day Challenge</a> posted on Smashing Magazine at the end of 2009.  I enjoy drawing and painting, but have directed so much of my interest towards Ruby and Open Source Projects (and the internet) in the past couple years that I haven&#8217;t spent time creating any art.  As a new years resolution, I decided to change this by accepting the challenge.</p>
<h3>IndexCards is a Family Activity</h3>
<p>After a month or so of me scribbling away on little pieces of paper, my kids asked me what I was up to.  So I explained that it is a project to help me to improve my artistic skills and &#8220;enjoy the journey&#8221; so to speak.  They all wanted to participate and so I&#8217;ve been including them since then.  Recently, I&#8217;ve started creating <a href="http://indexcards.rubyyot.com/events" target="_blank">Art Night events</a> where I introduce a theme and we all start drawing away.  It has been a great family activity and I&#8217;ve been very impressed by all of their work.</p>
<h3>IndexCards is an Evolving Sinatra Based Website</h3>
<p>OK there is a technical side to this project, but that&#8217;s perfect for me.  I find that I like both the technical and creative sides of things.  When one side of my brain needs a break I can flip over to the other and continue working on the project.  A lot of the site&#8217;s inner workings are not visible from the web, but there is definitely a web based component.  For that I decided to use <a href="http://www.sinatrarb.com/" target="_blank">Sinatra</a> and it&#8217;s been great to work with.  It&#8217;s a lot more open that working with Ruby on Rails, but many of the tedious parts of working directly with Rack have been smoothed out.  I&#8217;m interested<br />
in creating another Sinatra based application.</p>
<h3>IndexCards is a Way for Me to Try Out Tokyo Cabinet</h3>
<p>Another technical bit I wanted to try out in <a href="http://1978th.net/tokyocabinet/" target="_blank">Tokyo Cabinet</a> a key value store of Mixi fame.  I used the rufus-tokyo gem to interface with Ruby along with the Repository pattern.  I was really worried at first that I&#8217;d get to a point where I really<br />
needed a relational database and I&#8217;d have to rewrite the data persistence in MySql.  As the project goes on, I&#8217;m finding that my fears were unfounded.  Tokyo Cabinet was a great fit for the project.</p>
<h3>IndexCards is an Opportunity to Use my Razsell Gem</h3>
<p>Ah <a href="http://github.com/rubyyot/razsell" target="_blank">Razsell</a>.  I created this gem while starting out on Kung Fu Tees, a T-shirt design site I wanted to make with my kids. Kung Fu Tees, this far is vaporware, but Razsell has emerged as it&#8217;s own project any users.  It allows you to query the Zazzle.com rss API and consume the feed to populate a store.  Using it has caused me to make a few changes, which is great, because that&#8217;s what happens when you really use the code you write.</p>
<h3>IndexCards is a Design Project</h3>
<p>So I&#8217;ve always been wary of CSS and web design in general.  I mean I&#8217;m ok at it, but am generally disappointed with the look of my sites when I compare them to so many of the other websites out there.  Designing a website that is part of the web design community ups the ante a bit.  So far I&#8217;m not<br />
completely satisfied with it, but it is much better than I&#8217;d feared it would be.</p>
<h2>But, Why Index Cards?</h2>
<p>I wanted to draw daily, but I didn&#8217;t want to burden myself with a huge canvas.  Index cards are the perfect size to constrain the scope of the image and challenge me to make it fit.  Not to mention they are cheap and you can find them almost anywhere.  That leaves a little budget for art supplies, and<br />
I&#8217;ve been picking up a few things here and there.  Just today I ordered a <a href="http://www.lamyusa.com/safari.html" target="_blank">Lamy Safari fountain pen</a> to try out, and am looking forward to it.</p>
<p>Original small works of art (<a href="http://www.ebsqart.com/Galleries/cmd_Art_Gallery_OSWOA%20Original%20Small%20Works%20of%20Art_1_1.htm" target="_blank">OSWOA</a>) have<br />
stemmed from the Artist Trading Cards and ACEO communities on ebay.  Maybe I can find a tie-in for those.  They fit right in.</p>
<h2>IndexCards is fun, You Should Check it Out</h2>
<p>If you haven&#8217;t been to <a href="http://indexcards.rubyyot.com" target="_blank">IndexCards</a> go take a look.  Maybe you will be inspired to do some art of your own.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.rubyyot.com/2010/03/so-whats-the-deal-with-indexcards/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Getting 502 Bad Gateway with Passenger after cleaning gems</title>
		<link>http://blog.rubyyot.com/2010/02/getting-502-bad-gateway-with-passenger-after-cleaning-gems/</link>
		<comments>http://blog.rubyyot.com/2010/02/getting-502-bad-gateway-with-passenger-after-cleaning-gems/#comments</comments>
		<pubDate>Thu, 25 Feb 2010 17:50:42 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Ruby]]></category>
		<category><![CDATA[error]]></category>
		<category><![CDATA[gem clean]]></category>
		<category><![CDATA[nginx]]></category>
		<category><![CDATA[passenger]]></category>
		<category><![CDATA[webserver]]></category>

		<guid isPermaLink="false">http://blog.rubyyot.com/?p=718</guid>
		<description><![CDATA[502 Bad Gateway
Recently I was updating some gems on my server. I did a gem update and a gem update &#8211;system.  Everything seemed to be running smoothly.  However a few minutes later I was checking my sites and I discovered that all of my Rack based sites were down and giving a 502 [...]]]></description>
			<content:encoded><![CDATA[<h2>502 Bad Gateway</h2>
<p>Recently I was updating some gems on my server. I did a gem update and a gem update &#8211;system.  Everything seemed to be running smoothly.  However a few minutes later I was checking my sites and I discovered that all of my Rack based sites were down and giving a 502 error.</p>
<h2>The Background</h2>
<p>In my short experience being my own webmaster, I&#8217;ve found that the 502 error code is the most unhelpful of error codes. It means that your app is not working.  After a few times checking my error logs I noticed that the error that was bubbling up was &#8220;No such file or directory&#8221;.  So I took this and searched through my apps looking for a file that might be missing</p>
<p>After a few hours of searching, restarting Nginx and reinstalling passenger, my apps and my gems, I took some time to think about the issue. I realized that all of my passenger apps were now suddenly failing, but my wordpress blog was still chugging along just fine. So I decided that the problem must be with Passenger.</p>
<h2>The Culprit</h2>
<p>After much digging around, I found that the Nginx config was still pointing to the Passenger version 2.2.9.  A version I&#8217;d removed with gem clean many hours before.  Once I updated this to version 2.2.10, which was the current version installed, everything started working again.</p>
<h2>The Moral</h2>
<p>If you update Passenger make sure that your webserver configuration is pointing to the new version.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.rubyyot.com/2010/02/getting-502-bad-gateway-with-passenger-after-cleaning-gems/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ruby Wisdom</title>
		<link>http://blog.rubyyot.com/2010/02/ruby-wisdom/</link>
		<comments>http://blog.rubyyot.com/2010/02/ruby-wisdom/#comments</comments>
		<pubDate>Wed, 17 Feb 2010 04:31:00 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[humor]]></category>
		<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://blog.rubyyot.com/?p=715</guid>
		<description><![CDATA[I got this error today testing a Rails 3 app that I&#8217;m working on..

  3&#41; Error:
test_updates_status&#40;QueueWorkerTest&#41;:
NoMethodError: undefined method 'save!' for &#34;g&#34;:String
    /home/rubyyot/working/stuff.longshotlabs.com/lib/stuff/queue_worker.rb:66:in 'block in retrieve_item_info'
    /home/rubyyot/working/stuff.longshotlabs.com/lib/stuff/queue_worker.rb:64:in 'each'
    /home/rubyyot/working/stuff.longshotlabs.com/lib/stuff/queue_worker.rb:64:in 'retrieve_item_info'
    /home/rubyyot/working/stuff.longshotlabs.com/lib/stuff/queue_worker.rb:38:in 'process_unit'
    /home/rubyyot/working/stuff.longshotlabs.com/lib/stuff/queue_worker.rb:14:in 'process_queue'
    /home/rubyyot/working/stuff.longshotlabs.com/test/unit/queue_worker_test.rb:35:in 'test_updates_status'

]]></description>
			<content:encoded><![CDATA[<p>I got this error today testing a Rails 3 app that I&#8217;m working on..</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">  <span style="color: #000000;">3</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> Error:
test_updates_status<span style="color: #7a0874; font-weight: bold;">&#40;</span>QueueWorkerTest<span style="color: #7a0874; font-weight: bold;">&#41;</span>:
NoMethodError: undefined method <span style="color: #ff0000;">'save!'</span> <span style="color: #000000; font-weight: bold;">for</span> <span style="color: #ff0000;">&quot;g&quot;</span>:String
    <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>rubyyot<span style="color: #000000; font-weight: bold;">/</span>working<span style="color: #000000; font-weight: bold;">/</span>stuff.longshotlabs.com<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>stuff<span style="color: #000000; font-weight: bold;">/</span>queue_worker.rb:<span style="color: #000000;">66</span>:<span style="color: #000000; font-weight: bold;">in</span> <span style="color: #ff0000;">'block in retrieve_item_info'</span>
    <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>rubyyot<span style="color: #000000; font-weight: bold;">/</span>working<span style="color: #000000; font-weight: bold;">/</span>stuff.longshotlabs.com<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>stuff<span style="color: #000000; font-weight: bold;">/</span>queue_worker.rb:<span style="color: #000000;">64</span>:<span style="color: #000000; font-weight: bold;">in</span> <span style="color: #ff0000;">'each'</span>
    <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>rubyyot<span style="color: #000000; font-weight: bold;">/</span>working<span style="color: #000000; font-weight: bold;">/</span>stuff.longshotlabs.com<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>stuff<span style="color: #000000; font-weight: bold;">/</span>queue_worker.rb:<span style="color: #000000;">64</span>:<span style="color: #000000; font-weight: bold;">in</span> <span style="color: #ff0000;">'retrieve_item_info'</span>
    <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>rubyyot<span style="color: #000000; font-weight: bold;">/</span>working<span style="color: #000000; font-weight: bold;">/</span>stuff.longshotlabs.com<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>stuff<span style="color: #000000; font-weight: bold;">/</span>queue_worker.rb:<span style="color: #000000;">38</span>:<span style="color: #000000; font-weight: bold;">in</span> <span style="color: #ff0000;">'process_unit'</span>
    <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>rubyyot<span style="color: #000000; font-weight: bold;">/</span>working<span style="color: #000000; font-weight: bold;">/</span>stuff.longshotlabs.com<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>stuff<span style="color: #000000; font-weight: bold;">/</span>queue_worker.rb:<span style="color: #000000;">14</span>:<span style="color: #000000; font-weight: bold;">in</span> <span style="color: #ff0000;">'process_queue'</span>
    <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>rubyyot<span style="color: #000000; font-weight: bold;">/</span>working<span style="color: #000000; font-weight: bold;">/</span>stuff.longshotlabs.com<span style="color: #000000; font-weight: bold;">/</span>test<span style="color: #000000; font-weight: bold;">/</span>unit<span style="color: #000000; font-weight: bold;">/</span>queue_worker_test.rb:<span style="color: #000000;">35</span>:<span style="color: #000000; font-weight: bold;">in</span> <span style="color: #ff0000;">'test_updates_status'</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://blog.rubyyot.com/2010/02/ruby-wisdom/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Date.parse() is not your friend.</title>
		<link>http://blog.rubyyot.com/2010/02/date-parse-is-not-your-friend/</link>
		<comments>http://blog.rubyyot.com/2010/02/date-parse-is-not-your-friend/#comments</comments>
		<pubDate>Sun, 07 Feb 2010 15:08:30 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Ruby]]></category>
		<category><![CDATA[date]]></category>
		<category><![CDATA[parse]]></category>
		<category><![CDATA[ruby 1.9]]></category>

		<guid isPermaLink="false">http://blog.rubyyot.com/?p=711</guid>
		<description><![CDATA[I&#8217;ve started looking at Ruby 1.9 with multiruby, and one of the first things that I found in testing is that Date.parse assumes European dates (dd/mm/yyyy format) in v1.9.  The solution is to use strptime() instead so you can specify a format.

Date.strptime&#40;&#34;12/31/2009&#34;, &#34;%m/%d/%Y&#34;&#41;

]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve started looking at Ruby 1.9 with multiruby, and one of the first things that I found in testing is that Date.parse assumes European dates (dd/mm/yyyy format) in v1.9.  The solution is to use strptime() instead so you can specify a format.</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#CC00FF; font-weight:bold;">Date</span>.<span style="color:#9900CC;">strptime</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot;12/31/2009&quot;</span>, <span style="color:#996600;">&quot;%m/%d/%Y&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://blog.rubyyot.com/2010/02/date-parse-is-not-your-friend/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Moving soon</title>
		<link>http://blog.rubyyot.com/2010/02/moving-soon/</link>
		<comments>http://blog.rubyyot.com/2010/02/moving-soon/#comments</comments>
		<pubDate>Mon, 01 Feb 2010 22:31:38 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Personal]]></category>
		<category><![CDATA[dreamhost]]></category>
		<category><![CDATA[linode]]></category>
		<category><![CDATA[moving]]></category>
		<category><![CDATA[rubyyot]]></category>

		<guid isPermaLink="false">http://blog.rubyyot.com/?p=708</guid>
		<description><![CDATA[I got frustrated with Dreamhost the other day because they downgraded the version of git available on the server to v1.4.4.4.  That broke what I&#8217;d done with rubyyot.com.  So I got a virtual server on Linode.  It&#8217;s very nice so far.  Hang on things will be in transition for a little [...]]]></description>
			<content:encoded><![CDATA[<p>I got frustrated with Dreamhost the other day because they downgraded the version of git available on the server to v1.4.4.4.  That broke what I&#8217;d done with rubyyot.com.  So I got a virtual server on Linode.  It&#8217;s very nice so far.  Hang on things will be in transition for a little while.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.rubyyot.com/2010/02/moving-soon/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Can&#039;t find tokyocabinet native extentions</title>
		<link>http://blog.rubyyot.com/2010/02/cant-find-tokyocabinet-native-extentions/</link>
		<comments>http://blog.rubyyot.com/2010/02/cant-find-tokyocabinet-native-extentions/#comments</comments>
		<pubDate>Mon, 01 Feb 2010 22:27:45 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Ruby]]></category>
		<category><![CDATA[edo]]></category>
		<category><![CDATA[error]]></category>
		<category><![CDATA[tokyo cabinet]]></category>

		<guid isPermaLink="false">http://blog.rubyyot.com/?p=706</guid>
		<description><![CDATA[I was trying out rufus/edo today after installing Tokyo Cabinet. and I kept getting the following error

/usr/local/lib/site_ruby/1.8/i486-linux/tokyocabinet.so: libtokyocabinet.so.9: cannot open shared object file: No such file or directory - /usr/local/lib/site_ruby/1.8/i486-linux/tokyocabinet.so &#40;LoadError&#41;
        from /usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in `require'
        from test.rb:1

The solution was to modify the [...]]]></description>
			<content:encoded><![CDATA[<p>I was trying out <a href="http://github.com/jmettraux/rufus-tokyo/blob/master/lib/rufus/edo/README.txt">rufus/edo</a> today after installing Tokyo Cabinet. and I kept getting the following error</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>site_ruby<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">1.8</span><span style="color: #000000; font-weight: bold;">/</span>i486-linux<span style="color: #000000; font-weight: bold;">/</span>tokyocabinet.so: libtokyocabinet.so.9: cannot open shared object <span style="color: #c20cb9; font-weight: bold;">file</span>: No such <span style="color: #c20cb9; font-weight: bold;">file</span> or directory - <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>site_ruby<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">1.8</span><span style="color: #000000; font-weight: bold;">/</span>i486-linux<span style="color: #000000; font-weight: bold;">/</span>tokyocabinet.so <span style="color: #7a0874; font-weight: bold;">&#40;</span>LoadError<span style="color: #7a0874; font-weight: bold;">&#41;</span>
        from <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>ruby<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">1.8</span><span style="color: #000000; font-weight: bold;">/</span>rubygems<span style="color: #000000; font-weight: bold;">/</span>custom_require.rb:<span style="color: #000000;">31</span>:<span style="color: #000000; font-weight: bold;">in</span> <span style="color: #000000; font-weight: bold;">`</span>require<span style="color: #ff0000;">'
        from test.rb:1</span></pre></div></div>

<p>The solution was to modify the LD_LIBRARY_PATH to include /usr/local/lib</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#~/.bashrc</span>
&nbsp;
 <span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">LD_LIBRARY_PATH</span>=<span style="color: #007800;">$LD_LIBRARY_PATH</span>:<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>lib</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://blog.rubyyot.com/2010/02/cant-find-tokyocabinet-native-extentions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Railsbridge BugMash on now</title>
		<link>http://blog.rubyyot.com/2010/01/railsbridge-bugmash-on-now/</link>
		<comments>http://blog.rubyyot.com/2010/01/railsbridge-bugmash-on-now/#comments</comments>
		<pubDate>Sat, 16 Jan 2010 22:16:40 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Rails]]></category>
		<category><![CDATA[bugmash]]></category>
		<category><![CDATA[rails 3.0pre]]></category>
		<category><![CDATA[railsbridge]]></category>

		<guid isPermaLink="false">http://blog.rubyyot.com/?p=704</guid>
		<description><![CDATA[Railsbridge BugMash
The call went out the other day for participants in the Rails 3.0pre BugMash on Jan 16th &#8211; 17th.  Included were some imple instructions for cloning Rails 3 and creating a new Rails app from it.  So I pulled it down and gave Rails 3 a test spin.
Project
I decided to start a [...]]]></description>
			<content:encoded><![CDATA[<h3>Railsbridge BugMash</h3>
<p>The call went out the other day for participants in the <a href="http://railsbridge.org/news_items/10" target="_blank">Rails 3.0pre BugMash</a> on Jan 16th &#8211; 17th.  Included were some imple instructions for cloning Rails 3 and creating a new Rails app from it.  So I pulled it down and gave Rails 3 a test spin.</p>
<h3>Project</h3>
<p>I decided to start a project for making a sort of universal friends list.  One that encorporates XFN tags and OpenID.  The data could then be used as a resource for other sites to seed a friends list.  In order to claim an OpenID as your own you need to authenticate it.</p>
<h3>Bundler</h3>
<p>The first thing I noticed was the existance of the <a href="http://github.com/rubyyot/knowyou/blob/bugmash/Gemfile" target="_blank">Gemfile</a> in the rails root and how empty <a href="http://github.com/rubyyot/knowyou/blob/bugmash/config/environment.rb" target="_blank">config/environment.rb</a> is.  I&#8217;d read on about the new bundler and thought it was going to be painful, but I was wrong, it was actually a joy.  It even removed gem after I commented out the requirement statement in the Gemfile.</p>
<h3>Plugins</h3>
<p>I installed Authlogic as a plugin, after failing to get it working as a gem.  I&#8217;ve had the same issue with Rails 2.3 so I don&#8217;t think this is an issue with Rails 3.  The OpenId Authentication plugin worked fine as well.</p>
<h3>Routes</h3>
<p>The new routing module took a little getting used to, but after a few mistakes I got it working correctly.  In the end <a href="http://github.com/rubyyot/knowyou/blob/bugmash/config/routes.rb" target="_blank">config/routes.rb</a> looks much cleaner, and still contains lots of commented samples.  Also the legacy routing is commented by default, which is nice since that&#8217;s something I do anyway.</p>
<h3>Premade .gitignore</h3>
<p>Speaking of nice defaults, creating the rails app made .gitignore file for me with tmp / db / log already in it.  Very Nice!</p>
<h3>View validation</h3>
<p>One thing that came as a bit of a surprise to me that the views are validated against the models.  If you reference a field on the model in the view that does not exist, Rails will now error and tell you that it&#8217;s not there.  So you need to rake db:migrate to have it recognize the fields on a model.</p>
<h3>Conclusion</h3>
<p>I have really liked what I see of Rails 3 thus far.  Thanks to all those that have worked on it.  I think that I will start using this version by default.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.rubyyot.com/2010/01/railsbridge-bugmash-on-now/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Building rubyyot.com from scratch with Rack and Git</title>
		<link>http://blog.rubyyot.com/2010/01/building-rubyyot-com-from-scratch-with-rack-and-git/</link>
		<comments>http://blog.rubyyot.com/2010/01/building-rubyyot-com-from-scratch-with-rack-and-git/#comments</comments>
		<pubDate>Mon, 11 Jan 2010 04:33:34 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[rack]]></category>
		<category><![CDATA[rubyyot]]></category>

		<guid isPermaLink="false">http://blog.rubyyot.com/?p=695</guid>
		<description><![CDATA[2010 is here, where did the time go?
Huh?  It&#8217;s 2010?  I haven&#8217;t posted in 6 months?  What happened?
Summer of Learning Challenge
The Summer of Learning Challenge didn&#8217;t happen.  I didn&#8217;t even do it.  No excuses.  I did other things.
All is not lost
Around the end of 2009, I dusted off my [...]]]></description>
			<content:encoded><![CDATA[<h3>2010 is here, where did the time go?</h3>
<p>Huh?  It&#8217;s 2010?  I haven&#8217;t posted in 6 months?  What happened?</p>
<h3>Summer of Learning Challenge</h3>
<p>The <a href="http://blog.rubyyot.com/2009/05/summer-of-learning-challenge" target="_blank">Summer of Learning Challenge</a> didn&#8217;t happen.  I didn&#8217;t even do it.  No excuses.  I did other things.</p>
<h3>All is not lost</h3>
<p>Around the end of 2009, I dusted off my idea of creating a git based wiki like publishing portal with Rack.  I put it together in about a week or so and it&#8217;s slowly evolving and gaining some content.  It&#8217;s fun, even exciting, to bypass frameworks and DSLs and all the opinionated code and build something on the leanness that is Rack. A great learning opportunity to boot. So maybe something came of the challenge after all.</p>
<h3>Rubyyot &#8211; Rack + Git</h3>
<p>It&#8217;s up on <a href="http://www.rubyyot.com" target="_blank">rubyyot.com</a> with the <a href="http://github.com/rubyyot/rubyyot" target="_blank">source on github</a> still wonderfully rough around the edges and in need of a code review.  Ahh, to create something again.</p>
<h3>Flannel &#8211; Warm and fuzzy</h3>
<p>I made my own markup parser for this, it&#8217;s called<a title="Flannel" href="http://rubyyot.com/flannel" target="_blank"> flannel </a>and an liking it so far.  Of course it too is still in it&#8217;s infancy, but I&#8217;m not only using it to format my wiki thing, I&#8217;ve also given it a little command line attention to allow it to transform text files for my blog posts.  It&#8217;s warm, fuzzy and everything is just as I want it, and if not, I change it.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.rubyyot.com/2010/01/building-rubyyot-com-from-scratch-with-rack-and-git/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Getting started with ISpec and Ioke &#8211; part 4</title>
		<link>http://blog.rubyyot.com/2009/06/getting-started-with-ispec-and-ioke-part-4/</link>
		<comments>http://blog.rubyyot.com/2009/06/getting-started-with-ispec-and-ioke-part-4/#comments</comments>
		<pubDate>Wed, 24 Jun 2009 05:53:16 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Ioke]]></category>
		<category><![CDATA[ispec]]></category>

		<guid isPermaLink="false">http://blog.rubyyot.com/?p=674</guid>
		<description><![CDATA[Part 4
This is part 4 of the increasingly mis-named Getting started with Ispec and Ioke trilogy.  Last time we discussed the let keyword and I started working on the template object which represented the template to be parsed into a document.
 Previously I used ISpec to assert that we could evaluate on cells on [...]]]></description>
			<content:encoded><![CDATA[<h3>Part 4</h3>
<p>This is part 4 of the increasingly mis-named <em><a href="http://blog.rubyyot.com/getting-started-with-ispec-and-ioke/">Getting started with Ispec and Ioke trilogy</a></em>.  Last time we discussed the let keyword and I started working on the template object which represented the template to be parsed into a document.</p>
<p> Previously I used ISpec to assert that we could evaluate on cells on Bag.  I wanted to start off this time by proving to myself that I could just as easily use activatable cells on Bag as well.</p>

<div class="wp_syntax"><div class="code"><pre class="ioke" style="font-family:monospace;">    it(&quot;should evaluate method on bag&quot;,
      bag = Bag mimic
      bag bread = method(&quot;butter&quot;)
      evaluator = Evaluator mimic(bag)
      evaluator evaluate(bread) should == &quot;butter&quot;
    )</pre></div></div>

<p>As you can see, this time instead of assigning a string to a cell on the property bag an evaluating it, I instead assigned a method which returned a string to a cell and evaluated it.  Sure enough it worked without any changes to the code.  This creates some interesting possibilities, though I haven&#8217;t thought through all of the ramifications at the moment. </p>
<p>Sure enough it worked.</p>
<p>Next I wanted to push the envelope on Evaluator a little bit by defining the method which will do the work of parsing the template and injecting the values from the property bag into it.</p>

<div class="wp_syntax"><div class="code"><pre class="ioke" style="font-family:monospace;">describe(&quot;parsing&quot;,
    it(&quot;should return the template when the bag is nil&quot;,
      evaluator = Evaluator mimic(nil)
      template = Template mimic
      template text = &quot;An extra special template&quot;
&nbsp;
      document = evaluator combine(template)
      document should == &quot;An extra special template&quot;
    )
  )</pre></div></div>

<p>This is really a small step, and as I get more familiar with TDD and BDD, these seem to the the steps that I&#8217;m most comforable with lining up and knocking down when implementing new features. The other part of this is, doing the simplest thing that could possibly work to pass the spec / test.  In this case, this is the simplest thing.</p>

<div class="wp_syntax"><div class="code"><pre class="ioke" style="font-family:monospace;">Evaluator combine = method (
  &quot;Generates a document from a template and bag&quot;,
&nbsp;
  template,
  template text
)</pre></div></div>

<p>
From here, I think that the next step is going involve using Ioke&#8217;s implementation of Regexp, which I will need to read up on.  So I think I will cut this short for today and wait for next time for that topic.
</p>
<h3>The Code</h3>
<p>The code for this example is <a href="http://github.com/rubyyot/ioke-examples/tree/start_ispec_4" title="rubyyot at Github ioke-examples tag start_ispec_4" target="_blank" rel="me">available on github tagged as start_ispec_4</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.rubyyot.com/2009/06/getting-started-with-ispec-and-ioke-part-4/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Getting a project off the ground with TDD and Cucumber</title>
		<link>http://blog.rubyyot.com/2009/06/getting-a-project-off-the-ground-with-tdd-and-cucumber/</link>
		<comments>http://blog.rubyyot.com/2009/06/getting-a-project-off-the-ground-with-tdd-and-cucumber/#comments</comments>
		<pubDate>Mon, 22 Jun 2009 05:17:26 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Testing]]></category>
		<category><![CDATA[cucumber]]></category>
		<category><![CDATA[starting a project]]></category>
		<category><![CDATA[TDD]]></category>

		<guid isPermaLink="false">http://blog.rubyyot.com/?p=659</guid>
		<description><![CDATA[RSimpy
I am currently wrapping up an initial release of a new gem that wraps the Simpy.com API.  I like social bookmarking and used delicious for years before switching to Simpy as my primary service.  Simpy is not the biggest online bookmarking service, but I&#8217;ve decided to use it for reasons I will outline [...]]]></description>
			<content:encoded><![CDATA[<h3>RSimpy</h3>
<p>I am currently wrapping up an initial release of a new gem that wraps the <a href="http://simpy.com/" title="" target="_blank" rel="user">Simpy.com</a> API.  I like social bookmarking and used delicious for years before switching to Simpy as my primary service.  Simpy is not the biggest online bookmarking service, but I&#8217;ve decided to use it for reasons I will outline in another post.  In any case I&#8217;ve put together a gem that wraps the API with the help of Httparty.  It actually turned out much simpler than I expected it to be, httparty did all of the heavy lifting, but again that is for another post.</p>
<p>So, I have a functioning gem for Simpy, now I want to make something useful with it.  The reason I made the gem was to simplify my bookmarking which is overall a mess on multiple workstations in multiple locations.  Since I&#8217;ve recently been getting familia with cron, I&#8217;ve decided to make a script to store urls locally and use <a href="http://en.wikipedia.org/wiki/Cron" title="cron" target="_blank" rel="definition">cron</a> to run a script that pushes a file of pages to Simpy.</p>
<p>As I touched on briefly, I&#8217;ve been unhappy with all my previous bookmarking solutions thus far.  This time I want to make it, dead simple.  I don&#8217;t want to have to enter any additional information if I don&#8217;t want to, just a url and have it go on it&#8217;s merry way.  However to post the link, I will need to at least have the page title.  Pulling a page title from a url is really outside of the scope of RSimpy.  Ruby makes it fairly simple to do, but I don&#8217;t want to isolate the functionality to a script.  Ruminate to the rescue, but what is Ruminate?</p>
<h3>Ruminate</h3>
<p>Well the answer to that question is that I&#8217;m not really sure.  A few months back, I made a gem with jeweler called ruminate with the description  &#8220;Extracts statistics from html documents&#8221;.  Actually, I&#8217;m not really sure what I originally had in mind when I setup this gem, but it will be useful now since I want to extract at least the page title.  Once I get the ability to extract a page title, I can make a script that is simply glue code to put Ruminate together with RSimpy and voila!</p>
<h3>Bootstrapping the project</h3>
<p>I have a vague idea of something that I want Ruminate to do, that is I want to be able to query a url to return the title of the page.  It&#8217;s obviously not the entire purpose of the gem, but I&#8217;m sure that will be lots of other bits that will come together in time. </p>
<p>The question is, How do I kickstart this project with TDD to get it off the ground?</p>
<h3>Programming by Intention</h3>
<p><a title="programming by intention" target="blank" href="http://www.hans-eric.com/2007/09/05/tools-of-the-effective-developer-personal-planning/">Programming by intention</a> is the practice of writing code, while pretending that any methods or classes you might reference already exist and operate in the way that you reference them.  It&#8217;s a great way of uncovering a simple intuative API that you might otherwise would have missed.</p>
<p>I&#8217;ve seen it described in two books, first in <a href="http://www.pragprog.com/titles/bmsft/everyday-scripting-with-ruby"  target="_blank" title="Everyday scripting with Ruby" rel="book I've read"><em>Everyday Scripting with Ruby</em></a>, from The Pragmatic Bookshelf. Secondly, it&#8217;s used in an excellent book I&#8217;m currently reading called  <a href="http://www.javalobby.org/java/forums/t102176.html" target="_blank" title="Test Driven" rel="book I've read"><em>Test Driven</em></a> from Manning.</p>
<p>  There are <a href="http://bradwilson.typepad.com/blog/2009/04/its-not-tdd-its-design-by-example.html" target="_blank">a number</a> <a href="http://www.hanselman.com/blog/HanselminutesPodcast146TestDrivenDevelopmentIsDesignTheLastWordOnTDD.aspx" target="_blank">of sources</a> <a href="http://blog.jpboodhoo.com/DesignVsCodingHowMuchIsTooMuch.aspx" target="_blank">stating that</a> <a href="http://weblogs.asp.net/rosherove/archive/2007/10/08/the-various-meanings-of-tdd.aspx" target="_blank">TDD</a> <a href="http://blog.codiceplastico.com/?p=181" target="_blank">is about design first</a> <a href="http://davybrion.com/blog/2008/08/introducing-tdd-how-would-you-do-it/" target="_blank">and automated testing</a> <a href="http://www.lostechies.com/blogs/jimmy_bogard/archive/2008/04/22/should-you-tdd-when-flying-solo.aspx" target="_blank">is a nice by-product</a>.  In my limited experience with TDD, programming by intention is the crux of this design, and by extension the primary purpose of TDD.</p>
<h3>Cucumber</h3>
<p>One of the things that I really like about cucumber is that you can plainly state your intent and important bits of your feature focused domain in plain English and match that up to executable code. To describe the ability of Ruminate to grab the title of a url, I made the following test:</p>

<div class="wp_syntax"><div class="code"><pre class="cucumber" style="font-family:monospace;">Feature: Get Page Title
  In to get the page title
  A user of ruminate
  Will request a page title
&nbsp;
  Scenario: Requesting the title of a page from the page
    Given the url &quot;http://www.google.com&quot;
    When I execute the request
    Then the &quot;title&quot; should be &quot;Google&quot;</pre></div></div>

<p>I let cucumber auto-generate the regular expression blocks and came up with the following steps:</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;">&nbsp;
Given <span style="color:#006600; font-weight:bold;">/</span>^the url <span style="color:#996600;">&quot;([^<span style="color:#000099;">\&quot;</span>]*)&quot;</span>$<span style="color:#006600; font-weight:bold;">/</span> <span style="color:#9966CC; font-weight:bold;">do</span> <span style="color:#006600; font-weight:bold;">|</span>url<span style="color:#006600; font-weight:bold;">|</span>
  <span style="color:#0066ff; font-weight:bold;">@url</span> = url
<span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
<span style="color:#9966CC; font-weight:bold;">When</span> <span style="color:#006600; font-weight:bold;">/</span>^I execute the request$<span style="color:#006600; font-weight:bold;">/</span> <span style="color:#9966CC; font-weight:bold;">do</span>
  query = <span style="color:#996600;">&quot;Select title from #{@url};&quot;</span>
  <span style="color:#0066ff; font-weight:bold;">@result</span> = chew query
<span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
<span style="color:#9966CC; font-weight:bold;">Then</span> <span style="color:#006600; font-weight:bold;">/</span>^the <span style="color:#996600;">&quot;([^<span style="color:#000099;">\&quot;</span>]*)&quot;</span> should be <span style="color:#996600;">&quot;([^<span style="color:#000099;">\&quot;</span>]*)&quot;</span>$<span style="color:#006600; font-weight:bold;">/</span> <span style="color:#9966CC; font-weight:bold;">do</span> <span style="color:#006600; font-weight:bold;">|</span>msg, value<span style="color:#006600; font-weight:bold;">|</span>
  assert_equal value, <span style="color:#0066ff; font-weight:bold;">@result</span>
<span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div>

<p>As you can see I&#8217;ve decided to try out a sql like syntax for the tool.  I thought it sounded interesting, we&#8217;ll see if I keep it. In any case, I now need to make this test pass with the help of a mixin, that I&#8217;m including in features/support/env.rb</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#008000; font-style:italic;"># features/support/env.rb</span>
<span style="color:#ff6633; font-weight:bold;">$LOAD_PATH</span>.<span style="color:#9900CC;">unshift</span><span style="color:#006600; font-weight:bold;">&#40;</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:#006600; font-weight:bold;">+</span> <span style="color:#996600;">'/../../lib'</span><span style="color:#006600; font-weight:bold;">&#41;</span>
<span style="color:#CC0066; font-weight:bold;">require</span> <span style="color:#996600;">'ruminate'</span>
<span style="color:#9966CC; font-weight:bold;">include</span> Ruminate
&nbsp;
<span style="color:#CC0066; font-weight:bold;">require</span> <span style="color:#996600;">'test/unit/assertions'</span>
&nbsp;
World<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#6666ff; font-weight:bold;">Test::Unit::Assertions</span><span style="color:#006600; font-weight:bold;">&#41;</span></pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#008000; font-style:italic;"># lib/ruminate.rb</span>
<span style="color:#CC0066; font-weight:bold;">require</span> <span style="color:#996600;">'query_parser'</span>
<span style="color:#CC0066; font-weight:bold;">require</span> <span style="color:#996600;">'engine'</span>
&nbsp;
<span style="color:#9966CC; font-weight:bold;">module</span> Ruminate
  <span style="color:#9966CC; font-weight:bold;">def</span> chew query
    parser = <span style="color:#6666ff; font-weight:bold;">Ruminate::QueryParser</span>.<span style="color:#9900CC;">new</span>
    query_object = parser.<span style="color:#9900CC;">parse</span> query
    engine = <span style="color:#6666ff; font-weight:bold;">Ruminate::Engine</span>.<span style="color:#9900CC;">new</span>
&nbsp;
    engine.<span style="color:#9900CC;">execute</span> query_object
  <span style="color:#9966CC; font-weight:bold;">end</span>
<span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div>

<p>Here I&#8217;ve used the mixin to split the method into to operations and encapsulated each of these into a class.  Programming by intention has now generated a mixin and two classes that have a clean separation of responsibilities.  Here is the simplest thing that could possibly work to make the feature pass.</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#008000; font-style:italic;"># lib/query_parser.rb</span>
<span style="color:#9966CC; font-weight:bold;">module</span> Ruminate
  <span style="color:#9966CC; font-weight:bold;">class</span> QueryParser
    <span style="color:#9966CC; font-weight:bold;">def</span> parse query
      <span style="color:#0000FF; font-weight:bold;">nil</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>


<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#008000; font-style:italic;"># lib/engine.rb</span>
<span style="color:#9966CC; font-weight:bold;">module</span> Ruminate
  <span style="color:#9966CC; font-weight:bold;">class</span> Engine
    <span style="color:#9966CC; font-weight:bold;">def</span> execute query
      <span style="color:#996600;">&quot;Google&quot;</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>Obviously this isn&#8217;t the final code, but it gives us the minimal implementation to pass the feature.  Now I can turn to Test::Unit and shoulda to flesh out tests and implementations to make it work in a more useful manner.</p>
<p>What I really wanted to show here is how to get a TDD project started.  I know that I&#8217;ve struggled with this in the past.  What to test first can be a big decision, one that can create a type of code writers block. When this moment happened where everything just came together and I was able to generate a mixin and two orthagonal classes with a simple feature, I wanted to write it up.</p>
<h3>The Code</h3>
<p>The full code for this example can be found <a href="http://github.com/rubyyot/ruminate/tree/simplest-thing-that-could-possibly-work">on github with the tag simplest-thing-that-could-possibly-work</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.rubyyot.com/2009/06/getting-a-project-off-the-ground-with-tdd-and-cucumber/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
