Permalink
Browse files

adding rails_two rake task

  • Loading branch information...
1 parent 42d3dfd commit 94ed818906c4ac2cdd1977c2be3a44d42f8253d4 @croaky croaky committed Nov 9, 2008
Showing with 20 additions and 0 deletions.
  1. +20 −0 tasks/rails_two.rake
View
20 tasks/rails_two.rake
@@ -0,0 +1,20 @@
+desc 'Renames all .rhtml views to .html.erb, .rjs to .js.rjs, .rxml to .xml.builder and .haml to .html.haml'
+namespace :rails_two do
+ task :rename_views do
+ Dir.glob('app/views/**/[^_]*.rhtml').each do |file|
+ puts `git mv #{file} #{file.gsub(/\.rhtml$/, '.html.erb')}`
+ end
+
+ Dir.glob('app/views/**/[^_]*.rjs').each do |file|
+ puts `git mv #{file} #{file.gsub(/\.rjs$/, '.js.rjs')}`
+ end
+
+ Dir.glob('app/views/**/[^_]*.rxml').each do |file|
+ puts `git mv #{file} #{file.gsub(/\.rxml$/, '.xml.builder')}`
+ end
+
+ Dir.glob('app/views/**/[^_]*.haml').each do |file|
+ puts `git mv #{file} #{file.gsub(/\.haml$/, '.html.haml')}`
+ end
+ end
+end

0 comments on commit 94ed818

Please sign in to comment.