Late in the game, but this post still flies high on Google looking for similar solutions.
Install the html2haml , put it in your application / presentation directory and try:
find ./ -name '*.erb' -exec html2haml -e {} {}.haml \; find ./ -name "*.erb.haml" -exec sh -c 'mv "$1" "${1%.erb.haml}.haml"' _ {} \; find ./ -name '*.erb' -exec rm {} \;
The disadvantage of this solution is that it does not save the change history from old .erb files to your new .haml files. But at times, when the history of revising these view files does not really matter, I really liked this solution.
In addition, be sure to check for any errors in the html2haml line before deleting old .erb files.
joealba Jun 24 '15 at 13:34 2015-06-24 13:34
source share