This gem provides a cli binary named 'rbeautify' that will pretty up ruby code.
$ gem install ruby-beautify
To Pretty up a file:
$ rbeautify filename
It can take mulitple filenames:
$ rbeautify a b c
Without a filename it reads from STDIN, suitable for piping:
$ curl 'http://example.org/ugly-file.rb' | rbeautify
It has help:
$ rbeautify -h
- Fork it
- Create your feature branch (
git checkout -b my-new-feature)
- Commit your changes (
git commit -am 'Added some feature')
- Push to the branch (
git push origin my-new-feature)
- Create new Pull Request
The original analyzer is available at: http://www.arachnoid.com/ruby/rubyBeautifier.html.
My work is based off of this sublime-text2 plugin: https://github.com/CraigWilliams/BeautifyRuby but cleaned up and made suitable for use directly in a shell.