Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ruby Source code Auto-Formatter [closed]

Tags:

What is the best option? I found:

  • https://github.com/jasonl/eden
  • http://www.arachnoid.com/ruby/rubyBeautifier.html

but they both seem slightly outdated. Special support for Rails (Knowing which files to format automagically and some other cool things) would be a plus, and a git hook script.

like image 814
joni Avatar asked Jun 10 '13 20:06

joni


2 Answers

There is RuboCop:

gem install rubocop
rubocop -a

It will also fix all the common mistakes.

like image 170
Dorian Avatar answered Sep 22 '22 10:09

Dorian


Just use vim, in command mode press gg=G

  1. gg - move cursor to the beginning of your file
  2. = - reindent
  3. G - till the end of file
like image 33
Rene Avatar answered Sep 20 '22 10:09

Rene