Code Beautifier Textmate Bundle
Textmate's indent functionality does a passable job of formatting your code BUT there is a great deal of room for improvement.
It only supports Ruby at present but does improve upon Textmate's indent functionality, in particular it is better at indenting multiline statements and cleans up white space.
It's all hosted on Github so if you want to make improvements then please fork away.
cd ~/Library/Application\ Support/TextMate/Bundles git clone git://github.com/mocoso/code-beautifier.tmbundle.git Code\ Beautifier.tmbundle
Then select 'Bundles > Bundle Editor > Reload Bundles' from Textmate's menus
Updated on 21 May 2009
Changed the URL of the repository on GitHub to http://github.com/mocoso/code-beautifier.tmbundle/tree/master to fix a typo in the name (oops).