ruby-beautify icon indicating copy to clipboard operation
ruby-beautify copied to clipboard

Rewrite `#syntax_ok?` to not start subprocess and fix Code Climate setup

Open jirutka opened this issue 8 years ago • 0 comments

The current method is very problematic, because it expects ruby command on the PATH. There may not be any, for example when user has only JRuby installed, or it may be different ruby than the one running ruby-beautify. It also doesn't work with JRuby on Windows, due to bug jruby/jruby#1187.

To make story short, it's better to avoid executing external command. This method with eval is copied from https://www.ruby-forum.com/topic/4419079#1130079; it seems to be safe and works without problems.

jirutka avatar Aug 26 '17 15:08 jirutka