Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

jirutka
Copy link

@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