开发者

What tools are available to auto-format Ruby/Rails Code

I'm currently using GEdit with several plugins to do Ruby on Rails development. One thing I would like to 开发者_JAVA技巧have is a way to automatically format my source files (.rb, .*.erb, etc.) Ideally it would be something that I could call from the command line and/or GEdit.

Command line tool would be nice, because I can set up a Git hook to auto-format on commit.

What are my options? What are the pros and cons of each?


What about rubocop ?

rubocop -a will automatically fix your code syntax


It's not new but it works: http://www.arachnoid.com/ruby/rubyBeautifier.html


Not really an answer to your question, but I'm quite happy with RubyMine code formatter.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜