Skip to content

Instantly share code, notes, and snippets.

@mtunjic
Created June 21, 2011 10:55
Show Gist options
  • Save mtunjic/1037618 to your computer and use it in GitHub Desktop.
Save mtunjic/1037618 to your computer and use it in GitHub Desktop.
Convert ERb 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!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment