<?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>Ruy Rocha &#187; interactive ruby shell</title>
	<atom:link href="http://ruyrocha.com/tag/interactive-ruby-shell/feed/" rel="self" type="application/rss+xml" />
	<link>http://ruyrocha.com</link>
	<description>it&#039;s a long way to the top if you wanna rock and roll</description>
	<lastBuildDate>Thu, 01 Mar 2012 11:53:15 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>IRB &#8211; Interactive Ruby Shell</title>
		<link>http://ruyrocha.com/irb-interactive-ruby-shell/</link>
		<comments>http://ruyrocha.com/irb-interactive-ruby-shell/#comments</comments>
		<pubDate>Tue, 13 Jul 2010 20:57:25 +0000</pubDate>
		<dc:creator>Ruy Rocha</dc:creator>
				<category><![CDATA[Ruby]]></category>
		<category><![CDATA[interactive ruby shell]]></category>
		<category><![CDATA[irb]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://ruyrocha.com/?p=67</guid>
		<description><![CDATA[Passar batido sem falar do irb ficaria um tanto complicado. Você vê tuas linhas ganharem vida no irb quando executa o código na unha. O irb pode lêr sua configuração de um ~/.irbrc da vida. O que uso: require 'irb/completion' require 'irb/ext/save-history' &#160; IRB.conf&#91;:SAVE_HISTORY&#93; = 1000 IRB.conf&#91;:HISTORY_FILE&#93; = &#34;#{ENV['HOME']}/.irb-save-history&#34; puts &#34;History configured.&#34; &#160; # auto-indent [...]]]></description>
			<content:encoded><![CDATA[<p>Passar batido sem falar do irb ficaria um tanto complicado. Você vê tuas linhas ganharem vida no <strong>irb</strong> quando executa o código na unha.</p>
<p>O irb pode lêr sua configuração de um ~/.irbrc da vida. O que uso:</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#CC0066; font-weight:bold;">require</span> <span style="color:#996600;">'irb/completion'</span>
<span style="color:#CC0066; font-weight:bold;">require</span> <span style="color:#996600;">'irb/ext/save-history'</span>
&nbsp;
IRB.<span style="color:#9900CC;">conf</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#ff3333; font-weight:bold;">:SAVE_HISTORY</span><span style="color:#006600; font-weight:bold;">&#93;</span> = <span style="color:#006666;">1000</span>
IRB.<span style="color:#9900CC;">conf</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#ff3333; font-weight:bold;">:HISTORY_FILE</span><span style="color:#006600; font-weight:bold;">&#93;</span> = <span style="color:#996600;">&quot;#{ENV['HOME']}/.irb-save-history&quot;</span>
<span style="color:#CC0066; font-weight:bold;">puts</span> <span style="color:#996600;">&quot;History configured.&quot;</span>
&nbsp;
<span style="color:#008000; font-style:italic;"># auto-indent</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>
<span style="color:#CC0066; font-weight:bold;">puts</span> <span style="color:#996600;">&quot;Auto-indent on.&quot;</span>
&nbsp;
<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;">'map_by_method'</span>
<span style="color:#CC0066; font-weight:bold;">require</span> <span style="color:#996600;">'what_methods'</span>
<span style="color:#CC0066; font-weight:bold;">require</span> <span style="color:#996600;">'pp'</span>
<span style="color:#CC0066; font-weight:bold;">require</span> <span style="color:#996600;">'wirble'</span>
&nbsp;
THEME_FOR_WHITE_BKG = <span style="color:#006600; font-weight:bold;">&#123;</span>
      <span style="color:#008000; font-style:italic;"># delimiter colors</span>
      <span style="color:#ff3333; font-weight:bold;">:comma</span>              <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#ff3333; font-weight:bold;">:purple</span>,
      <span style="color:#ff3333; font-weight:bold;">:refers</span>             <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#ff3333; font-weight:bold;">:blue</span>,
&nbsp;
      <span style="color:#008000; font-style:italic;"># container colors (hash and array)</span>
      <span style="color:#ff3333; font-weight:bold;">:open_hash</span>          <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#ff3333; font-weight:bold;">:red</span>,
      <span style="color:#ff3333; font-weight:bold;">:close_hash</span>         <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#ff3333; font-weight:bold;">:red</span>,
      <span style="color:#ff3333; font-weight:bold;">:open_array</span>         <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#ff3333; font-weight:bold;">:red</span>,
      <span style="color:#ff3333; font-weight:bold;">:close_array</span>        <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#ff3333; font-weight:bold;">:red</span>,
&nbsp;
      <span style="color:#008000; font-style:italic;"># object colors</span>
      <span style="color:#ff3333; font-weight:bold;">:open_object</span>        <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#ff3333; font-weight:bold;">:dark_gray</span>,
      <span style="color:#ff3333; font-weight:bold;">:object_class</span>       <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#ff3333; font-weight:bold;">:purple</span>,
      <span style="color:#ff3333; font-weight:bold;">:object_addr_prefix</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#ff3333; font-weight:bold;">:blue</span>,
      <span style="color:#ff3333; font-weight:bold;">:object_line_prefix</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#ff3333; font-weight:bold;">:blue</span>,
      <span style="color:#ff3333; font-weight:bold;">:close_object</span>       <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#ff3333; font-weight:bold;">:dark_gray</span>,
      <span style="color:#008000; font-style:italic;"># symbol colors</span>
      <span style="color:#ff3333; font-weight:bold;">:symbol</span>             <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#ff3333; font-weight:bold;">:black</span>,
      <span style="color:#ff3333; font-weight:bold;">:symbol_prefix</span>      <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#ff3333; font-weight:bold;">:light_gray</span>,
&nbsp;
      <span style="color:#008000; font-style:italic;"># string colors</span>
      <span style="color:#ff3333; font-weight:bold;">:open_string</span>        <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#ff3333; font-weight:bold;">:blue</span>,
      :<span style="color:#CC0066; font-weight:bold;">string</span>             <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#ff3333; font-weight:bold;">:dark_gray</span>,
      <span style="color:#ff3333; font-weight:bold;">:close_string</span>       <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#ff3333; font-weight:bold;">:blue</span>,
&nbsp;
      <span style="color:#008000; font-style:italic;"># misc colors</span>
      <span style="color:#ff3333; font-weight:bold;">:number</span>             <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#ff3333; font-weight:bold;">:black</span>,
      <span style="color:#ff3333; font-weight:bold;">:keyword</span>            <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#ff3333; font-weight:bold;">:brown</span>,
      :<span style="color:#9966CC; font-weight:bold;">class</span>              <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#ff3333; font-weight:bold;">:red</span>,
      <span style="color:#ff3333; font-weight:bold;">:range</span>              <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#ff3333; font-weight:bold;">:blue</span>,
    <span style="color:#006600; font-weight:bold;">&#125;</span>
&nbsp;
<span style="color:#008000; font-style:italic;">#Wirble::Colorize.colors = THEME_FOR_WHITE_BKG</span>
Wirble.<span style="color:#9900CC;">init</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#ff3333; font-weight:bold;">:skip_prompt</span><span style="color:#006600; font-weight:bold;">=&gt;</span>true,:skip_history<span style="color:#006600; font-weight:bold;">=&gt;</span>true<span style="color:#006600; font-weight:bold;">&#41;</span>
Wirble.<span style="color:#9900CC;">colorize</span></pre></div></div>

<div class="al2fb_like_button"><div id="fb-root"></div><script type="text/javascript">
(function(d, s, id) {
  var js, fjs = d.getElementsByTagName(s)[0];
  if (d.getElementById(id)) return;
  js = d.createElement(s); js.id = id;
  js.src = "//connect.facebook.net/pt_BR/all.js#xfbml=1&appId=159773440769970";
  fjs.parentNode.insertBefore(js, fjs);
}(document, "script", "facebook-jssdk"));
</script>
<fb:like href="http://ruyrocha.com/irb-interactive-ruby-shell/" send="true" layout="standard" show_faces="true" width="450" action="like" font="arial" colorscheme="light" ref="AL2FB"></fb:like></div>]]></content:encoded>
			<wfw:commentRss>http://ruyrocha.com/irb-interactive-ruby-shell/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

