<?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; ruby on rails</title>
	<atom:link href="http://thinkingeek.com/tag/ruby-on-rails/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>Killing all rails logs with one Ctrl+C?</title>
		<link>http://thinkingeek.com/2007/09/08/killing-all-rails-logs-with-one-ctrlc/</link>
		<comments>http://thinkingeek.com/2007/09/08/killing-all-rails-logs-with-one-ctrlc/#comments</comments>
		<pubDate>Sat, 08 Sep 2007 17:28:12 +0000</pubDate>
		<dc:creator>jsegura</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[ruby on rails]]></category>
		<category><![CDATA[tips and tricks]]></category>

		<guid isPermaLink="false">http://thinkingeek.com/?p=76</guid>
		<description><![CDATA[Well, this is my first post after holidays and it won&#8217;t be very long. Imagine you are developing a rails application. Usually you have: a terminal with the server to see what petitions are received. a terminal with a tail of development.log to see what happens with the database. a terminal with a tail of [...]]]></description>
			<content:encoded><![CDATA[<p>Well, this is my first post after holidays and it won&#8217;t be very long.</p>
<p>Imagine you are developing a rails application. Usually you have:</p>
<ul>
<li>a terminal with the server to see what petitions are received.</li>
<li> a terminal with a tail of development.log to see what happens with the database.</li>
<li> a terminal with a tail of test.log if you are testing something.</li>
</ul>
<p>
This are a <strong>lot</strong> of windows&#8230; And the other day one friends was very happy and after asking for a while I discovered that the reason was the simple line showed above&#8230; With only one <strong>Ctrl+C</strong> you can kill all this processes <img src='http://thinkingeek.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">script<span style="color: #000000; font-weight: bold;">/</span>server <span style="color: #000000; font-weight: bold;">&amp;</span> <span style="color: #c20cb9; font-weight: bold;">tail</span> <span style="color: #660033;">-f</span> log<span style="color: #000000; font-weight: bold;">/</span>development.log <span style="color: #000000; font-weight: bold;">&amp;</span> <span style="color: #c20cb9; font-weight: bold;">tail</span> <span style="color: #660033;">-f</span> log<span style="color: #000000; font-weight: bold;">/</span>test.log <span style="color: #000000; font-weight: bold;">&amp;</span> <span style="color: #c20cb9; font-weight: bold;">tail</span> <span style="color: #660033;">-f</span> ; <span style="color: #7a0874; font-weight: bold;">jobs</span> <span style="color: #660033;">-p</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #ff0000;">'{print &quot;kill -2 &quot; $0}'</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">sh</span></pre></div></div>

<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fthinkingeek.com%2F2007%2F09%2F08%2Fkilling-all-rails-logs-with-one-ctrlc%2F&amp;linkname=Killing%20all%20rails%20logs%20with%20one%20Ctrl%2BC%3F" onclick="pageTracker._trackPageview('/outgoing/www.addtoany.com/share_save?linkurl=http_3A_2F_2Fthinkingeek.com_2F2007_2F09_2F08_2Fkilling-all-rails-logs-with-one-ctrlc_2F_amp_linkname=Killing_20all_20rails_20logs_20with_20one_20Ctrl_2BC_3F&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/09/08/killing-all-rails-logs-with-one-ctrlc/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Subversioning a Rails App</title>
		<link>http://thinkingeek.com/2007/06/22/subversioning-a-rails-app/</link>
		<comments>http://thinkingeek.com/2007/06/22/subversioning-a-rails-app/#comments</comments>
		<pubDate>Fri, 22 Jun 2007 14:02:02 +0000</pubDate>
		<dc:creator>jsegura</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[ruby on rails]]></category>
		<category><![CDATA[subversion]]></category>

		<guid isPermaLink="false">http://thinkingeek.com/?p=42</guid>
		<description><![CDATA[The time when application versions where stored in different folders or in zip files has ended. Today we have great tools like Subversion or CVS. This tools must be known by everybody, but for those who aren&#8217;t known, they are applications that control versions of files. While developing a Ruby on Rails application it&#8217;s good [...]]]></description>
			<content:encoded><![CDATA[<p>The time when application versions where stored in different folders or in zip files has ended. Today we have great tools like Subversion or CVS. This tools must be known by everybody, but for those who aren&#8217;t known, they are applications that control versions of files.</p>
<p>While developing a Ruby on Rails application it&#8217;s good to use a system like Subversion. In this howto I&#8217;ll explain my experience subversioning my Rails app.</p>
<p><span id="more-42"></span></p>
<p>The first step is to create a subversion repository. Mine is created with a web interface in my hosting account, if you can control your subversion repositories and you don&#8217;t know how to create it the chapter <a href="http://svnbook.red-bean.com/nightly/en/svn.reposadmin.create.html" onclick="pageTracker._trackPageview('/outgoing/svnbook.red-bean.com/nightly/en/svn.reposadmin.create.html?referer=');">Creating and Configuring your Repository</a> from SVN book may be useful. My repository url is (for example) http://someaccount.somehosting/myapp.</p>
<p>For subversioning a rails app we need, of course, a rails app. We&#8217;ll create a dummy app for testing. After that we have to import this directory structure to our repository</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">jsegura<span style="color: #000000; font-weight: bold;">@</span>ibook:~<span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>rails $ rails demo
      create 
      create  app<span style="color: #000000; font-weight: bold;">/</span>controllers
      create  app<span style="color: #000000; font-weight: bold;">/</span>helpers
      create  app<span style="color: #000000; font-weight: bold;">/</span>models
      create  app<span style="color: #000000; font-weight: bold;">/</span>views<span style="color: #000000; font-weight: bold;">/</span>layouts
      create  config<span style="color: #000000; font-weight: bold;">/</span>environments
jsegura<span style="color: #000000; font-weight: bold;">@</span>ibook:~<span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>rails$ <span style="color: #c20cb9; font-weight: bold;">svn</span> import demo http:<span style="color: #000000; font-weight: bold;">//</span>someaccount.somehosting<span style="color: #000000; font-weight: bold;">/</span>demo <span style="color: #660033;">-m</span> <span style="color: #ff0000;">&quot;Rails import&quot;</span></pre></div></div>

<p>The next actions have to be done in a working copy, the directory demo is no longer necessary.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">jsegura<span style="color: #000000; font-weight: bold;">@</span>ibook:~<span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>rails $ <span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #660033;">-rf</span> demo
jsegura<span style="color: #000000; font-weight: bold;">@</span>ibook:~<span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>rails $</pre></div></div>

<p>After obtaining the working copy we have to prepare our repository for developers usage. The steps are:</p>
<ol>
<li>Removing temp files</li>
<li>Removing log files</li>
</ol>
<p>To remove these files doesn&#8217;t mean &#8220;they are unnecessary&#8221;, only means &#8220;there is unnecessary for these files to stay in the repo&#8221; <img src='http://thinkingeek.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> .</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">jsegura<span style="color: #000000; font-weight: bold;">@</span>ibook:~<span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>rails<span style="color: #000000; font-weight: bold;">/</span>demo$ <span style="color: #c20cb9; font-weight: bold;">svn</span> remove log<span style="color: #000000; font-weight: bold;">/&lt;</span>strong<span style="color: #000000; font-weight: bold;">&gt;</span>
D         log<span style="color: #000000; font-weight: bold;">/</span>development.log
D         log<span style="color: #000000; font-weight: bold;">/</span>production.log
D         log<span style="color: #000000; font-weight: bold;">/</span>server.log
D         log<span style="color: #000000; font-weight: bold;">/</span>test.log
jsegura<span style="color: #000000; font-weight: bold;">@</span>ibook:~<span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>rails<span style="color: #000000; font-weight: bold;">/</span>demo$ <span style="color: #c20cb9; font-weight: bold;">svn</span> propset <span style="color: #c20cb9; font-weight: bold;">svn</span>:ignore <span style="color: #ff0000;">&quot;*.log&quot;</span> log<span style="color: #000000; font-weight: bold;">/</span>
property <span style="color: #ff0000;">'svn:ignore'</span> <span style="color: #000000; font-weight: bold;">set</span> on <span style="color: #ff0000;">'log'</span>
jsegura<span style="color: #000000; font-weight: bold;">@</span>ibook:~<span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>rails<span style="color: #000000; font-weight: bold;">/</span>demo <span style="color: #c20cb9; font-weight: bold;">svn</span>
<span style="color: #c20cb9; font-weight: bold;">svn</span>            <span style="color: #c20cb9; font-weight: bold;">svndumpfilter</span>  <span style="color: #c20cb9; font-weight: bold;">svnserve</span>       <span style="color: #c20cb9; font-weight: bold;">svnversion</span>     
<span style="color: #c20cb9; font-weight: bold;">svnadmin</span>       <span style="color: #c20cb9; font-weight: bold;">svnlook</span>        <span style="color: #c20cb9; font-weight: bold;">svnsync</span>       
jsegura<span style="color: #000000; font-weight: bold;">@</span>ibook:~<span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>rails<span style="color: #000000; font-weight: bold;">/</span>demo$ <span style="color: #c20cb9; font-weight: bold;">svn</span> ci <span style="color: #660033;">-m</span> <span style="color: #ff0000;">&quot;Remove and ignore log files&quot;</span>
Sending        demo<span style="color: #000000; font-weight: bold;">/</span>log
Deleting       demo<span style="color: #000000; font-weight: bold;">/</span>log<span style="color: #000000; font-weight: bold;">/</span>development.log
Deleting       demo<span style="color: #000000; font-weight: bold;">/</span>log<span style="color: #000000; font-weight: bold;">/</span>production.log
Deleting       demo<span style="color: #000000; font-weight: bold;">/</span>log<span style="color: #000000; font-weight: bold;">/</span>server.log
Deleting       demo<span style="color: #000000; font-weight: bold;">/</span>log<span style="color: #000000; font-weight: bold;">/</span>test.log
&nbsp;
Committed revision 3.</pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">jsegura<span style="color: #000000; font-weight: bold;">@</span>ibook:~<span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>rails<span style="color: #000000; font-weight: bold;">/</span>demo$ <span style="color: #c20cb9; font-weight: bold;">svn</span> remove tmp<span style="color: #000000; font-weight: bold;">/&lt;/</span>strong<span style="color: #000000; font-weight: bold;">&gt;</span>
D         tmp<span style="color: #000000; font-weight: bold;">/</span>cache
D         tmp<span style="color: #000000; font-weight: bold;">/</span>pids
D         tmp<span style="color: #000000; font-weight: bold;">/</span>sessions
D         tmp<span style="color: #000000; font-weight: bold;">/</span>sockets
jsegura<span style="color: #000000; font-weight: bold;">@</span>ibook:~<span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>rails<span style="color: #000000; font-weight: bold;">/</span>demo <span style="color: #c20cb9; font-weight: bold;">svn</span> propset <span style="color: #c20cb9; font-weight: bold;">svn</span>:ignore <span style="color: #ff0000;">&quot;*&quot;</span> tmp<span style="color: #000000; font-weight: bold;">/</span>
property <span style="color: #ff0000;">'svn:ignore'</span> <span style="color: #000000; font-weight: bold;">set</span> on <span style="color: #ff0000;">'tmp'</span>
jsegura<span style="color: #000000; font-weight: bold;">@</span>ibook:~<span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>rails<span style="color: #000000; font-weight: bold;">/</span>demo$ <span style="color: #c20cb9; font-weight: bold;">svn</span> ci <span style="color: #660033;">-m</span> <span style="color: #ff0000;">&quot;Remove and ignore temp files&quot;</span>
Sending        demo<span style="color: #000000; font-weight: bold;">/</span>tmp
Deleting       demo<span style="color: #000000; font-weight: bold;">/</span>tmp<span style="color: #000000; font-weight: bold;">/</span>cache
Deleting       demo<span style="color: #000000; font-weight: bold;">/</span>tmp<span style="color: #000000; font-weight: bold;">/</span>pids
Deleting       demo<span style="color: #000000; font-weight: bold;">/</span>tmp<span style="color: #000000; font-weight: bold;">/</span>sessions
Deleting       demo<span style="color: #000000; font-weight: bold;">/</span>tmp<span style="color: #000000; font-weight: bold;">/</span>sockets
&nbsp;
Committed revision 4.</pre></div></div>

<p>To end up, the only final step is not subversion the config for accessing the database.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">jsegura<span style="color: #000000; font-weight: bold;">@</span>ibook:~<span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>rails<span style="color: #000000; font-weight: bold;">/</span>demo$ <span style="color: #c20cb9; font-weight: bold;">svn</span> propset <span style="color: #c20cb9; font-weight: bold;">svn</span>:ignore <span style="color: #ff0000;">&quot;database.yml&quot;</span> config<span style="color: #000000; font-weight: bold;">/</span>
property <span style="color: #ff0000;">'svn:ignore'</span> <span style="color: #000000; font-weight: bold;">set</span> on <span style="color: #ff0000;">'config'</span>
&nbsp;
jsegura<span style="color: #000000; font-weight: bold;">@</span>ibook:~<span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>rails<span style="color: #000000; font-weight: bold;">/</span>cdemo$ <span style="color: #c20cb9; font-weight: bold;">svn</span> ci <span style="color: #660033;">-m</span> <span style="color: #ff0000;">&quot;Ignoring database.yml&quot;</span>
Sending        demo<span style="color: #000000; font-weight: bold;">/</span>config
&nbsp;
Committed revision 5.
jsegura<span style="color: #000000; font-weight: bold;">@</span>ibook:~<span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>rails<span style="color: #000000; font-weight: bold;">/</span>demo$</pre></div></div>

<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fthinkingeek.com%2F2007%2F06%2F22%2Fsubversioning-a-rails-app%2F&amp;linkname=Subversioning%20a%20Rails%20App" onclick="pageTracker._trackPageview('/outgoing/www.addtoany.com/share_save?linkurl=http_3A_2F_2Fthinkingeek.com_2F2007_2F06_2F22_2Fsubversioning-a-rails-app_2F_amp_linkname=Subversioning_20a_20Rails_20App&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/22/subversioning-a-rails-app/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
