Glavin001/atom-beautify

Ruby beautification support

Glavin001 opened this issue · 11 comments

Just an FYI. ruby-beautify is no longer maintained:

erniebrodeur/ruby-beautify#3

Thanks for the notice @seanbuscay!

Any recommendations for alternatives by Ruby developers?

Not really, in terms of alternatives. It seems for now, it is still good to use. Just looks like if no one picks it up, it may become necessary to change. But, hey PHP_beatifier hasn't been updated for years and it is still used a lot.

Here's a list of results from the term: beautify off of RubyGems.org

http://rubygems.org/search?utf8=%E2%9C%93&query=beautify

Nothing looks any better.

I didn't know if I should reopen this, or open a new one. I've recently rebuilt the core of ruby-beautify around a much better lexing engine. I've already added a few options and run it against all my code, it works as I would expect it too.

You can now pick tabs or spaces as well as the indent count via options. I'm open to suggestions on other methods/ideas, and any bugs found against use cases out there.

Awesome! Great to see some development, @erniebrodeur. I am not a Ruby developer myself, however I can imagine that Ruby developers using Atom Beautify and Ruby Beautify will be very excited. Let me know if there's anything I should add to Atom Beautify to maximize usage of Ruby Beautify's new features. I don't think Atom Beautify currently supports any options right now: https://github.com/Glavin001/atom-beautify/blob/master/lib/langs/ruby-beautify.coffee

@Glavin001 Could you tell me how to set spaces as the default indent character for ruby-beautify?

@huanzhang This is just a makeshift way, but I have created the following ruby script named /path/to/my_rbeautify and set "Ruby rbeautify path" of the atom-beautify's Settings to the path of this script.

ARGV = %w(--spaces --indent_count 2) + ARGV
load '/Users/masayuki/.gem/ruby/2.2.0/bin/rbeautify'

The real path of the rbeautify can be detected by '$ type -a rbeautify'

@mh61503891 Seems your solution is more convenient for configuration, but I have just solved this by rebuild ruby-beautify(https://github.com/huanzhang/ruby-beautify/commit/4152fe6bbb37e11386b60daf52318004fa84eb6f).

To have spaces as default indention for ruby, I have submit a pull request to ruby-beautify(erniebrodeur/ruby-beautify#15)

rbeautify is completely messed up, if you try beautify a ruby file with it everything just gets removed inside the file! 👎

Could update to using rubocop with the -a/--auto-correct flag? at least it's something