Skip to content
Extraits de code Groupes Projets
whitespace.rake 760 octets
Newer Older
  • Learn to ignore specific revisions
  • namespace :whitespace do
      desc 'Removes trailing whitespace'
    
        sh %{for f in `find . -type f | grep -v -e '.git/' -e 'public/' -e '.png'`;
              do cat $f | sed 's/[ \t]*$//' > tmp; cp tmp $f; rm tmp; echo -n .;
            done}
    
      desc 'Converts hard-tabs into two-space soft-tabs'
    
        sh %{for f in `find . -type f | grep -v -e '.git/' -e 'public/' -e '.png'`;
              do cat $f | sed 's/\t/  /g' > tmp; cp tmp $f; rm tmp; echo -n .;
            done}
    
      desc 'Remove consecutive blank lines'
      task :scrub_gratuitous_newlines do
    
        sh %{for f in `find . -type f | grep -v -e '.git/' -e 'public/' -e '.png'`;
              do cat $f | sed '/./,/^$/!d' > tmp; cp tmp $f; rm tmp; echo -n .;
            done}