Skip to content

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

Open
jirutka wants to merge 6 commits into
erniebrodeur:masterfrom
jirutka:fix-compat
Open

Rewrite #syntax_ok? to not start subprocess and fix Code Climate setup#43
jirutka wants to merge 6 commits into
erniebrodeur:masterfrom
jirutka:fix-compat

Conversation

@jirutka
Copy link
Copy Markdown

@jirutka jirutka commented Aug 26, 2017

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.

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 jirutka changed the title Rewrite #syntax_ok? to not start subprocess and fix Code Climate setup WIP: Rewrite #syntax_ok? to not start subprocess and fix Code Climate setup Aug 26, 2017
From https://github.com/guard/guard:
> To install for older versions, update Bundler at least 1.12: gem update
> bundler and Bundler should correctly resolve to earlier gems for your
> given Ruby version.
@jirutka jirutka changed the title WIP: Rewrite #syntax_ok? to not start subprocess and fix Code Climate setup Rewrite #syntax_ok? to not start subprocess and fix Code Climate setup Aug 26, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant