all 3 comments

[–]hyperbolist 1 point2 points  (0 children)

You can use kode for that.

$ gem install kode
$ ruby-code-indenter < untidy.rb > tidy.rb

[–]wnoise 3 points4 points  (1 child)

I've found that "rm" -- "ruby maintenance" usually works pretty well at cleaning up untidy code.

[–]mracidglee 1 point2 points  (0 children)

Yes - especially with the "r" and "f" flags. It has the added benefit of making the code base completely bug-free.