<?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>Igor&#8217;s blog &#187; rails</title>
	<atom:link href="http://blog.igorfoox.com/category/rails/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.igorfoox.com</link>
	<description></description>
	<lastBuildDate>Mon, 29 Nov 2010 18:33:24 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1</generator>
		<item>
		<title>Learning to read</title>
		<link>http://blog.igorfoox.com/2008/08/18/learning-to-read/</link>
		<comments>http://blog.igorfoox.com/2008/08/18/learning-to-read/#comments</comments>
		<pubDate>Mon, 18 Aug 2008 23:30:43 +0000</pubDate>
		<dc:creator>Igor</dc:creator>
				<category><![CDATA[Hacking]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[Work]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[reading]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[ruby on rails]]></category>
		<category><![CDATA[software engineering]]></category>

		<guid isPermaLink="false">http://blog.igorfoox.com/?p=127</guid>
		<description><![CDATA[No, this is not a post about illiteracy. OK, now that I got that off my shoulders&#8230; I&#8217;ve been learning Ruby on Rails for the past few weeks, and I&#8217;ve encountered an interesting question that I&#8217;ve faced a few times before and never really found a good answer to. How do you read code? And [...]]]></description>
			<content:encoded><![CDATA[<div style="align:right;">
<div class="wp-caption alignright" style="width: 171px"><a href="http://flickr.com/photos/youngrobv/2497132840/"><img title="Code" src="http://farm3.static.flickr.com/2231/2497132840_a288e5cae5_m.jpg" alt="Image licensed under Creative Commons" width="161" height="240" /></a><p class="wp-caption-text">Image licensed under Creative Commons</p></div>
<p><span class="caption"><a href="http://creativecommons.org/licenses/by-nc-nd/2.0/deed.en_CA"></a></span></div>
<p>No, this is not a post about illiteracy.</p>
<p>OK, now that I got that off my shoulders&#8230;</p>
<p>I&#8217;ve been learning Ruby on Rails for the past few weeks, and I&#8217;ve encountered an interesting question that I&#8217;ve faced a few times before and never really found a good answer to.</p>
<p>How do you read code?</p>
<p>And I don&#8217;t mean that in a metaphysical sense. I mean when you&#8217;re learning a new framework, language or technology you usually look at some code written in it to try and see how real world applications use it. These days you can pretty easily find Open Source code written in almost anything. What I find difficult is figuring how to read the code of these applications.</p>
<p>I&#8217;ve read a book about Ruby on Rails, so I understand the basics decently well. I&#8217;ve created a toy application just to see how to do it. But the jump from that to digging through source code for a full fledged real application is pretty huge. Where do you start? Initally I started looking at the models to try and understand the objects that the application dealt with. But I found that to be a bit confusing. Then I looked at some of the key controllers (like user authentication and those that handle the main pages) and also found that a bit confusing.</p>
<p>Finally I sort of settled on looking at a specific page in the app, looking through the view that generated it, then going to the controller that was invoked, and maybe looking at some helper methods and model code that I found there. I found that to be a reasonably understandable strategy. But I&#8217;m not really sure if it would have worked as well if I didn&#8217;t already have looked at some model/controller code before hand.</p>
<p>This is not specific to RoR. If you learn a new development environment, how do you figure out where to learn the code?</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.igorfoox.com/2008/08/18/learning-to-read/feed/</wfw:commentRss>
		<slash:comments>38</slash:comments>
		</item>
		<item>
		<title>Running &#8216;ri&#8217; with colors under Mac OS X</title>
		<link>http://blog.igorfoox.com/2008/07/29/running-ri-with-colors-under-mac-os-x/</link>
		<comments>http://blog.igorfoox.com/2008/07/29/running-ri-with-colors-under-mac-os-x/#comments</comments>
		<pubDate>Tue, 29 Jul 2008 20:18:18 +0000</pubDate>
		<dc:creator>Igor</dc:creator>
				<category><![CDATA[Hacking]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[Work]]></category>
		<category><![CDATA[color]]></category>
		<category><![CDATA[less]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[os x]]></category>
		<category><![CDATA[ri]]></category>

		<guid isPermaLink="false">http://blog.igorfoox.com/?p=114</guid>
		<description><![CDATA[Ruby has a command line utility called ri for looking up documentation, and ri has a nice feature of displaying its output with pretty colors. Unfortunately, when I tried to run it (ri -f ansi) what I got was: After tinkering about a bit I gave up. But today I decided that I&#8217;ll have my [...]]]></description>
			<content:encoded><![CDATA[<p>Ruby has a command line utility called <span style="font-family: Courier New;">ri</span><span style="font-family: sans-serif;"> for</span> looking up documentation, and <span style="font-family: Courier New;">ri</span> has a nice feature of displaying its output with pretty colors. Unfortunately, when I tried to run it (<span style="font-family: Courier New;">ri -f ansi</span>) what I got was:<br />
<img style="max-width: 800px;" src="http://blog.igorfoox.com/wp-content/uploads/2008/07/initial.png" alt="" /></p>
<p>After tinkering about a bit I gave up. But today I decided that I&#8217;ll have my damned pretty colors even if I have to spend a lifetime getting them! Thankfully it only took 10 minutes. <span style="font-family: Courier New;">ri</span> uses <span style="font-family: Courier New;">less</span> to display its output in a scrollable form, if you make it not use <span style="font-family: Courier New;">less</span> you get what you want by giving it the <span style="font-family: Courier New;">-T</span> option:<br />
<img style="max-width: 800px;" src="http://blog.igorfoox.com/wp-content/uploads/2008/07/middle.png" alt="" /></p>
<p>&#8220;But&#8230;but&#8230;but&#8230; I like scrollable output!&#8221;, says you, whimpering softly.</p>
<p>Well, stop your cryin&#8217;, so do I.</p>
<p><span style="font-family: Courier New;">less</span> itself takes an option to treat escape characters as escape characters (duh!) instead of just printing them. So you want to make it use it. Here&#8217;s what you want to add to your Bash profile file to make the magic happen:</p>
<pre># I likes pretty colors!!!1!!
export RI="-f ansi"
export LESS="-R"</pre>
<p>And the result is:<br />
<img style="max-width: 800px;" src="http://blog.igorfoox.com/wp-content/uploads/2008/07/awesome.png" alt="" /></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.igorfoox.com/2008/07/29/running-ri-with-colors-under-mac-os-x/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

