Skip to content
This repository has been archived by the owner on Jun 8, 2019. It is now read-only.

Commit

Permalink
adding rails_two rake task
Browse files Browse the repository at this point in the history
  • Loading branch information
Dan Croak committed Nov 9, 2008
1 parent 42d3dfd commit 94ed818
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions 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.