Skip to content

Instantly share code, notes, and snippets.

@brentertz
Created September 16, 2011 14:55
Show Gist options
  • Save brentertz/1222286 to your computer and use it in GitHub Desktop.
Save brentertz/1222286 to your computer and use it in GitHub Desktop.
# Convert erb to haml on command line...
gem install hpricot
gem install ruby_parser
# Find and list erb templates to convert, but don't convert
find . -name '*erb' | xargs ruby -e 'ARGV.each { |i| puts "html2haml -r #{i} #{i.sub(/erb$/,"haml")}"}'
# Find and convert erb to haml, (won't delete your erb)
find . -name '*erb' | xargs ruby -e 'ARGV.each { |i| puts "html2haml -r #{i} #{i.sub(/erb$/,"haml")}"}' | bash
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment