Never been to DZone Snippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

About this user

« Newer Snippets
Older Snippets »
Showing 1-2 of 2 total  RSS 

rake task to rename views to rails 2.0 format

// This task will rename your files to the rails 2.0 format, using git mv. Add it to /lib/tasks/rails.rake

   1  
   2  namespace 'views' do
   3    desc 'Renames all .rhtml views to .html.erb, .rjs to .js.rjs, .rxml to .xml.builder, and .haml to .html.haml'
   4    task 'rename' do
   5      Dir.glob('app/views/**/[^_]*.rhtml').each do |file|
   6        puts `git mv #{file} #{file.gsub(/\.rhtml$/, '.html.erb')}`
   7      end
   8  
   9      Dir.glob('app/views/**/[^_]*.rxml').each do |file|
  10        puts `git mv #{file} #{file.gsub(/\.rxml$/, '.xml.builder')}`
  11      end
  12  
  13      Dir.glob('app/views/**/[^_]*.rjs').each do |file|
  14        puts `git mv #{file} #{file.gsub(/\.rjs$/, '.js.rjs')}`
  15      end
  16      Dir.glob('app/views/**/[^_]*.haml').each do |file|
  17        puts `git mv #{file} #{file.gsub(/\.haml$/, '.html.haml')}`
  18      end
  19    end
  20  end

overwrite heroku code with an alien git repository

// Use this command in your repos directory to push to your heroku repos. Useful for github / heroku sync.

   1  
   2  git push -v -f git@heroku.com:<application>.git
« Newer Snippets
Older Snippets »
Showing 1-2 of 2 total  RSS