<?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"
	>

<channel>
	<title>Rails Life</title>
	<atom:link href="http://www.railslife.com.ar/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.railslife.com.ar</link>
	<description>We live for this stuff!</description>
	<pubDate>Thu, 11 Dec 2008 00:00:47 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6</generator>
	<language>en</language>
			<item>
		<title>administrate_me 2: we&#8217;re almost there!</title>
		<link>http://www.railslife.com.ar/2008/12/10/administrate_me-2-were-almost-there/</link>
		<comments>http://www.railslife.com.ar/2008/12/10/administrate_me-2-were-almost-there/#comments</comments>
		<pubDate>Thu, 11 Dec 2008 00:00:47 +0000</pubDate>
		<dc:creator>juan</dc:creator>
		
		<category><![CDATA[administrate_me]]></category>

		<category><![CDATA[open source]]></category>

		<category><![CDATA[plugins]]></category>

		<category><![CDATA[rails]]></category>

		<guid isPermaLink="false">http://www.railslife.com.ar/?p=35</guid>
		<description><![CDATA[As you well know administrate_me is our beloved plugin, and it&#8217;s about to reach its two years old (and one amazing year since we opensourced it). We never stop using it and I believe that&#8217;s the main reason why this plugin has grown that much this year.
With administrate_me, we&#8217;re able to build a production-ready backend [...]]]></description>
			<content:encoded><![CDATA[<p>As you well know <a href="http://github.com/insignia/administrate_me/tree/master" target="_blank">administrate_me</a> is our beloved plugin, and it&#8217;s about to reach its two years old (and one amazing year since we opensourced it). We never stop using it and I believe that&#8217;s the main reason why this plugin has grown that much this year.</p>
<p>With administrate_me, we&#8217;re able to build a production-ready backend in a couple of minutes. It <img src="file:///C:/DOCUME~1/ADMINI~1/CONFIG~1/Temp/moz-screenshot-4.jpg" alt="" /><img src="file:///C:/DOCUME~1/ADMINI~1/CONFIG~1/Temp/moz-screenshot-5.jpg" alt="" /><img src="file:///C:/DOCUME~1/ADMINI~1/CONFIG~1/Temp/moz-screenshot-6.jpg" alt="" />simplifies almost any management task you need to build for a rails app, this way you can focus and put all your efforts into application&#8217;s frontend.</p>
<p>We&#8217;re almost done with administrate_me 2.0 version (I believe its release will be on or about December 18th), you can watch plugin&#8217;s progress on <a href="http://github.com/insignia/administrate_me/tree/master" target="_self">github</a> (even you can push some patches).</p>
<p>For those who can&#8217;t wait til December 18th, here you have a little snapshot of administrate_me&#8217;s backend new look</p>
<p><a href="http://www.railslife.com.ar/wp-content/uploads/2008/12/administrate_me_index_preview_3.png"><img class="alignnone size-full wp-image-36" title="administrate_me_index_preview_3" src="http://www.railslife.com.ar/wp-content/uploads/2008/12/administrate_me_index_preview_3.png" alt="" width="460" height="213" /></a></p>
<p><a href="http://www.railslife.com.ar/wp-content/uploads/2008/12/administrate_me_show_preview_1.png"><img class="alignnone size-full wp-image-37" title="administrate_me_show_preview_1" src="http://www.railslife.com.ar/wp-content/uploads/2008/12/administrate_me_show_preview_1.png" alt="" width="460" height="207" /></a></p>
<p><a href="http://www.railslife.com.ar/wp-content/uploads/2008/12/administrate_me_form_preview_1.png"><img class="alignnone size-full wp-image-38" title="administrate_me_form_preview_1" src="http://www.railslife.com.ar/wp-content/uploads/2008/12/administrate_me_form_preview_1.png" alt="" width="460" height="416" /></a></p>
<p>We&#8217;re definately there! yay!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.railslife.com.ar/2008/12/10/administrate_me-2-were-almost-there/feed/</wfw:commentRss>
		</item>
		<item>
		<title>backup_fu on Windows</title>
		<link>http://www.railslife.com.ar/2008/11/18/backup_fu-on-windows/</link>
		<comments>http://www.railslife.com.ar/2008/11/18/backup_fu-on-windows/#comments</comments>
		<pubDate>Tue, 18 Nov 2008 15:49:04 +0000</pubDate>
		<dc:creator>ckozus</dc:creator>
		
		<category><![CDATA[open source]]></category>

		<category><![CDATA[plugins]]></category>

		<category><![CDATA[rails]]></category>

		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://www.railslife.com.ar/?p=25</guid>
		<description><![CDATA[backup_fu is a nice Rails plugin to backup all your data to an S3 account. Sadly, it currently doesn&#8217;t work on windows.
Two bugs prevent it to run smoothly, first it depends on tar and gzip commands, which are not always available on that platform. Even though there are some native implementations, I&#8217;ve never found a [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://shanti.railsblog.com/backup-fu-makes-amazon-s3-backups-redonkulous">backup_fu</a> is a nice Rails plugin to backup all your data to an S3 account. Sadly, it currently doesn&#8217;t work on windows.</p>
<p>Two bugs prevent it to run smoothly, first it depends on tar and gzip commands, which are not always available on that platform. Even though there are some native implementations, I&#8217;ve never found a tar one that I could actually use, most of them just fail at archiving big files. I&#8217;ve fixed this using the <a href="http://raa.ruby-lang.org/project/minitar/">minitar</a> gem to generate a tar.gz file from the sql dump.</p>
<p>On the other hand, there is an <a href="http://rubyforge.org/tracker/index.php?func=detail&amp;aid=8171&amp;group_id=2409&amp;atid=9356">aws-s3 bug</a> that prevents files to be directly passed to the store() method to upload the files. Fixing this was just a matter to read the file using &#8216;rb&#8217; parameters for File.open().</p>
<p>You can see <a href="http://github.com/ckozus/backup_fu/commit/65b5734d9953fe6090b8c30389102c66ae37cf10">this</a> and <a href="http://github.com/ckozus/backup_fu/commit/42656dfe2323ec1e0a3f6cde5f384b32de413ee2">this</a> commit with the changes, a pull request has already been sent.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.railslife.com.ar/2008/11/18/backup_fu-on-windows/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Playing with delayed_job plugin</title>
		<link>http://www.railslife.com.ar/2008/11/13/playing-with-delayed_job-plugin/</link>
		<comments>http://www.railslife.com.ar/2008/11/13/playing-with-delayed_job-plugin/#comments</comments>
		<pubDate>Thu, 13 Nov 2008 19:27:53 +0000</pubDate>
		<dc:creator>juan</dc:creator>
		
		<category><![CDATA[open source]]></category>

		<category><![CDATA[plugins]]></category>

		<category><![CDATA[rails]]></category>

		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://www.railslife.com.ar/?p=19</guid>
		<description><![CDATA[The need for executing long task process is a common thing in large-scale rails projects these days. This is something any serious developer should be aware of. Make no mistake, long tasks can consume large amounts of servers resources, and they can provoke servers to crash when you request them via http.
A great solution for [...]]]></description>
			<content:encoded><![CDATA[<p>The need for executing long task process is a common thing in large-scale rails projects these days. This is something any serious developer should be aware of. Make no mistake, long tasks can consume large amounts of servers resources, and they can provoke servers to crash when you request them via http.</p>
<p>A great solution for this problem is the <a href="http://github.com/tobi/delayed_job/tree/master" target="_blank">delayed_job plugin</a> by <a href="http://blog.leetsoft.com/" target="_blank">Tobias Lütke</a>. This plugin is very easy to install, is very well documented, and provides you with everything you&#8217;ll need to execute task in background. I had the oportunity to try it out on <a href="http://www.burdastyle.com" target="_blank">burdastyle.com</a>, and it worked just fine. So, congratulations Tobi for this great work and thanks for sharing.</p>
<p>So, let&#8217;s try delayed_job plugin out.</p>
<p>First thing we need to do after we install this plugin is to generate a migration to add delayed_jobs table into our database. This migration should look like this:</p>
<pre><span class="keyword">class </span><span class="class">CreateDelayedJobs</span> <span class="punct">&lt;</span> <span class="constant">ActiveRecord</span><span class="punct">::</span><span class="constant">Migration</span>
  <span class="keyword">def </span><span class="method">self.up</span>
    <span class="ident">create_table</span> <span class="symbol">:delayed_jobs</span><span class="punct">,</span> <span class="symbol">:force</span> <span class="punct">=&gt;</span> <span class="constant">true</span> <span class="keyword">do</span> <span class="punct">|</span><span class="ident">table</span><span class="punct">|</span>
      <span class="ident">table</span><span class="punct">.</span><span class="ident">integer</span>  <span class="symbol">:priority</span><span class="punct">,</span> <span class="symbol">:default</span> <span class="punct">=&gt;</span> <span class="number">0</span>
      <span class="ident">table</span><span class="punct">.</span><span class="ident">integer</span>  <span class="symbol">:attempts</span><span class="punct">,</span> <span class="symbol">:default</span> <span class="punct">=&gt;</span> <span class="number">0</span>
      <span class="ident">table</span><span class="punct">.</span><span class="ident">text</span>     <span class="symbol">:handler</span>
      <span class="ident">table</span><span class="punct">.</span><span class="ident">string</span>   <span class="symbol">:last_error</span>
      <span class="ident">table</span><span class="punct">.</span><span class="ident">datetime</span> <span class="symbol">:run_at</span>
      <span class="ident">table</span><span class="punct">.</span><span class="ident">datetime</span> <span class="symbol">:locked_at</span>
      <span class="ident">table</span><span class="punct">.</span><span class="ident">datetime</span> <span class="symbol">:failed_at</span>
      <span class="ident">table</span><span class="punct">.</span><span class="ident">string</span>   <span class="symbol">:locked_by</span>
      <span class="ident">table</span><span class="punct">.</span><span class="ident">timestamps</span>
    <span class="keyword">end</span>
  <span class="keyword">end</span>

  <span class="keyword">def </span><span class="method">self.down</span>
  <span class="keyword">end</span>
<span class="keyword">end</span></pre>
<p>Then, we&#8217;ll need to define our jobs. A job is just a ruby class with a method called <strong>perform</strong>. Let&#8217;s say we need to send a very simple email notification to our entire users database. We can use this little class:      </p>
<pre><span class="keyword">class </span><span class="class">NotificationJob</span> <span class="punct">&lt;</span> <span class="constant">Struct</span><span class="punct">.</span><span class="ident">new</span><span class="punct">(</span><span class="symbol">:message</span><span class="punct">)</span>
  <span class="keyword">def </span><span class="method">perform</span>
    <span class="ident">total</span> <span class="punct">=</span> <span class="constant">User</span><span class="punct">.</span><span class="ident">count</span>
    <span class="ident">limit</span> <span class="punct">=</span> <span class="number">100</span>
    <span class="punct">(</span><span class="number">0</span><span class="punct">..</span><span class="ident">total</span><span class="punct">-</span><span class="number">1</span><span class="punct">).</span><span class="ident">step</span><span class="punct">(</span><span class="ident">limit</span><span class="punct">)</span> <span class="keyword">do</span> <span class="punct">|</span><span class="ident">offset</span><span class="punct">|</span>
       <span class="constant">User</span><span class="punct">.</span><span class="ident">find</span><span class="punct">(</span><span class="symbol">:all</span><span class="punct">,</span> <span class="symbol">:limit</span> <span class="punct">=&gt;</span> <span class="ident">limit</span><span class="punct">,</span> <span class="symbol">:offset</span> <span class="punct">=&gt;</span> <span class="ident">offset</span><span class="punct">).</span><span class="ident">each</span> <span class="keyword">do</span> <span class="punct">|</span><span class="ident">u</span><span class="punct">|</span>
         <span class="constant">Notifier</span><span class="punct">.</span><span class="ident">deliver_message_to_user</span><span class="punct">(</span><span class="ident">u</span><span class="punct">,</span> <span class="ident">message</span><span class="punct">)</span>
       <span class="keyword">end</span>
    <span class="keyword">end</span>
  <span class="keyword">end</span>
<span class="keyword">end</span>
</pre>
<p>Now, every time you need to send these notifications out, you just enqueue your job like this:  </p>
<pre><span class="constant">Delayed</span><span class="punct">::</span><span class="constant">Job</span><span class="punct">.</span><span class="ident">enqueue</span> <span class="constant">NotificationJob</span><span class="punct">.</span><span class="ident">new</span><span class="punct">(&quot;</span><span class="string">hello world!</span><span class="punct">&quot;)</span>
</pre>
<p>Finally, delayed_job plugin provides you with a set of rake tasks to put enqueue jobs to work: </p>
<pre><span class="ident">rake</span> <span class="ident">jobs</span><span class="symbol">:work</span>
</pre>
<p>And that&#8217;s all folks! Have fun with delayed_job.</p>
<p>Happy hacking!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.railslife.com.ar/2008/11/13/playing-with-delayed_job-plugin/feed/</wfw:commentRss>
		</item>
		<item>
		<title>administrate_me with BORT</title>
		<link>http://www.railslife.com.ar/2008/09/29/administrate_me-with-bort/</link>
		<comments>http://www.railslife.com.ar/2008/09/29/administrate_me-with-bort/#comments</comments>
		<pubDate>Tue, 30 Sep 2008 00:04:41 +0000</pubDate>
		<dc:creator>ckozus</dc:creator>
		
		<category><![CDATA[administrate_me]]></category>

		<category><![CDATA[open source]]></category>

		<category><![CDATA[rails]]></category>

		<guid isPermaLink="false">http://www.railslife.com.ar/?p=15</guid>
		<description><![CDATA[You probably have already heard of BORT, its a Base Rails Application that you can use to bootstrap your project. Believe me, you will save a few hours on each project using it and will be able to jump directly to the fun part.
We wanted to use it too, but most of our projects include [...]]]></description>
			<content:encoded><![CDATA[<p>You probably have already heard of <a href="http://jimneath.org/2008/09/09/bort-base-rails-application/">BORT</a>, its a Base Rails Application that you can use to bootstrap your project. Believe me, you will save a few hours on each project using it and will be able to jump directly to the fun part.</p>
<p>We wanted to use it too, but most of our projects include <a href="http://github.com/insignia/administrate_me/tree/master">administrate_me</a>,  so the best thing we could have done is to keep ourselves DRY and fork BORT to create a version including an installed and bootstraped administrate_me by default.</p>
<p>You can check out here <a href="http://github.com/insignia/bort/tree/master">our BORT version</a>. The same setup instructions apply as if it were a regular BORT app.</p>
<p>As a plus, this includes <a href="http://github.com/insignia/rspec-on-rails-matchers/">an updated version of rspec-on-rails-matchers plugin</a>, which is something that is also catching on on all of out projects lately.</p>
<p>Feel free to clone it, fork it and send all kind of patches and pull requests.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.railslife.com.ar/2008/09/29/administrate_me-with-bort/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Testing administrate_me with rspec shared behaviours and matchers</title>
		<link>http://www.railslife.com.ar/2008/09/27/testing-administrate_me-with-rspec-shared-behaviours-and-matchers/</link>
		<comments>http://www.railslife.com.ar/2008/09/27/testing-administrate_me-with-rspec-shared-behaviours-and-matchers/#comments</comments>
		<pubDate>Sat, 27 Sep 2008 20:10:14 +0000</pubDate>
		<dc:creator>ckozus</dc:creator>
		
		<category><![CDATA[administrate_me]]></category>

		<category><![CDATA[open source]]></category>

		<category><![CDATA[rails]]></category>

		<guid isPermaLink="false">http://www.railslife.com.ar/?p=13</guid>
		<description><![CDATA[Have you met administrate_me? (hint: The README file show&#8217;s you how to setup a rails app using administrate_me from from scratch) It&#8217;s Insignia&#8217;s plugin to handle our backend in the most agile and efficient way. You can see a simple administrate_me screenshot to check out what it looks like.
So, the news are that in a [...]]]></description>
			<content:encoded><![CDATA[<p>Have you met <a href="http://github.com/jmax/administrate_me">administrate_me</a>? (<strong>hint</strong>: The README file show&#8217;s you how to setup a rails app using administrate_me from from scratch) It&#8217;s Insignia&#8217;s plugin to handle our backend in the most agile and efficient way. You can see a simple <a href="http://www.insignia4u.com/blog/wp-content/uploads/2007/12/ame_look1.JPG">administrate_me screenshot</a> to check out what it looks like.</p>
<p>So, the news are that in a few hacking sessions we managed to create some rpsec <a href="http://www.robbyonrails.com/articles/2008/08/19/rspec-it-should-behave-like">shared behaviours</a> and <a href="http://tuples.us/2007/10/23/if-you-arent-writing-matchers-you-arent-using-rspec/">matchers</a> to help you test your controllers that use administrate_me.</p>
<p>On this files you can see the actual code of the specs, but most important, clear examples about how to use them: </p>
<p><a href="http://github.com/jmax/administrate_me/tree/master/lib/shared_behaviours.rb">administrate_me Shared Behaviours</a>: You can use them to check that your controllers are fully functional. It comes in two flavors: &#8216;basic administrate_me&#8217; and &#8216;basic administrate_me with parent&#8217; to test child controllers.</p>
<p><a href="http://github.com/jmax/administrate_me/tree/master/lib/rspec_matchers.rb">administrate_me Matchers</a>: For now you have just two matchers to check for the order set and the fields on which the search is allowed. There are more matchers to come.</p>
<p>Now you dont have excuse for not testing your controllers!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.railslife.com.ar/2008/09/27/testing-administrate_me-with-rspec-shared-behaviours-and-matchers/feed/</wfw:commentRss>
		</item>
		<item>
		<title>RWeather: Check your local weather using ruby</title>
		<link>http://www.railslife.com.ar/2008/09/07/rweather-check-your-local-weather-using-ruby/</link>
		<comments>http://www.railslife.com.ar/2008/09/07/rweather-check-your-local-weather-using-ruby/#comments</comments>
		<pubDate>Sun, 07 Sep 2008 14:20:03 +0000</pubDate>
		<dc:creator>ckozus</dc:creator>
		
		<category><![CDATA[open source]]></category>

		<category><![CDATA[ruby]]></category>

		<category><![CDATA[rweather]]></category>

		<guid isPermaLink="false">http://www.railslife.com.ar/?p=11</guid>
		<description><![CDATA[Well, I have to say that the main motivation to write this gem was just to write a gem. I&#8217;ve never done it before. That being said, here&#8217;s rweather with you. 
What does it do ?
It&#8217;s a ruby wrapper for the Weather XML Data Feed from weather.com. 
It currently has two features, searching locations to [...]]]></description>
			<content:encoded><![CDATA[<p>Well, I have to say that the main motivation to write this gem was just to write a gem. I&#8217;ve never done it before. That being said, here&#8217;s rweather with you. </p>
<p><strong>What does it do ?</strong></p>
<p>It&#8217;s a ruby wrapper for the <a href="http://www.weather.com/services/xmloap.html">Weather XML Data Feed</a> from <a href="http://www.weather.com/">weather.com</a>. </p>
<p>It currently has two features, searching locations to get their location_id and getting the weather current conditions for a given location.</p>
<p><strong>Getting the code and Installing</strong></p>
<p>The <a href="http://github.com/ckozus/rweather">rweather code</a> is of course available at github and is released with a MIT license.</p>
<p>To install it just do the usual:<br />
<code>sudo gem install ckozus-rweather --source http://gems.github.com</code></p>
<p><strong>How to Use It</strong></p>
<p>This is a simple script using rweather taken from the <a href="http://github.com/ckozus/rweather/tree/master/README">README</a>. It gets a list of matching locations and shows the current temperature and what it feels like.</p>
<style>
  div.gist {
      font-size: 70%;
  }
</style>
<p><script src="http://gist.github.com/9259.js"></script></p>
]]></content:encoded>
			<wfw:commentRss>http://www.railslife.com.ar/2008/09/07/rweather-check-your-local-weather-using-ruby/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Bookmarking your Google Shared Items on Delicious and Ma.gnolia</title>
		<link>http://www.railslife.com.ar/2008/08/31/bookmarking-your-google-shared-items-on-delicious-and-magnolia/</link>
		<comments>http://www.railslife.com.ar/2008/08/31/bookmarking-your-google-shared-items-on-delicious-and-magnolia/#comments</comments>
		<pubDate>Mon, 01 Sep 2008 01:10:11 +0000</pubDate>
		<dc:creator>ckozus</dc:creator>
		
		<category><![CDATA[open source]]></category>

		<category><![CDATA[scripts]]></category>

		<guid isPermaLink="false">http://www.railslife.com.ar/?p=4</guid>
		<description><![CDATA[I&#8217;ve been using delicious and Google Reader since they came out. When I&#8217;m reading and article on a site that&#8217;s worth saving, automatically use my delicious Firefox extension and bookmark that page. The same with Google Reader, if there an article I like among my feeds, automatically mark it as shared items (I use stars [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been using delicious and Google Reader since they came out. When I&#8217;m reading and article on a site that&#8217;s worth saving, automatically use my delicious Firefox extension and bookmark that page. The same with Google Reader, if there an article I like among my feeds, automatically mark it as shared items (I use stars to keep unread articles).</p>
<p>The problem presents when I want to search saved articles, i don&#8217;t have a centralized place to keep my favorites since they&#8217;re distributed between delicious and Google Reader.</p>
<p>Know I said: &#8220;Stop! It&#8217;s time to keep my bookmarks in sync!&#8221; So I came up with a script to automatically post my Google Shared Items to my delicious account.</p>
<p><strong>Requirements</strong></p>
<p>Install this gems</p>
<ul>
<li><a href="http://feed-normalizer.rubyforge.org/">feed-normalizer</a>: It will be used to read and parse the shared items atom feed.</li>
<li><a href="http://json.rubyforge.org/">json</a>: This will parse the JSON returned by the Yahoo Term Extraction API. If you&#8217;re on Windows install json_pure.</li>
<li><a href="http://mirrored.rubyforge.org/">mirrored</a>: It&#8217;s a gem to interact with delicious and ma.gnolia bookmark sites. So yes, this script will also work if you&#8217;re using magnolia to keep your bookmarks. Currently this gem does not allow to check if an invalid authentication has ocurred, but i&#8217;ve already cloned it on github to provide a patch for this problem.</li>
</ul>
<p><strong>The script</strong></p>
<p>The script it&#8217;s pretty straightforward, it will fetch your google reader items, iterate through each of them and post them to delicious if they&#8217;re not already there. As a plus, it will use the Yahoo Term Extraction API to get a list of tags for your bookmark.</p>
<style>
  div.gist {
      font-size: 70%;
  }
</style>
<p><script src="http://gist.github.com/8243.js"></script></p>
]]></content:encoded>
			<wfw:commentRss>http://www.railslife.com.ar/2008/08/31/bookmarking-your-google-shared-items-on-delicious-and-magnolia/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
