Tabs are clearly the one true indentation style, but when you create a new Ruby on Rails project it uses spaces, which could lead to a mish-mash of tabs and spaces in your project, not good!
The solution? Convert them using this one simple trick from the root of the project:
for i in `find app -name *.rb`; do echo $i; cat $i | unexpand -t2 > $i.converted; mv $i.converted $i; done
Repeat as necessary for other directories (test, config etc.) and other file types (erb).
Everything is as easy as “-p -i -e” with perl…
find app -name *.rb -exec perl -p -i -e ‘s/ /\t/g’ \{\} \;
;)
Does Perl even work anymore? ;)