Created
June 15, 2011 06:39
-
-
Save sukeerthiadiga/1026599 to your computer and use it in GitHub Desktop.
Renames all *.rhtml views to .html.erb, .rjs to .js.rjs, .rxml to .xml.builder and .haml
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
namespace 'views' do | |
desc 'Renames all *.rhtml views to .html.erb, .rjs to .js.rjs, .rxml to .xml.builder, and .haml to .html.haml' | |
task 'rename' do | |
Dir.glob('app/views/**/*.rhtml').each do |file| | |
puts `git mv #{file} #{file.gsub(/\.rhtml$/, '.html.erb')}` | |
end | |
Dir.glob('app/views/**/[^_]*.rxml').each do |file| | |
puts `git mv #{file} #{file.gsub(/\.rxml$/, '.xml.builder')}` | |
end | |
Dir.glob('app/views/**/[^_]*.rjs').each do |file| | |
puts `git mv #{file} #{file.gsub(/\.rjs$/, '.js.rjs')}` | |
end | |
Dir.glob('app/views/**/[^_]*.haml').each do |file| | |
puts `git mv #{file} #{file.gsub(/\.haml$/, '.html.haml')}` | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment