postmodern / chruby

Changes the current Ruby
MIT License
2.85k stars 190 forks source link

Add an environment variable $CHRUBY_SET_GEM_HOME to disable setting $GEM_HOME #423

Closed eregon closed 4 years ago

eregon commented 4 years ago

This is a proof-of-concept PR to address #422. It still needs documentation and a changelog entry.

@postmodern @havenwood What do you think?

eregon commented 4 years ago

@postmodern @havenwood Could we merge this? What do you think?

havenwood commented 4 years ago

This looks good to me.

The only question I would have is whether to check if the variable is set rather than "false" or 0. This seems like as good a solution as any to me, unless @postmodern has an opinion on it. It seems there are some shell libs (like bash-boolean-helpers) but hardly worth adopting here.

postmodern commented 4 years ago

Posted some thoughts: https://github.com/postmodern/chruby/issues/422#issuecomment-557379476

I've seen people prefer testing for "true" instead of not "false".

eregon commented 4 years ago

Posted some thoughts: #422 (comment)

Thanks, I replied there.

I've seen people prefer testing for "true" instead of not "false".

CHRUBY_SET_GEM_HOME has a conceptual default of true, so an explicit false seems the clearest to me.

eregon commented 4 years ago

I made a PR which doesn't need user configuration and just does the "right thing" based on whether the default gem home is writable: https://github.com/postmodern/chruby/pull/431

It seems better than this PR, so I'll close this.