0

I have a series of scripts that have a mixture of all kinds of spacing, tabs, or a complete lack thereof. Is there anything that can parse and clean .rb files in a similar manner to HTML Tidy?

Nakilon
  • 34,866
  • 14
  • 107
  • 142
Shane T
  • 212
  • 1
  • 5

3 Answers3

3

You can try the Ruby Script Beautifier.

makes
  • 6,438
  • 3
  • 40
  • 58
3
  1. Open in Vim
  2. gg=G
Community
  • 1
  • 1
Gareth
  • 133,157
  • 36
  • 148
  • 157
  • Thanks, wasn't aware of this. Looks like it works for indentation, but doesn't help with spacing or excess line returns -- still a big step in the right direction though. – Shane T Feb 03 '11 at 00:41
  • Sorry, yes the `=` is Vim's indentation command. I didn't realise from your question that you meant not-at-the-start-of-the-line spacings – Gareth Feb 03 '11 at 00:44
0

https://github.com/libc/tidy_ffi

This is also a nice solution, and works with 1.9.