Convert ERB views to HAML
Convert your ERB views to HAML with this simple ruby script. Originally found at http://snippets.dzone.com/posts/show/6838
View as text
class ToHaml
def initialize(path)
@path = path
end
def convert!
Dir["#{@path}/**/*.erb"].each do |file|
`html2haml -rx #{file} #{file.gsub(/\.erb$/, '.haml')}`
end
end
end
path = File.join(File.dirname(__FILE__), 'app', 'views')
ToHaml.new(path).convert!
