Created
September 16, 2011 14:55
-
-
Save brentertz/1222286 to your computer and use it in GitHub Desktop.
# Convert erb to haml on command line...
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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