keep binary compatible gem dir (for ruby 2.1)#272
Open
mswart wants to merge 1 commit intopostmodern:masterfrom
Open
keep binary compatible gem dir (for ruby 2.1)#272mswart wants to merge 1 commit intopostmodern:masterfrom
mswart wants to merge 1 commit intopostmodern:masterfrom
Conversation
Author
|
I overseen #235 as it is looks like a more general solution. |
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 for rubygems and the GEM_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 1.8.* and 1.9.* as 1.8 or 1.9.1 this value is not used for these rubies.
Contributor
There was a problem hiding this comment.
would you change rescue to rescue Exception?
If rbconfig is not available, it will throw an exception and the rescue will not catch.
thanks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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_VERSIONcalculation to be 2.1.0 for all 2.1.* ruby versions. This results in constant gem dirs and the same behavior as forrubygemsand 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_VERSIONvalue 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?