Sunday, March 20, 2011

Simple script to convert ERB files to Haml


A simple script to convert .erb files from current directory to .haml :
#!/usr/bin/ruby
 
Dir.glob("*.html.erb").each do |erbname|
hamlname = erbname.gsub(".html.erb", ".html.haml")
system "/usr/bin/html2haml #{erbname} #{hamlname}"

No comments:

Post a Comment