keep binary compatible gem dir (for ruby 2.1) #272
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
ruby 2.1.* are binary compatible - therefore it is not needed to recompile gems when migrating between these versions. So the gem dir should not be different for these versions.
This patches adjusts the
RUBY_VERSION
calculation to be 2.1.0 for all 2.1.* ruby versions. This results in constant gem dirs and the same behavior as forrubygems
and theGEM_ROOT
.To minimize to risk to break something the adjusted paths are protected by a rescue block and were reexported so that it is ensured that we have an valid
RUBY_VERSION
value afterwards.Because the
RbConfig::CONFIG['ruby_version']
declared all 1.8.* as binary compatible this value is not used for 1.8 rubies.I hope this is the best way to adjust chruby.
I did not add any tests, as the setup scripts fails to download ruby 2.0 an ubuntu 14.04 and to really test this change a ruby 2.1.1 or 2.1.2 is needed. Did I miss something?