<?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>CookedApple &#187; rails</title>
	<atom:link href="http://cookedapple.net/tag/rails/feed/" rel="self" type="application/rss+xml" />
	<link>http://cookedapple.net</link>
	<description>All our thoughts. Broadcasted.</description>
	<lastBuildDate>Tue, 24 Aug 2010 10:03:07 +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>Ruby: Getting current method name</title>
		<link>http://cookedapple.net/2008/10/22/ruby-getting-current-method-name/</link>
		<comments>http://cookedapple.net/2008/10/22/ruby-getting-current-method-name/#comments</comments>
		<pubDate>Wed, 22 Oct 2008 12:25:22 +0000</pubDate>
		<dc:creator>Piero Bozzolo</dc:creator>
				<category><![CDATA[Mac]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[1.8]]></category>
		<category><![CDATA[1.9]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[reflection]]></category>

		<guid isPermaLink="false">http://cookedapple.net/?p=235</guid>
		<description><![CDATA[In ruby 1.9 è possibile utilizzare la variabile __method__ per ottenere il nome del metodo attualmente chiamato. In ruby 1.8 non esiste un modo diretto per accedere al nome del metodo ma è possibile accedere alla variabile caller che, tra le altre informazioni, contiene il nome del metodo chiamante (tips trovato su internet). Ecco come [...]]]></description>
			<content:encoded><![CDATA[<p>In ruby 1.9 è possibile utilizzare la variabile __method__ per ottenere il nome del metodo attualmente chiamato. In ruby 1.8 non esiste un modo diretto per accedere al nome del metodo ma è possibile accedere alla variabile caller che, tra le altre informazioni, contiene il nome del metodo chiamante (tips trovato su internet). Ecco come creare un metodo funzionante su entrambe le versioni:</p>
<blockquote><p>def method_name<br />
if RUBY_VERSION.to_f &lt; 1.9<br />
caller[0]=~/`(.*?)&#8217;/<br />
$1<br />
else<br />
__method__<br />
end<br />
end</p></blockquote>
<p>Se chiamerò da un metodo <em>foo()</em> <strong>method_name</strong> otterò sempre &#8216;foo&#8217;</p>
]]></content:encoded>
			<wfw:commentRss>http://cookedapple.net/2008/10/22/ruby-getting-current-method-name/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Installazione gem mysql su MacOS X</title>
		<link>http://cookedapple.net/2008/08/06/installazione-gem-mysql-su-macos-x/</link>
		<comments>http://cookedapple.net/2008/08/06/installazione-gem-mysql-su-macos-x/#comments</comments>
		<pubDate>Wed, 06 Aug 2008 08:01:02 +0000</pubDate>
		<dc:creator>"The" Apple</dc:creator>
				<category><![CDATA[Mac]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[gem]]></category>
		<category><![CDATA[install]]></category>
		<category><![CDATA[mysql]]></category>

		<guid isPermaLink="false">http://cookedapple.net/?p=229</guid>
		<description><![CDATA[Quando attivi Mongrel su una macchina MacOS X (Intel) puoi avere questo messaggio: &#8220;WARNING: You&#8217;re using&#160;the&#160;Ruby-based&#160;MySQL&#160;library&#160;that ships with&#160; Rails. This&#160;library&#160;is not suited for production.&#160;Please&#160;install&#160;the&#160; C-based&#160;MySQL&#160;library&#160;instead&#160;(gem&#160;install&#160;mysql).&#8221; L&#8217;installazione corretta della gemma mysql è la seguente: sudo env ARCHFLAGS=&#8221;-arch i386&#8243; gem install mysql &#8212; &#8211;with-mysql-config=/usr/local/mysql/bin/mysql_config -with-mysql-dir=/usr/local/mysql]]></description>
			<content:encoded><![CDATA[<p>Quando attivi Mongrel su una macchina MacOS X (Intel) puoi avere questo messaggio:</p>
<blockquote><p><span style="border-collapse: collapse; font-family: verdana;"><span>&#8220;WARNING: You&#8217;re using&nbsp;<b style="background-color: rgb(255, 255, 102);">the</b>&nbsp;Ruby-<b style="background-color: rgb(255, 255, 102);">based</b>&nbsp;<b style="background-color: rgb(255, 255, 102);">MySQL</b>&nbsp;<b style="background-color: rgb(255, 255, 102);">lib<wbr>rary</b>&nbsp;that ships with&nbsp;</span><br />
<span>Rails. This&nbsp;<b style="background-color: rgb(255, 255, 102);">library</b>&nbsp;is not suited for production.&nbsp;<b style="background-color: rgb(255, 255, 102);">Please</b>&nbsp;<b style="background-color: rgb(255, 255, 102);">install</b>&nbsp;<b style="background-color: rgb(255, 255, 102);">the</b><wbr>&nbsp;</span><br />
<span><b style="background-color: rgb(255, 255, 102);">C</b>-<b style="background-color: rgb(255, 255, 102);">based</b>&nbsp;<b style="background-color: rgb(255, 255, 102);">MySQL</b>&nbsp;<b style="background-color: rgb(255, 255, 102);">library</b>&nbsp;<b style="background-color: rgb(255, 255, 102);">instead</b>&nbsp;<wbr>(gem&nbsp;<b style="background-color: rgb(255, 255, 102);">install</b>&nbsp;<b style="background-color: rgb(255, 255, 102);">mysql</b>).&#8221; </span></span></p>
</blockquote>
<p></p>
<p><span style="border-collapse: collapse; font-family: verdana;">L&#8217;installazione corretta della gemma mysql è la seguente:</span></p>
<blockquote><div>sudo env ARCHFLAGS=&#8221;-arch i386&#8243; gem install mysql &#8212; &#8211;with-mysql-config=/usr/<wbr>local/mysql/bin/mysql_config -with-mysql-dir=/usr/local/<wbr>mysql</div>
</blockquote>
<div></div>
]]></content:encoded>
			<wfw:commentRss>http://cookedapple.net/2008/08/06/installazione-gem-mysql-su-macos-x/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>10 Things Every Java Programmer Should Know About Ruby</title>
		<link>http://cookedapple.net/2007/12/12/10-things-every-java-programmer-should-know-about-ruby/</link>
		<comments>http://cookedapple.net/2007/12/12/10-things-every-java-programmer-should-know-about-ruby/#comments</comments>
		<pubDate>Wed, 12 Dec 2007 21:51:27 +0000</pubDate>
		<dc:creator>Piero Bozzolo</dc:creator>
				<category><![CDATA[rails]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://cookedapple.net/2007/12/12/10-things-every-java-programmer-should-know-about-ruby/</guid>
		<description><![CDATA[Sul sito Ruby-doc sono riportate le slides di Jim Weirich alla Open Source Conference del 2005 riguardo a ruby. Sono molto interessanti e utili, la lettura non porta via più di 10 minuti&#8230; Il link è questo Il blog di Weirich è questo]]></description>
			<content:encoded><![CDATA[<p>Sul sito Ruby-doc sono riportate le slides di <span>Jim Weirich alla Open Source Conference del 2005 riguardo a ruby.</span></p>
<p>Sono molto interessanti e utili, la lettura non porta via più di 10 minuti&#8230;</p>
<p>Il link è <a href="http://www.ruby-doc.org/docs/10 Things Every Java Programmer Should Know About Ruby/10things.tgz" target="_blank">questo</a></p>
<p>Il blog di Weirich è <a href="http://onestepback.org/" target="_blank">questo</a></p>
]]></content:encoded>
			<wfw:commentRss>http://cookedapple.net/2007/12/12/10-things-every-java-programmer-should-know-about-ruby/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Compile Time? Runtime? Anytime!</title>
		<link>http://cookedapple.net/2007/12/12/compile-time-runtime-anytime/</link>
		<comments>http://cookedapple.net/2007/12/12/compile-time-runtime-anytime/#comments</comments>
		<pubDate>Wed, 12 Dec 2007 21:28:33 +0000</pubDate>
		<dc:creator>Piero Bozzolo</dc:creator>
				<category><![CDATA[rails]]></category>
		<category><![CDATA[oop]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://cookedapple.net/2007/12/12/compile-time-runtime-anytime/</guid>
		<description><![CDATA[Una delle prime domande che mi viene posta quando parlo di Ruby a qualcuno è &#8216;come viene compilato il codice?&#8221; In parte rispondo con la pagina 400 del libro &#8216;Pragmatic Ruby Programming 2nd edition&#8217; di Dave Thomas (che consiglio vivamente di acquistare) &#8220;The important thing to remember about Ruby is that there isn’t a big [...]]]></description>
			<content:encoded><![CDATA[<p>Una delle prime domande che mi viene posta quando parlo di Ruby a qualcuno è &#8216;come viene compilato il codice?&#8221;</p>
<p>In parte rispondo con la pagina 400 del libro &#8216;Pragmatic Ruby Programming 2nd edition&#8217; di Dave Thomas (che consiglio vivamente di acquistare)</p>
<p>&#8220;The important thing to remember about Ruby is that there isn’t a big difference between<br />
&#8216;compile time&#8217; and &#8216;run time&#8217;. It’s all the same. You can add code to a running process.<br />
You can redeﬁne methods on the ﬂy, change their scope from public to private, and<br />
soon. You can even alter basic types, such as Class and Object.<br />
Once you get used to this ﬂexibility, it is hard to go back to a static language such as<br />
C++ or even to a half-static language such as Java.<br />
But then, why would you want to do that?&#8221;</p>
<p>Il grande vantaggio di Ruby è la possibilità di modificare e aggiungere metodi a runtime. Come è possibile questo?</p>
<p>Cominciamo col dire che, similmente a SmallTalk, per ruby ogni cosa è un oggetto con i suoi metodi, dal numero alla stringa, non come avviene in Java dove, ad esempio, abbiamo i tipi primitivi privi di metodi.</p>
<p>In un linguaggio OO standard gli oggetti vengono identificati dalla classe che ha istanziato l&#8217;oggetto stesso, as esempio un oggetto di tipo String in java sarà istanziato da una classe String. In ruby il tipo degli oggetti viene identificato in base ai metodi che possiedono. Ecco che grazie a questo abbiamo librerie come ActiveRecord (lo strato ORM di Rails) che senza scrivere quasi una riga di codice e senza scrivere metodi di accesso ai campi di una tabella ti permette di interrogare il database. Tutto viene fatto in automatico, a runtime.</p>
]]></content:encoded>
			<wfw:commentRss>http://cookedapple.net/2007/12/12/compile-time-runtime-anytime/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Imparare a fare i test con Rails</title>
		<link>http://cookedapple.net/2007/12/12/imparare-a-fare-i-test-con-rails/</link>
		<comments>http://cookedapple.net/2007/12/12/imparare-a-fare-i-test-con-rails/#comments</comments>
		<pubDate>Wed, 12 Dec 2007 11:34:12 +0000</pubDate>
		<dc:creator>"The" Apple</dc:creator>
				<category><![CDATA[play]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://cookedapple.net/2007/12/12/imparare-a-fare-i-test-con-rails/</guid>
		<description><![CDATA[Stiamo finalmente affrontando lo sviluppo con i test (Piero dirà: Era ora!!!). Una buona guida si trova QUI. Da una certa soddisfazione vedere che il codice che scrivi è più robusto e che può essere sottoposto a stress per vedere come si comporta e scoprire che si comporta bene!]]></description>
			<content:encoded><![CDATA[<p>Stiamo finalmente affrontando lo sviluppo con i test (Piero dirà: Era ora!!!). Una buona guida si trova <strong><a href="http://manuals.rubyonrails.com/read/chapter/20">QUI</a>.</strong></p>
<p>Da una certa soddisfazione vedere che il codice che scrivi è più robusto e che può essere sottoposto a stress  per vedere come si comporta e scoprire che si comporta bene!</p>
]]></content:encoded>
			<wfw:commentRss>http://cookedapple.net/2007/12/12/imparare-a-fare-i-test-con-rails/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Rails 2</title>
		<link>http://cookedapple.net/2007/12/07/rails-2/</link>
		<comments>http://cookedapple.net/2007/12/07/rails-2/#comments</comments>
		<pubDate>Fri, 07 Dec 2007 08:32:27 +0000</pubDate>
		<dc:creator>Piero Bozzolo</dc:creator>
				<category><![CDATA[play]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://cookedapple.net/2007/12/07/rails-2/</guid>
		<description><![CDATA[Sto aggiornando le ruby gems sul mio mac e ho appena avuto una sorpresa: Rails 2! La mia applicazione che sto sviluppando non lamenta di warning, ora farò la prova del nove]]></description>
			<content:encoded><![CDATA[<p>Sto aggiornando le ruby gems sul mio mac e ho appena avuto una sorpresa: Rails 2!</p>
<p>La mia applicazione che sto sviluppando non lamenta di warning, ora farò la prova del nove <img src='http://cookedapple.net/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://cookedapple.net/2007/12/07/rails-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
