###1. Prerequisites:
You must have the following gems installed:
- haml (or haml-rails)
- hpricot
- ruby_parser
###2. Create new HAML files
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
###3. Remove the ERB files Delete all files with ERB extensions: find . -name '*erb' | xargs rm -rf ARGV