Atom plugin to autoformat Ruby code with Rubyfmt
ruby
and rubyfmt
must already be installed and in your path:
$ which {ruby,rubyfmt}
/Users/tel/.rbenv/shims/ruby
/Users/tel/bin/rubyfmt
Through Atom packages (once released):
Settings/Preferences ->
Install ->
Search Packages: rubyfmt (enter)
On Windows/Linux: Alt + ;
On MacOS: Cmd + ;
With a file open and identified as Ruby or Ruby on Rails, hit the above combination to apply auto format.
If your file contains syntax errors it won't be formatted.
Format on save is disabled by default but can be enabled from the Package Settings.
If the Ruby code contains a syntax error it cannot be formatted. The syntax error will be displayed in a notification window.