<?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>Mundo Ruby &#187; rake</title>
	<atom:link href="http://www.mundoruby.com.ar/category/rake/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.mundoruby.com.ar</link>
	<description>Ruby Artists, Hackers y otras yerbas ...</description>
	<lastBuildDate>Wed, 12 Aug 2009 23:02:13 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>rake sh en otro directorio</title>
		<link>http://www.mundoruby.com.ar/2009/07/17/rake-sh-en-otro-directorio/</link>
		<comments>http://www.mundoruby.com.ar/2009/07/17/rake-sh-en-otro-directorio/#comments</comments>
		<pubDate>Fri, 17 Jul 2009 13:31:39 +0000</pubDate>
		<dc:creator>FreedomCoder</dc:creator>
				<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[how-to]]></category>
		<category><![CDATA[rake]]></category>

		<guid isPermaLink="false">http://www.mundoruby.com.ar/?p=151</guid>
		<description><![CDATA[Problema: Quiero ejecutar un comando desde otro directorio en rake (por ejemplo, ejecutar un makefile que está en un subdirectorio).
Solución: Agrego al rakefile la posibilidad de ejecutar comandos en otro directorio. Para eso, al principio de mi rakefile puse:

require 'fileutils'

def sh_in_dir( dirname, *args, &#38;block )
  old_path = pwd
  FileUtils.chdir( dirname )
  sh( [...]]]></description>
			<content:encoded><![CDATA[<p><span style="font-weight:bold;">Problema:</span> Quiero ejecutar un comando desde otro directorio en rake (por ejemplo, ejecutar un makefile que está en un subdirectorio).<br />
<span style="font-weight:bold;">Solución:</span> Agrego al rakefile la posibilidad de ejecutar comandos en otro directorio. Para eso, al principio de mi rakefile puse:</p>
<pre class="ruby"><span class="string">
<pre style="font-size: 1.1em; background-color: #ffffcc; color: #000000; overflow-x: auto; overflow-y: auto; margin-top: 4px; margin-right: 0px; margin-bottom: 4px; margin-left: 0px; width: 610px; padding: 10px; border: thin dashed initial;"><span style="color: #000044;">require</span> <span style="color: #444477; font-weight: bold;">'</span><span style="color: #994444;">fileutils</span><span style="color: #444477; font-weight: bold;">'</span>

<span style="color: #aa0000; font-weight: bold;">def </span><span style="color: #007777;">sh_in_dir</span><span style="color: #444477; font-weight: bold;">(</span> <span style="color: #000044;">dirname</span><span style="color: #444477; font-weight: bold;">,</span> <span style="color: #444477; font-weight: bold;">*</span><span style="color: #000044;">args</span><span style="color: #444477; font-weight: bold;">,</span> <span style="color: #444477; font-weight: bold;">&amp;</span><span style="color: #000044;">block</span> <span style="color: #444477; font-weight: bold;">)</span>
  <span style="color: #000044;">old_path</span> <span style="color: #444477; font-weight: bold;">=</span> <span style="color: #000044;">pwd</span>
  <span style="color: #0077ff;">FileUtils</span><span style="color: #444477; font-weight: bold;">.</span><span style="color: #000044;">chdir</span><span style="color: #444477; font-weight: bold;">(</span> <span style="color: #000044;">dirname</span> <span style="color: #444477; font-weight: bold;">)</span>
  <span style="color: #000044;">sh</span><span style="color: #444477; font-weight: bold;">(</span> <span style="color: #444477; font-weight: bold;">*</span><span style="color: #000044;">args</span><span style="color: #444477; font-weight: bold;">,</span> <span style="color: #444477; font-weight: bold;">&amp;</span><span style="color: #000044;">block</span> <span style="color: #444477; font-weight: bold;">)</span>
  <span style="color: #0077ff;">FileUtils</span><span style="color: #444477; font-weight: bold;">.</span><span style="color: #000044;">chdir</span><span style="color: #444477; font-weight: bold;">(</span> <span style="color: #000044;">old_path</span> <span style="color: #444477; font-weight: bold;">)</span>
<span style="color: #aa0000; font-weight: bold;">end</span></pre>
<p><span style="font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, fantasy; line-height: 19px; white-space: normal; font-size: 13px;">Happy hacking,</span></p>
<p></span></pre>
<p>Aureliano.</p>
<div class="blogger-post-footer"><img src="https://blogger.googleusercontent.com/tracker/1437970354124720603-7633002584629589611?l=aurelianito.blogspot.com" alt="" width="1" height="1" /></div>
<p>(Via <a href="http://aurelianito.blogspot.com/">aurelianito</a>.) Original Link: <a href="http://aurelianito.blogspot.com/2009/07/rake-sh-en-otro-directorio.html">rake sh en otro directorio</a></p>
<p><script type="text/javascript"><!--
google_ad_client = "pub-7949681675937032";
google_ad_slot = "0874687580";
google_ad_width = 468;
google_ad_height = 60;
//--></script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mundoruby.com.ar/2009/07/17/rake-sh-en-otro-directorio/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

