You must have the following gems installed:
- haml (or haml-rails)
- html2haml
- hpricot
- ruby_parser
Test the changes: (no files created)
find . -name '*erb' | xargs ruby -e 'ARGV.each { |i| puts "html2haml -r #{i} #{i.sub(/erb$/,"haml")}"}'
Perform the changes:
find . -name '*erb' | xargs ruby -e 'ARGV.each { |i| puts "html2haml -r #{i} #{i.sub(/erb$/,"haml")}"}' | bash
Thanks to: http://shifteleven.com/articles/2008/06/08/converting-erb-to-haml-snippet
Delete all files with ERB extensions:
find . -name '*erb' | xargs rm -rf ARGV