<?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>SameShirtEveryDay.com &#187; haml</title>
	<atom:link href="http://sameshirteveryday.com/tag/haml/feed/" rel="self" type="application/rss+xml" />
	<link>http://sameshirteveryday.com</link>
	<description>Personal blog of the one called Alex Gorbatchev, from Toronto, Canada.</description>
	<lastBuildDate>Wed, 30 Dec 2009 20:00:32 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.5</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>HAML bug with :javascript filter and undefined local variable or method</title>
		<link>http://sameshirteveryday.com/2009/04/19/haml-bug-with-javascript-filter-and-undefined-local-variable-or-method/</link>
		<comments>http://sameshirteveryday.com/2009/04/19/haml-bug-with-javascript-filter-and-undefined-local-variable-or-method/#comments</comments>
		<pubDate>Sun, 19 Apr 2009 19:05:51 +0000</pubDate>
		<dc:creator>Alex Gorbatchev</dc:creator>
				<category><![CDATA[Ruby]]></category>
		<category><![CDATA[bug]]></category>
		<category><![CDATA[haml]]></category>

		<guid isPermaLink="false">http://sameshirteveryday.com/?p=204</guid>
		<description><![CDATA[http://github.com/nex3/haml/issues#issue/2
on haml 2.0.9
require 'haml/engine'

template_broken = '
:javascript
  - [1, 2, 3, 4].each do &#124;item&#124;
    = "Hey #{item}"
'

puts Haml::Engine.new(template_broken).to_html
causes
(haml):3:in `to_html': undefined local variable or method `item' for #&#60;Object:0x2bedf64&#62; (NameError)
        from c:/ruby/lib/ruby/gems/1.8/gems/haml-2.0.9/lib/haml/engine.rb:149:in `to_html'
        from c:/ruby/lib/ruby/gems/1.8/gems/haml-2.0.9/lib/haml/engine.rb:149:in `instance_eval'
     [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://github.com/nex3/haml/issues#issue/2">http://github.com/nex3/haml/issues#issue/2</a></p>
<p>on haml 2.0.9</p>
<pre>require 'haml/engine'

template_broken = '
:javascript
  - [1, 2, 3, 4].each do |item|
    = "Hey #{item}"
'

puts Haml::Engine.new(template_broken).to_html</pre>
<p>causes</p>
<pre>(haml):3:in `to_html': undefined local variable or method `item' for #&lt;Object:0x2bedf64&gt; (NameError)
        from c:/ruby/lib/ruby/gems/1.8/gems/haml-2.0.9/lib/haml/engine.rb:149:in `to_html'
        from c:/ruby/lib/ruby/gems/1.8/gems/haml-2.0.9/lib/haml/engine.rb:149:in `instance_eval'
        from c:/ruby/lib/ruby/gems/1.8/gems/haml-2.0.9/lib/haml/engine.rb:149:in `to_html'
        from haml.rb:9</pre>
<p>Replacing <code>:javascript</code> filter with regular <code>%script</code> tag fixed the issue. It&#8217;s a workaround.</p>
<pre>require 'haml/engine'

template_broken = '
%script
  - [1, 2, 3, 4].each do |item|
    = "Hey #{item}"
'

puts Haml::Engine.new(template_broken).to_html</pre>
]]></content:encoded>
			<wfw:commentRss>http://sameshirteveryday.com/2009/04/19/haml-bug-with-javascript-filter-and-undefined-local-variable-or-method/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
