Skip to content

Instantly share code, notes, and snippets.

@david-hodgetts
Created September 5, 2011 09:33
Show Gist options
  • Save david-hodgetts/1194564 to your computer and use it in GitHub Desktop.
Save david-hodgetts/1194564 to your computer and use it in GitHub Desktop.
Convert views to Haml
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!
@david-hodgetts
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment