<?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>Think In Geek &#187; tools</title>
	<atom:link href="http://thinkingeek.com/tag/tools/feed/" rel="self" type="application/rss+xml" />
	<link>http://thinkingeek.com</link>
	<description>In geek we trust</description>
	<lastBuildDate>Sat, 19 Jun 2010 22:00:55 +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>Customizing IRB</title>
		<link>http://thinkingeek.com/2007/06/27/customizing-irb/</link>
		<comments>http://thinkingeek.com/2007/06/27/customizing-irb/#comments</comments>
		<pubDate>Wed, 27 Jun 2007 16:40:49 +0000</pubDate>
		<dc:creator>jsegura</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[programming tips]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[tools]]></category>

		<guid isPermaLink="false">http://thinkingeek.com/?p=49</guid>
		<description><![CDATA[While developing a Ruby application or while learning ruby, one of the things you must use is IRB (interactive ruby). As in its man page is said &#8220;irb is a tool to execute interactively ruby expressions read from stdin.&#8221;. In this tool you can type and execute directly ruby code. It&#8217;s very useful but like [...]]]></description>
			<content:encoded><![CDATA[<p>While developing a Ruby application or while learning ruby, one of the things you must use is IRB (interactive ruby). As in its man page is said &#8220;irb is a tool to execute interactively ruby expressions read from stdin.&#8221;. In this tool you can type and execute directly ruby code. It&#8217;s very useful but like most other programs like <a href="http://www.vim.org/" onclick="pageTracker._trackPageview('/outgoing/www.vim.org/?referer=');">ViM</a> (Vi IMproved) the real power is its customization.</p>
<p>Here I post my .irbrc and to make things clear there are some explanations on each line.</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#008000; font-style:italic;"># autocompletion of methods when pressing TAB</span>
<span style="color:#CC0066; font-weight:bold;">require</span> <span style="color:#996600;">'irb/completion'</span>
<span style="color:#008000; font-style:italic;"># Wirble is a plugin to colorize your irb, it's installed from a gem (gem install -y wirble)</span>
<span style="color:#CC0066; font-weight:bold;">require</span> <span style="color:#996600;">'rubygems'</span>
<span style="color:#CC0066; font-weight:bold;">require</span> <span style="color:#996600;">'wirble'</span>
&nbsp;
<span style="color:#008000; font-style:italic;"># Make use of readline library</span>
ARGV.<span style="color:#9900CC;">concat</span> <span style="color:#006600; font-weight:bold;">&#91;</span> <span style="color:#996600;">&quot;--readline&quot;</span> <span style="color:#006600; font-weight:bold;">&#93;</span>
&nbsp;
<span style="color:#008000; font-style:italic;"># autoindent of code while typing it</span>
IRB.<span style="color:#9900CC;">conf</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#ff3333; font-weight:bold;">:AUTO_INDENT</span><span style="color:#006600; font-weight:bold;">&#93;</span>=<span style="color:#0000FF; font-weight:bold;">true</span>
&nbsp;
<span style="color:#008000; font-style:italic;"># wirble initializations</span>
Wirble.<span style="color:#9900CC;">init</span>
Wirble.<span style="color:#9900CC;">colorize</span></pre></div></div>

<p>
As I said before, IRB is very powerful and a proof is that in <a href="http://www.ruby-lang.org/" onclick="pageTracker._trackPageview('/outgoing/www.ruby-lang.org/?referer=');">Ruby Lang</a> they encourage you to <a href="http://tryruby.hobix.com/" onclick="pageTracker._trackPageview('/outgoing/tryruby.hobix.com/?referer=');">try ruby in your browser</a> with an embedded IRB.
</p>
<p>
Also in rails the console for debugging your application is an irb instance preloaded with all rails configuration. In <a href="http://www.railscasts.com/" onclick="pageTracker._trackPageview('/outgoing/www.railscasts.com/?referer=');">RailsCasts</a> there is a <a href="http://railscasts.com/episodes/48" onclick="pageTracker._trackPageview('/outgoing/railscasts.com/episodes/48?referer=');">screencast</a> that shows you some tricks about it.</p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fthinkingeek.com%2F2007%2F06%2F27%2Fcustomizing-irb%2F&amp;linkname=Customizing%20IRB" onclick="pageTracker._trackPageview('/outgoing/www.addtoany.com/share_save?linkurl=http_3A_2F_2Fthinkingeek.com_2F2007_2F06_2F27_2Fcustomizing-irb_2F_amp_linkname=Customizing_20IRB&amp;referer=');"><img src="http://thinkingeek.com/wp-content/plugins/add-to-any/share_save_120_16.gif" width="120" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://thinkingeek.com/2007/06/27/customizing-irb/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
