haml2erb is a tool for converting Haml to Erb markup.
Installing and loading haml2erb
haml2erb is currently distributed as a Rails plugin.
Simply move the main haml2erb directory into the vendor/plugins directory of your Rails application.
haml2erb command line or from Ruby call the
Haml2Erb.convert method to have Haml markup translated into Erb.
Example: Simple conversion
echo '.foo' | haml2erb # <div class='foo'></div>
Haml2Erb.convert('.foo') # => "<div class='foo'></div>\n"
For the original implementation: