Created
August 19, 2010 22:42
-
-
Save gunn/539123 to your computer and use it in GitHub Desktop.
Hamlize all views
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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