<?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; mac</title>
	<atom:link href="http://blog.igorfoox.com/tag/mac/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>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>

