Skip to content

Instantly share code, notes, and snippets.

@lezi
Forked from wesgarrison/Gemfile
Created June 16, 2011 13:12
Show Gist options
  • Save lezi/1029203 to your computer and use it in GitHub Desktop.
Save lezi/1029203 to your computer and use it in GitHub Desktop.
class ConvertToHaml
def initialize
@from_path = File.join(File.dirname(__FILE__), 'app', 'views')
end
def convert!
Dir["#{@from_path}/**/*.erb"].each do |file|
puts file
# for each .erb file in the path, convert it & output to a .haml file
`bundle exec html2haml -ex #{file} #{file.gsub(/\.erb$/, '.haml')}`
end
end
end
ConvertToHaml.new.convert!
gem 'ruby_parser'
gem 'hpricot'
gem 'haml'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment