fixed whitespace task mentioned in bug 1041

This commit is contained in:
cyberkov 2011-06-15 13:47:49 +02:00
parent cba63030c9
commit 94b152e733

View file

@ -2,19 +2,19 @@ namespace :whitespace do
desc 'Removes trailing whitespace' desc 'Removes trailing whitespace'
task :cleanup do task :cleanup do
sh %{for f in `find . -type f | grep -v -e '.git/' -e 'public/' -e '.png'`; 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 .; do sed -i 's/[ \t]*$//' $f; echo -n .;
done} done}
end end
desc 'Converts hard-tabs into two-space soft-tabs' desc 'Converts hard-tabs into two-space soft-tabs'
task :retab do task :retab do
sh %{for f in `find . -type f | grep -v -e '.git/' -e 'public/' -e '.png'`; 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 .; do sed -i 's/\t/ /g' $f; echo -n .;
done} done}
end end
desc 'Remove consecutive blank lines' desc 'Remove consecutive blank lines'
task :scrub_gratuitous_newlines do task :scrub_gratuitous_newlines do
sh %{for f in `find . -type f | grep -v -e '.git/' -e 'public/' -e '.png'`; 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 .; do sed -i '/./,/^$/!d' $f; echo -n .;
done} done}
end end
end end