Created
February 18, 2013 06:02
-
-
Save patorash/4975372 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
# coding: utf-8 | |
require File.expand_path(File.dirname(__FILE__) + "/../../config/environment") | |
require 'erb2slim' | |
namespace :convert do | |
desc "Convert slim from erb" | |
task :erb2slim do | |
Dir::glob("#{Rails.root}/app/views/**/*.html.erb").each do |f| | |
open(f, 'r') {|file| | |
slim_string = Erb2Slim.convert(file.read) | |
File.open(f.sub(/\.erb$/, ".slim"), "w") {|file2| | |
file2.write(slim_string) | |
} | |
} | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment