Created
September 19, 2010 16:08
-
-
Save wesgarrison/586872 to your computer and use it in GitHub Desktop.
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
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! |
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
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