<?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>Railstic &#187; ruby</title>
	<atom:link href="http://railstic.com/tag/ruby/feed/" rel="self" type="application/rss+xml" />
	<link>http://railstic.com</link>
	<description>sharing experiences</description>
	<lastBuildDate>Mon, 15 Jun 2009 15:40:30 +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>Updating RubyGems to 1.2 (Manually)</title>
		<link>http://railstic.com/2008/08/updating-rubygems-to-12-manually/</link>
		<comments>http://railstic.com/2008/08/updating-rubygems-to-12-manually/#comments</comments>
		<pubDate>Wed, 27 Aug 2008 12:34:50 +0000</pubDate>
		<dc:creator>İ. Emre Kutlu</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[gem]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://izzetemrekutlu.com/blog/?p=45</guid>
		<description><![CDATA[This is what happened when I want to install rmagick gem. username@username-desktop:~$ sudo gem install rmagick Bulk updating Gem source index for: http://gems.rubyforge.org/ ERROR: could not find rmagick locally or in a repository What the hell&#8230; After some googling I found that RubGems 1.1.x is buggy and and update to RubyGems 1.2 is necessary. To [...]]]></description>
			<content:encoded><![CDATA[<p>
This is what happened when I want to install rmagick gem.<br />
</p>

<div class="wp_codebox"><table><tr id="p457"><td class="code" id="p45code7"><pre class="bash" style="font-family:monospace;">username<span style="color: #000000; font-weight: bold;">@</span>username-desktop:~$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> gem <span style="color: #c20cb9; font-weight: bold;">install</span> rmagick
Bulk updating Gem <span style="color: #7a0874; font-weight: bold;">source</span> index <span style="color: #000000; font-weight: bold;">for</span>: http:<span style="color: #000000; font-weight: bold;">//</span>gems.rubyforge.org<span style="color: #000000; font-weight: bold;">/</span>
ERROR:  could not <span style="color: #c20cb9; font-weight: bold;">find</span> rmagick locally or <span style="color: #000000; font-weight: bold;">in</span> a repository</pre></td></tr></table></div>

<p>
What the hell&#8230;<br />
After some googling I found that RubGems 1.1.x is buggy and and update to RubyGems 1.2 is necessary.<br />
To learn your RubyGems version:<br />
</p>

<div class="wp_codebox"><table><tr id="p458"><td class="code" id="p45code8"><pre class="bash" style="font-family:monospace;">username<span style="color: #000000; font-weight: bold;">@</span>username-desktop:~$ gem <span style="color: #660033;">-v</span>
1.1.0</pre></td></tr></table></div>

<p><span id="more-45"></span><br />
 I try to update RubyGems :<br />
</p>

<div class="wp_codebox"><table><tr id="p459"><td class="code" id="p45code9"><pre class="bash" style="font-family:monospace;">username<span style="color: #000000; font-weight: bold;">@</span>username-desktop:~$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> gem update <span style="color: #660033;">--system</span>
Updating RubyGems
Bulk updating Gem <span style="color: #7a0874; font-weight: bold;">source</span> index <span style="color: #000000; font-weight: bold;">for</span>: http:<span style="color: #000000; font-weight: bold;">//</span>gems.rubyforge.org<span style="color: #000000; font-weight: bold;">/</span>
Nothing to update</pre></td></tr></table></div>

<p>
After this failed attempt, I realized that RubyGems 1.1.x is really buggy. So I must go on manually to update RubyGems.<br />
<br />
<strong>Now the solution:</strong><br />
</p>
<ol>
<li>
Download <a href="http://rubyforge.org/frs/download.php/38844/rubygems-update-1.2.0.gem">rubygems-update-1.2.0.gem</a>
</li>
<li>
Change your directory where your downloaded gem is. In these example my gem is at Desktop.<br />
Now you must install <em>rubygems-update-1.2.0.gem</em>.</p>

<div class="wp_codebox"><table><tr id="p4510"><td class="code" id="p45code10"><pre class="bash" style="font-family:monospace;">username<span style="color: #000000; font-weight: bold;">@</span>username-desktop:~$ <span style="color: #7a0874; font-weight: bold;">cd</span> Desktop<span style="color: #000000; font-weight: bold;">/</span>
username<span style="color: #000000; font-weight: bold;">@</span>username-desktop:~<span style="color: #000000; font-weight: bold;">/</span>Desktop$ <span style="color: #c20cb9; font-weight: bold;">sudo</span> gem <span style="color: #c20cb9; font-weight: bold;">install</span> rubygems-update-1.2.0.gem</pre></td></tr></table></div>

</li>
<li>

<div class="wp_codebox"><table><tr id="p4511"><td class="code" id="p45code11"><pre class="bash" style="font-family:monospace;">username<span style="color: #000000; font-weight: bold;">@</span>username-desktop:~<span style="color: #007800;">$sudo</span> update_rubygems</pre></td></tr></table></div>

</li>
</ol>
<p>
To check if our process is successful :<br />
</p>

<div class="wp_codebox"><table><tr id="p4512"><td class="code" id="p45code12"><pre class="bash" style="font-family:monospace;">username<span style="color: #000000; font-weight: bold;">@</span>username-desktop:~<span style="color: #007800;">$gem</span> <span style="color: #660033;">-v</span>
1.2.0</pre></td></tr></table></div>

<p>
If you see <em>1.2.0</em>, you did it.</p>
]]></content:encoded>
			<wfw:commentRss>http://railstic.com/2008/08/updating-rubygems-to-12-manually/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Recursive methods with block in Ruby</title>
		<link>http://railstic.com/2008/08/recursive-methods-with-block/</link>
		<comments>http://railstic.com/2008/08/recursive-methods-with-block/#comments</comments>
		<pubDate>Tue, 26 Aug 2008 10:46:17 +0000</pubDate>
		<dc:creator>İ. Emre Kutlu</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[block]]></category>
		<category><![CDATA[method]]></category>
		<category><![CDATA[recursive]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://izzetemrekutlu.com/blog/?p=20</guid>
		<description><![CDATA[def comic&#40;cast&#41; cast.each do &#124;character&#124; unless character.is_a?&#40;Array&#41; yield&#40;character&#41; else comic&#40;character&#41; &#123;&#124;x&#124; yield x&#125; end end end This method takes an array as argument and checks each element if it is an Array. If the element is not an Array then the block is called. If the element is an Array then the same method is [...]]]></description>
			<content:encoded><![CDATA[<p></p>

<div class="wp_codebox"><table><tr id="p2016"><td class="code" id="p20code16"><pre class="ruby" style="font-family:monospace;"><span style="color:#9966CC; font-weight:bold;">def</span> comic<span style="color:#006600; font-weight:bold;">&#40;</span>cast<span style="color:#006600; font-weight:bold;">&#41;</span>
   cast.<span style="color:#9900CC;">each</span> <span style="color:#9966CC; font-weight:bold;">do</span> <span style="color:#006600; font-weight:bold;">|</span>character<span style="color:#006600; font-weight:bold;">|</span>
      <span style="color:#9966CC; font-weight:bold;">unless</span> character.<span style="color:#9900CC;">is_a</span>?<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#CC0066; font-weight:bold;">Array</span><span style="color:#006600; font-weight:bold;">&#41;</span>
         <span style="color:#9966CC; font-weight:bold;">yield</span><span style="color:#006600; font-weight:bold;">&#40;</span>character<span style="color:#006600; font-weight:bold;">&#41;</span>
      <span style="color:#9966CC; font-weight:bold;">else</span>
	 comic<span style="color:#006600; font-weight:bold;">&#40;</span>character<span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span><span style="color:#006600; font-weight:bold;">|</span>x<span style="color:#006600; font-weight:bold;">|</span> <span style="color:#9966CC; font-weight:bold;">yield</span> x<span style="color:#006600; font-weight:bold;">&#125;</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></td></tr></table></div>

<p>
This method takes an array as argument and checks each element if it is an <em>Array</em>.<br />
If the element is not an <em>Array</em> then the block is called.<br />
If the element is an <em>Array</em> then the same method is called with that element as an argument and with the same block.<br />
<br />
Now let&#8217;s look how we can call this method.</p>

<div class="wp_codebox"><table><tr id="p2017"><td class="code" id="p20code17"><pre class="ruby" style="font-family:monospace;">names = <span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#996600;">'lucky luke'</span>, <span style="color:#996600;">'jolly jumper'</span>, <span style="color:#996600;">'rin tin tin'</span>, <span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#996600;">'joe'</span>, <span style="color:#996600;">'william'</span>,<span style="color:#996600;">'jack'</span>, <span style="color:#996600;">'averell'</span><span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#93;</span>
comic<span style="color:#006600; font-weight:bold;">&#40;</span>names<span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span><span style="color:#006600; font-weight:bold;">|</span>c<span style="color:#006600; font-weight:bold;">|</span> <span style="color:#CC0066; font-weight:bold;">puts</span> c<span style="color:#006600; font-weight:bold;">&#125;</span></pre></td></tr></table></div>

<p>
<strong>Output :</strong></p>

<div class="wp_codebox"><table><tr id="p2018"><td class="code" id="p20code18"><pre class="bash" style="font-family:monospace;">lucky luke
jolly jumper
rin tin tin
joe
william
jack
averell</pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://railstic.com/2008/08/recursive-methods-with-block/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
