Stpn
Stpn

Reputation: 6394

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?

Upvotes: 19

Views: 11009

Answers (2)

Stpn
Stpn

Reputation: 6394

The current version of beautifyRuby actually solves this problem.

Upvotes: 10

Aravin
Aravin

Reputation: 7067

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

Upvotes: 2

Related Questions