Skip to content

Instantly share code, notes, and snippets.

@gunn
Created August 19, 2010 22:42
Show Gist options
  • Save gunn/539123 to your computer and use it in GitHub Desktop.
Save gunn/539123 to your computer and use it in GitHub Desktop.
Hamlize all views
require 'haml'
require 'haml/exec'
namespace :haml do
task :convert do
Dir.glob("app/views/**/*.html.erb").each do |html|
puts html + "..."
Haml::Exec::HTML2Haml.new([html, html.gsub(/\.erb$/, ".haml")]).process_result
File.delete(html)
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment