Skip to content

Instantly share code, notes, and snippets.

@fancyoung
Created October 27, 2011 07:01
Show Gist options
  • Save fancyoung/1318948 to your computer and use it in GitHub Desktop.
Save fancyoung/1318948 to your computer and use it in GitHub Desktop.
move all .erb file 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 #{file}`
end
end
end
path = File.join(File.dirname(__FILE__), 'app', 'views')
ToHaml.new(path).convert!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment