Skip to content

Commit

Permalink
[jrubyscripting] avoid polluting environment when auto-installing gems
Browse files Browse the repository at this point in the history
fixes boc-tothefuture/openhab-jruby#634;
regression from openhab#13151

Signed-Off-By: Cody Cutrer <cody@cutrer.us>
  • Loading branch information
ccutrer committed Aug 27, 2022
1 parent 5abbf2d commit 92af785
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,10 @@ private synchronized void configureGems(ScriptEngine engine) {
}

String[] gems = gemsConfigElement.getValue().get().split(",");
String gemCommand = "require 'bundler/inline'\nrequire 'openssl'\n\ngemfile(" + checkUpdate + ") do\n"
+ " source 'https://rubygems.org/'\n";
// Set update_native_env_enabled to false so that bundler doesn't leak
// into other script engines
String gemCommand = "require 'jruby'\nJRuby.runtime.instance_config.update_native_env_enabled = false\nrequire 'bundler/inline'\nrequire 'openssl'\n\ngemfile("
+ checkUpdate + ") do\n" + " source 'https://rubygems.org/'\n";
int validGems = 0;
for (String gem : gems) {
gem = gem.trim();
Expand Down

0 comments on commit 92af785

Please sign in to comment.