Skip to content

Instantly share code, notes, and snippets.

@zakgrant
Created April 13, 2012 09:55
Show Gist options
  • Save zakgrant/2375494 to your computer and use it in GitHub Desktop.
Save zakgrant/2375494 to your computer and use it in GitHub Desktop.
ERB 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')}`
`rm -Rf #{file}`
end
end
end
path = File.expand_path(File.join('app', 'views', "devise"))
ToHaml.new(path).convert!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment