<?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>Blog - ShiftEleven &#187; erb</title>
	<atom:link href="http://shifteleven.com/articles/tag/erb/feed" rel="self" type="application/rss+xml" />
	<link>http://shifteleven.com</link>
	<description></description>
	<lastBuildDate>Mon, 09 Jan 2012 04:04:19 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Converting ERB to HAML snippet</title>
		<link>http://shifteleven.com/articles/2008/06/08/converting-erb-to-haml-snippet?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=converting-erb-to-haml-snippet</link>
		<comments>http://shifteleven.com/articles/2008/06/08/converting-erb-to-haml-snippet#comments</comments>
		<pubDate>Sun, 08 Jun 2008 22:45:39 +0000</pubDate>
		<dc:creator>K. Adam Christensen</dc:creator>
				<category><![CDATA[Ruby off Rails]]></category>
		<category><![CDATA[erb]]></category>
		<category><![CDATA[haml]]></category>
		<category><![CDATA[merb]]></category>
		<category><![CDATA[snippet]]></category>

		<guid isPermaLink="false">http://shifteleven.com/?p=80</guid>
		<description><![CDATA[I&#8217;m playing around with merb so I&#8217;m using merb-gen to create some basic scaffolding; however, I&#8217;m not using ERB, the default rendering engine, I want to use haml Haml comes with a script, html2haml, which can take HTML with ERB &#8230; <a href="http://shifteleven.com/articles/2008/06/08/converting-erb-to-haml-snippet">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m playing around with <a href="http://merbivore.com/features.html,">merb</a> so I&#8217;m using <code>merb-gen</code> to create some basic scaffolding; however, I&#8217;m not using ERB, the default rendering engine, I want to use <a href="http://haml.hamptoncatlin.com/.">haml</a></p>
<p>Haml comes with a script, <code>html2haml</code>, which can take HTML with ERB and convert it nicely to haml.  Seeing as I would have to run that command more than once, I have a little command snippet that I like to use to aid with the conversion.</p>
<pre class="bash" title="code">$ find . -name '*erb' | \
xargs ruby -e 'ARGV.each { |i| puts "html2haml -r #{i} #{i.sub(/erb$/,"haml")}"}'</pre>
<p>That will print out what the <code>html2haml</code> commands would be, it does *not* run the command.  I do that step such that I can review what will be converted.  If I like what&#8217;s going to be done, then I just run that command and pipe it into bash&#8230;like so</p>
<pre class="bash" title="code">$ find . -name '*erb' | \
xargs ruby -e 'ARGV.each { |i| puts "html2haml -r #{i} #{i.sub(/erb$/,"haml")}"}' | \
bash</pre>
<p>If you like it, it probably wouldn&#8217;t hurt storing that as a shell script somewhere :)</p>
]]></content:encoded>
			<wfw:commentRss>http://shifteleven.com/articles/2008/06/08/converting-erb-to-haml-snippet/feed</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
	</channel>
</rss>

