Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SublimeText 2 Ruby formatting

Has anyone found a good Ruby/Rails formatter? There is BeautifyRuby, but it gets strings written like Q%[] wrong because it aligns everything to the [] and it messes everything up.

Essentially it looks like this from a function auto formatted by beautifyruby:

 %x[#{cat_command} &]
    %x[#{join_command} &]
       return newintroname
       end

Does anyone have an idea how to fix this?

like image 563
Stpn Avatar asked Jun 26 '12 18:06

Stpn


2 Answers

The current version of beautifyRuby actually solves this problem.

like image 199
Stpn Avatar answered Oct 19 '22 10:10

Stpn


I recommend you to use RuboCop to find all the issues/suggestions/alternatives/good practices in Ruby. It is also available as a Sublime Text plugin.

Ruby Good Practices: https://github.com/bbatsov/ruby-style-guide

like image 29
Aravin Avatar answered Oct 19 '22 11:10

Aravin